Jump to content
  • Advertisement
Sign in to follow this  
repka3

Attempt the first post-processing

This topic is 3083 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, after readed somethings, i noticed that for achieve the toon inking (paint the edge of model in black) i can't use multipass shader but i need post processing with something like Sobel filter. But differently from sample in SDK, i want apply this effect only to level object (environment objects like doors, house and so). So i ask you if what i understood is right or wrong. I think my workflow will be: 1)Render to Texture only these objects. (white background) 1)Process this texture with pixel shader for sobel filtering, clip(-1.0f) all non-edges pixel. Ok now i have a texture with same height and width as viewport and black edges on all objects. The thing i can't understand is the next step :) How can i combine this texture with my backbuffer before present call ? Anyway this is just what i figured out with deductive reasoning , but i can be totally wrong and someone can explain me at least the workflow steps. Thx for your time.

Share this post


Link to post
Share on other sites
Advertisement
You draw a screen-aligned, screen-sized quad with the texture, you've just rendered to. Maybe with some-kind of blending.

Share this post


Link to post
Share on other sites
Like szecs said, you could just blend the edge texture with the backbuffer (with a multiply mode)


Or if you need something more flexible, you could also render your scene into a texture, not directly into the backbuffer. Then create a new shader, sample the scene and edges texture, combine the scene color with the edges color and render the result into the backbuffer.

Share this post


Link to post
Share on other sites
Here the result :D
pp

I used sober filter with 3x3 kernel. I need to tweak a lot for achieve a decent effect and maybe i need to switch to deep/normal edge detection but for my first post processing attempt the results i think are quite good (especially consider understanding the work flow and writing a post process manager and render to texture manager).

Anyway thx for hints szecs and c3Dp:)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!