TGEA 1.7.1 Fullscreen Fx update
by Frank Bignone · 08/13/2008 (6:16 am) · 39 comments
Download Code File
This resource is an update of the previous TGEA fullscreen resource that I submitted few months ago. This update includes one major changes: it is now possible to set-up different effect for each GUI elements as illustrated in the following screenshot.

Just uncompress the engine folder inside your fresh TGEA 1.7.1 installation (or merge it with your code). Do the same things for the game folder.
I have put some shader examples with the utility functions to use them, like:
- doFxSepia(%gui) : set Sepia effect on a GUI
- doFxSpot(%gui) : set Spot effect on a GUI
- and so on... (look at scriptsAndAssets/client/scripts/shaders.cs for all available command
(change %gui with the gui name or id you will like to put the fx on it)
All comments from previous resources are still valid.
As an extra, I have also included two features for all GuiControl objects:
- re-activation of the tooltip
- auto-hiding feature (look the code on hiding)
Enjoy it, and if you come up with a nice shader, do not hesitate to share it.
This resource is an update of the previous TGEA fullscreen resource that I submitted few months ago. This update includes one major changes: it is now possible to set-up different effect for each GUI elements as illustrated in the following screenshot.

Just uncompress the engine folder inside your fresh TGEA 1.7.1 installation (or merge it with your code). Do the same things for the game folder.
I have put some shader examples with the utility functions to use them, like:
- doFxSepia(%gui) : set Sepia effect on a GUI
- doFxSpot(%gui) : set Spot effect on a GUI
- and so on... (look at scriptsAndAssets/client/scripts/shaders.cs for all available command
(change %gui with the gui name or id you will like to put the fx on it)
All comments from previous resources are still valid.
As an extra, I have also included two features for all GuiControl objects:
- re-activation of the tooltip
- auto-hiding feature (look the code on hiding)
Enjoy it, and if you come up with a nice shader, do not hesitate to share it.
About the author
Real programmers don't waste time recompiling; they patch the binary files... ... Real programmers don't waste time patching binary files; they patch memory.
#2

Nevertheless, it looks like there may be an issue when underwater... If you need to try it, just do a doFx(%gui), this will use the default shader which does nothing except rendering a 2D texture.
Important: Another aspect, you have to be careful with the alpha layer inside your shader when doing fx effect on GUI elements on top of others.
08/11/2008 (5:40 pm)
I do not seem to have the same issue as you can see with the following screenshot. Maybe it is due with the fact that i'm switching off the hrlrender when doing fullscreen fx (do not work correctly together at moment).
Nevertheless, it looks like there may be an issue when underwater... If you need to try it, just do a doFx(%gui), this will use the default shader which does nothing except rendering a 2D texture.
Important: Another aspect, you have to be careful with the alpha layer inside your shader when doing fx effect on GUI elements on top of others.
#3
08/12/2008 (1:12 am)
Ok, I played with it some more. Everything that is reflective, like the Blob Shader, goes pink when a shader is activate. I think it is probably something in my code.
#4
08/12/2008 (1:38 am)
Got it. The only parts of the water that are effect are the parts that are very clear. My waterblock is almost completely clear, since its a shallow river and not an ocean.
#5
new ShaderData( BlurFx )
{
DXVertexShaderFile = "shaders/canvasfx/BlurFx.hlsl";
DXPixelShaderFile = "shaders/canvasfx/BlurFx.hlsl";
pixVersion = 2.0;
};
$BlurFxVars[0] = "0.30 0.59 0.11 0";
$BlurFxVars[1] = "0.4 0 0 0";
$BlurFxVars[2] = "0 0 0 0";
$BlurFxVars[3] = "0 0 0 0";
function doFxBlur(%gui)
{
%gui.setFxVars($BlurFxVars[0] SPC $BlurFxVars[1] SPC $BlurFxVars[2] SPC $BlurFxVars[3]);
%gui.setFx(BlurFx);
%gui.startFx();
}
something like that, but im not too good in shaders, can help me with that?
08/12/2008 (11:13 am)
thats great Frank :D, now i want to put that with a blur, im new in torque, how about a function like, new ShaderData( BlurFx )
{
DXVertexShaderFile = "shaders/canvasfx/BlurFx.hlsl";
DXPixelShaderFile = "shaders/canvasfx/BlurFx.hlsl";
pixVersion = 2.0;
};
$BlurFxVars[0] = "0.30 0.59 0.11 0";
$BlurFxVars[1] = "0.4 0 0 0";
$BlurFxVars[2] = "0 0 0 0";
$BlurFxVars[3] = "0 0 0 0";
function doFxBlur(%gui)
{
%gui.setFxVars($BlurFxVars[0] SPC $BlurFxVars[1] SPC $BlurFxVars[2] SPC $BlurFxVars[3]);
%gui.setFx(BlurFx);
%gui.startFx();
}
something like that, but im not too good in shaders, can help me with that?
#6
DXVertexShaderFile = "shaders/canvasfx/BlurFxV.hlsl";
DXPixelShaderFile = "shaders/canvasfx/BlurFxP.hlsl";
pixVersion = 2.0;
08/12/2008 (11:16 am)
oops in the shader data is DXVertexShaderFile = "shaders/canvasfx/BlurFxV.hlsl";
DXPixelShaderFile = "shaders/canvasfx/BlurFxP.hlsl";
pixVersion = 2.0;
#7
08/12/2008 (4:13 pm)
@Itla: like you propose should work. For information. it is possible to change FxVars during runtime if you want to do some special effect (call to setFxVars can be done even after starting the Fx).
#8
08/12/2008 (4:46 pm)
Oh thats great!, thanks Frank
#9
08/13/2008 (6:27 am)
Slick
#10
08/13/2008 (6:50 am)
Its cool...
#11
It all compiled with no errors.
But, when I try to do
doFxNightVision(PlayGui);
(or an other effect)
It doesn't display any effect and logs an error message on the console, stating that PlayGui doesn't have a function called setFxVars().
This probably is a very stupid question, but I have no idea at all :)
Anyone can help?
Thanks,
Rui
08/20/2008 (9:46 am)
Hello.It all compiled with no errors.
But, when I try to do
doFxNightVision(PlayGui);
(or an other effect)
It doesn't display any effect and logs an error message on the console, stating that PlayGui doesn't have a function called setFxVars().
This probably is a very stupid question, but I have no idea at all :)
Anyone can help?
Thanks,
Rui
#12
As an aside:
Any suggestions on what to do if you'd want to use a shader such as the wave shader and not have the outer (pink) areas show? I've never really touched shaders a whole lot before so I thought it better to ask before diving in to a "wrong" implementation.
08/20/2008 (7:46 pm)
Superb, works a treat!As an aside:
Any suggestions on what to do if you'd want to use a shader such as the wave shader and not have the outer (pink) areas show? I've never really touched shaders a whole lot before so I thought it better to ask before diving in to a "wrong" implementation.
#13
Also, has anyone looked into the pink water/blob shader thing. Water with 0 clarity works fine, but as the clarity goes up the water becomes more pink. Tested in stock TGEA 1.7.1 as well.
08/20/2008 (11:03 pm)
I *think* its pink because the playGui has been moved by the shader and it reveals the pink background that is behind everything. I think you could make another GUI that is opened up behind the playGui, if your looking for something non-pink. Only other think I can think of is to extend the playGui past the screen dimensions: screen is 1024X768, playgui dimensions are 1100X800. I'm not sure if that would even work though.Also, has anyone looked into the pink water/blob shader thing. Water with 0 clarity works fine, but as the clarity goes up the water becomes more pink. Tested in stock TGEA 1.7.1 as well.
#14
Maybe the shader is cutting the green component?
BTW: anyone can give me an example of how to use it?
As I posted above, I get a "command not found setFxVars on PlayGui", when I use it like this:
doFxCommand(PlayGui);
Is there any initialization I have to do before using it?
Help, please ? :)
08/21/2008 (5:58 am)
Maybe this is a hint: pink is 0xff00ff, red and blue at maximum and green at 0.Maybe the shader is cutting the green component?
BTW: anyone can give me an example of how to use it?
As I posted above, I get a "command not found setFxVars on PlayGui", when I use it like this:
doFxCommand(PlayGui);
Is there any initialization I have to do before using it?
Help, please ? :)
#15
additional...
Extending a GUI control beyond the extents of its parent will still give the same issue I *think* - try it on an image the same size as your canvas and you'll see the same issue
08/21/2008 (6:58 am)
No offense but thats stating the bleeding obvious :) The pink is a lack of data etc. Obviously there'll be no data outside the normal Playgui area. I'm going to play with this a bit until I find a nice solution.additional...
Extending a GUI control beyond the extents of its parent will still give the same issue I *think* - try it on an image the same size as your canvas and you'll see the same issue
#16
08/21/2008 (8:41 am)
and one question that pink area or gui , the color can be changed?
#17
It compiled beautifuly with no errors.
But when I do doFxNightVision(PlayGui) or even doFxSepia(Canvas), etc..., it tells me that the PlayGui (or Canvas, etc...) does not have a command called setFxVars.
Can you give me one example of how to use it?
Sorry for bothering you guys, but I really am lost.
Thanks,
Rui
08/21/2008 (12:17 pm)
@Frank - can you help me using this?It compiled beautifuly with no errors.
But when I do doFxNightVision(PlayGui) or even doFxSepia(Canvas), etc..., it tells me that the PlayGui (or Canvas, etc...) does not have a command called setFxVars.
Can you give me one example of how to use it?
Sorry for bothering you guys, but I really am lost.
Thanks,
Rui
#18
Have a gander there first just to make sure you have everything correctly in your project.
08/21/2008 (12:24 pm)
SetFXVars is a console method (linked to a c++ method of the same name) found in GUIControl.cpp ~2116Have a gander there first just to make sure you have everything correctly in your project.
#19
08/21/2008 (4:47 pm)
@Rui: as said by Craig this method is inside the GuiControl.cpp file. Be sure during your merge you include all functions under TWAR comments. Another things, be sure to make a clean build, sometimes the build does not work properly. I do not see otherwise why it may not work.
#20
Thanks for your help.
Cheers,
Rui
08/22/2008 (2:29 pm)
I am going to reinstall TGEA 1.7.1 and am going to try it again.Thanks for your help.
Cheers,
Rui

Torque Owner Taylor Petrick