Sign in to follow this  

HLSL - Multiple effects on GPU

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

Having already asked 2 HLSL questions no one can anwer, I am going for three. I have already bumped into the 64 instruction slot max for PS_2_0. So, I now have different functions defined for Blinn versus Phong shading. It does the calculation for up to 4 directional lights. I want to add bump mapping and the ability to have different kind of lights, like a spot light, that has even more calculations to perform. I am realizing that there ain't no way I am going to be able to do all of this in the pixel shader. Every sample I have ever seen just uses one light. So I am wondering how game developers deal with situations where they want to have multiple lights, use a pixel shader technique (like Phong), and do bump mapping, where you would need to apply the TNB matrix to each light vector and pass it along to the pixel shader. Do they end up falling back to vertex lighting when they want mulitple effects? It seems that until PS_3_0 the VS has plenty of room for stuff, but the PS is too limited for anything substantial. TIA.

Share this post


Link to post
Share on other sites
For a large number of reasons (shadowing algorithms probably being the most important among them), most games do not run more than one light per pass.

Share this post


Link to post
Share on other sites

This topic is 4198 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this