Jump to content
  • Advertisement
Sign in to follow this  
kuroioranda

Best way to pass lights to a shader?

This topic is 3005 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 want to have multiple dynamic lights (i.e., position changing every frame) in my scene that I will iterate over with a loop in my fragment shader, but I'm unsure of the best way to get this information to the card. Is it better from a performance point of view to put the light data into uniforms, or packed into a texture, or does it not really matter one way or the other? My engine isn't deferred or anything, it's just a plain vanilla forward renderer.

Share this post


Link to post
Share on other sites
Advertisement
when using >3.0 binding a buffer to a texture would be the best way
also possible with the gpu 4 extention

Share this post


Link to post
Share on other sites
Quote:
Original post by Danny02
when using >3.0 binding a buffer to a texture would be the best way
also possible with the gpu 4 extention


Ah, I should have specified I'm targeting SM3.0 as the minimum required spec.

Also, what is the gpu 4 extension?

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!