Jump to content
  • Advertisement
Sign in to follow this  
Pulsar79

Shadows with more effects with a mesh

This topic is 3564 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

Good evenings boys. I have a doubt with shadows. I want to implement several types of shadows in the engine 3D that I am doing, but the doubt is: if I for example have an object (for example a teapot) to which, I am applying a metallic effect with a shader ..., this implies that then at the moment of shadows apply type shadow mapping to this object I am not going to be able to use for shadows because already I am applying a shader to it. Or if that can? If it can do to it, I would like that you were putting the code of how doing it or some example or link where this is done. Thank you very much to all.

Share this post


Link to post
Share on other sites
Advertisement
I'm no expert and there are probably many way of adding shadows, like post processing and all. What I do is instead of having a metallic shader AND a shadow shader, you just add the shadowing IN your metallic shader. You get the final color from the metallic shader and at the end you darken it up with the result of your PCF or VSM filter which use the pre-renderer shadow map to determine. You can simply add a function for the shadow and add a line who call it at the end of every shader you use. Something like

output.color = output.color * ShadowContribution(...);

Share this post


Link to post
Share on other sites
Thanks! But how can I apply shadows with post-processing? It is better, no? This is a lot of work add code for shadows to all the shaders that I have. I would like any example of shadows with post-processing.

Share this post


Link to post
Share on other sites
Well, there is an example on gamedev.net that uses shadowmapping and a post-process gaussian blur to create soft shadows with little effort.

Here's the link:
http://www.gamedev.net/reference/articles/article2193.asp

I've implemented it myself, but it really dropped the FPS (but one cannot conclude this method is too slow, just my implementation and/or my computer:D ).

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!