Game Development Community

Depth Of Field

by Westy · in Torque Game Engine Advanced · 09/15/2004 (1:39 pm) · 35 replies

Im looking at integrating a Depth Of Field shader to TSE. This woul dbe basically rendering a full screen quad and doing post processing. Any tips before i get too dirty?
Page«First 1 2 Next»
#21
02/28/2007 (4:01 pm)
Hmm..very odd issue. It might have been something I recently changed. About the water, if one of the shaders is toggled (I think the second) then the water won't render. You can easily disable this in gameTSCtrl.
#22
02/28/2007 (4:11 pm)
Oh, what do I need to change in gameTSCtrl to fix the water issue?

Does this need to be included at the top of each V Shader?

#define IN_HLSL
#include "shdrConsts.h"

I've tested with and without and I get the same result.
#23
02/28/2007 (8:08 pm)
Ok well Ive modifed the FullScreen Shader Code to enable 4 generic named shaders defined in my shader.cs

Shader1, Shader2, Shader3, Shader4

Files available below...

addikt
#24
03/01/2007 (2:20 am)
Looks like your mask is broken I think.

It does not take WaterObjectType into equation.
This would make it ignore water, which might or might not be desired depending on the effect.

If that masks need to be out you have to make sure that shader2 - 4 are rendered before water.

check out renderInstance/renderInstMgr.h enum RenderBinTypes for the order in which they are rendered.
If you want water to be rendered you have to make sure your shader type is further up in the list than water. (Example: To make foliage be seeable through water, you would move the foliage type up before water in the enum)

EDITED to correct some stuff.
#25
03/01/2007 (3:53 am)
Thanks for the reply Marc, I gave that a shot and it unfortunately didnt solve the problem.

addikt
#26
03/01/2007 (6:47 am)
Comment out your masks and replace the renderWorldEffect functions using it with "NULL" as seen in the example below:

//U32 mask = StaticObjectType | VehicleObjectType | InteriorObjectType | PlayerObjectType | EnvironmentObjectType | TerrainObjectType;
renderWorldEffect(updateRect,mNightEffectShader, NULL, GFXFillSolid);
#27
03/01/2007 (1:16 pm)
Your a legend Matt, works perfectly thank you sir!

addikt
#28
03/03/2007 (9:16 pm)
Addiktive, can you repost the files? It looks like the Box.net storage expired. Thanks...
#29
03/04/2007 (12:01 am)
Here you go: www.box.net/public/static/o0ezlz9ruj.7z

You just need to do the other changes as per the Full Screen Shaders Thread regarding defining the four shaders and a key to cycle through them.

The Shaders are named in the engine code:
Shader1
Shader2
Shader3
Shader4

addikt
#30
03/06/2007 (5:40 pm)
Anyone per-chance made a suitable depth of field shader? We have tried unsuccessfully to convert .fx shaders to .hlsl...

Another one I was interested in testing was motion blur...

Cheers,

addikt
#31
09/11/2007 (11:38 am)
Have you looked at these there are ones for motion blur and DOF. The DOF one look like it woul dnot be to har to implement

ati.amd.com/developer/shaderx/
#32
09/11/2007 (5:50 pm)
There are several depth of field articles in the ShaderX books. You're right, in most cases they're pretty easy to implement. However, there are no examples of how to set up multiple render targets (especially for fullscreen effects). If there were some TDN docs on it, someone could probably throw together a nice Depth of Field example pretty easily.
#33
09/28/2007 (3:19 am)
Hey guys,
am still wondering how to do motion blur in TGEA, so far i got the static blur mentioned above but nthing actually as motion blur or smthing!

well yes, i tried out this resource
[url]http://www.garagegames.comindex.php?sec=mg&mod=resource&page=view&qid=5686 [/url]
which achieved motion blur ...but in TGE 1.5 which is OGL based ...well so i moved ahead n tried changing OGL code into D3D complaint code.. but am sure smthing's missing :(

so, the story is i got full screen shaders wrking ( static blur, heatvision n nightvision ) but am looking for motion blur.

thanks in advance :)
#34
09/28/2007 (3:21 am)
Forgot to mention i have also tried this n its wrking too

http://www.garagegames.com/mg/forums/result.thread.php?qt=67131
#35
09/28/2007 (4:04 am)
For motion blur, the simplest solution might be storing multiple renderbuffers of the past and use a blending shader to combine them. Don't know how hard this would be, have never done it with Shader, just back in DX7 and render to texture.
Page«First 1 2 Next»