PDA

View Full Version : Post Process Questions



Gundy
06-21-2010, 04:13 PM
Hello, I'm part of a team that recently switched over to UDK and am having some issues with creating a post process effect via a material effect. It's just a basic outline rendering effect, but I'm getting stuck on some tweaking features. When fog or light beams or other goodies are turned on, I can't figure out how to blend my line color to the other effects.

http://i47.tinypic.com/t5fv38.jpg
As you can see, in this image the lines are being drawn over top of the sun's light beams.

http://i46.tinypic.com/ne8480.jpg
In this image, I have changed the Scene DPG to world to try and draw before the sun stuff but it just gets rid of it entirely.

I guess my questions are as follows:
1. Is there any way to access a fog buffer or post process render target from the material creating screens?
2. I've tried to setup my own unreal script extending PostProcessEffect. How do I link that to a shader .usf file?
3. Does anyone have any other ideas/methods that I can try?

Thanks for any input.
(PS. These screenshots are from inside the UDK editor and not in game, but it looks and acts the same in both.

peam
06-22-2010, 01:22 AM
You can access color and depth buffer using SceneDepth and SceneTexture (a material node). That should be the easiest way, i guess.

Gundy
06-22-2010, 05:57 PM
I used the depth buffer to get the info to draw the lines and the scene texture was being multiplied to the outline result.

Last night as I was drifting to sleep I came up with a solution, all day at work it bugged and bugged me till I finally got home to try it. This is the result:)

http://i45.tinypic.com/2zovus6.jpg

I achieved the result I was going for by realizing that the built in effects, such as ambient occlusion, were already being preformed in the way I needed. So I created my own post process effect node based off of MaterialEffect to get all the material effect goodness, and through script was able to set a variable that is not available to the user in the editor. My code is simple and is as follows to anyone else who wishes to use it.

class Outline extends MaterialEffect;

defaultproperties
{
bAffectsLightingOnly=TRUE
}

As far as i can tell, the bAffectsLightingOnly boolean allows the post process effect to be drawn immediately after lighting is rendered but before other things like light beams, particle effects and water/fog. One last thing to note, is that this only works when the scene DPG value is set to SDPG_World, or nothing will render.

axelzellalex
06-22-2010, 08:20 PM
this looks sweet as hell
i was trying to get post process effect like this working in one of the old builds, but just couldnt get it working?
dont suppose you would mind sharing how you got yours to work so well?

alvarofer0020
06-22-2010, 09:57 PM
it is just a outline post process or a Cell shading post process?

Gundy
06-22-2010, 10:41 PM
It's just the an outline with no cel shading or other color altering techniques(yet). It's just a simple neighbouring depth pixel algorithm, you can google and find lots of them, some for UDK and some for other engines.

KazeoHin
06-23-2010, 06:35 AM
You, my good sir, have made this artist VERY happy.