Skip to main content
gamedev.net
🔒 Locked

Post process help

Started by ZackHeckman Mar 19, 2011 at 4:18 AM 1 replies 1.3k views
Original Post
ZackHeckman
ZackHeckman
Hey I'm pretty new to direct x shaders and am trying to grab a better handle on them. I understand plenty of things about them but there are some parts that I just don't know how to do. Conceptually I feel like I understand all the effects I'm looking to do but I don't know what I'm supposed to do in actual code. What I mean is I don't really know how to go about getting the previously rendered frame to do effects with and merge with my current. The easiest one I saw was to just get the previous 4 frames (or however many) and meld them at a small rate with the current to get a cheap motion blur going. From there I feel like I can go on and on and on with all sorts of cool stuff but I don't know how to get there. I know I'm going to get a 'try the search bar' but nothing I could find really helped, they were just the shaders and not how to get the actual frame itself. I'd really appreciate any and all help anyone can give me. I was also wondering how the pixel kernel worked, i always see that in blur shaders but I don't really understand 100%? Is that supposed to be like a reference to the current pixel and a range in one direction around it? Like if it ranged from -6 -> 6 I'd be modifying 6 pixels left and 6 pixels right ( assuming a horizontal pass )?
freeworld
freeworld
I could be wrong but the pixel kernel is basically a weight... or say you have 5 values and they all have different weights but together they need to add up to 100%. ie

p1 = 35%
p2 = 25%
p3 = 20%
p4 = 15%
p5 = 5%

p1 would be the center pixel, but as you blur that pixel away from itself it has less of an impact (lower alpha). In the end there is still 100% of that pixel still there though.

For post processing look into "rendering to a texture". Basically you render what parts of the scene you want to post process to a separate texture, instead of the backbuffer. You then render that texture to the back buffer using your post process shaders.

you can checkout the two-kings site too.. render-to-texture
ZackHeckman
ZackHeckman
That's really helpful, thanks a ton!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.