Jump to content
  • Advertisement
Sign in to follow this  

Light volume and shadows ideas

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

I have an idea on the deferred renderer:
I think to create in the first pass a light volume in the depth buffer on the shape of the type of the light, a cone if is a spot light , a box if is a directional light and a sphere if it is a point light.
Each point of this light volume have a value of 00000001(light 1) or 00000011(light 1 and 2)
Each light is relationed with a light scene manager in the cpp project and have an id
01)->light1 spot position : 0,0,0
11)->light2 point light position : 12,12,0

each cicle i send to the shader constant buffer all the light table information for id.

When i do the deferred renderer in the pixel shader i take the pixel from depth buffer if is illuminated by at least one light (else i do nothing and save time), i take id from the stencil buffer and depth buffer , when i have the id of the light i get the information from the constant buffer (always in the shader )for the corrispondent id of the light and calculate the light for the pixel and so one.

I think that i can do shadow volume because only if the depth buffer pixel value for a pixel that is illuminated and have a depth value > of the depth but not infinite i can see if is a siluette and calc it ,and culling a lot of pixels.

It's only an idea , but i'm a newbee and i can't implement it in little time , for this i ask if can be a good solution.
If is a good solution anybody can implement it.

I think is good also because if i change a light parameters like light position or intensity or color in the c++ logic code all is reflected automatically to the scene and animate the light can be easy.

sorry for my english.

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!