Sign in to follow this  
howie_007

using HLSL shader code to simulate fixed function lighting with other effects

Recommended Posts

My question is, if you need the simulated fixed function lighting along with other effects, would you add these effects to the same fx file and code it so that it executes before or after the lighting or would you keep your other effects in a separate fx file and run both effects at the same time? Don't know if you can run two different effects on the same geometry.

Share this post


Link to post
Share on other sites
You can only have one vertex/pixel/geometry shader bound to the device at any one time. If you need to combine the effects of two shaders, you need to either manually combine the code from the two shaders or somehow do it in multiple passes (the latter approach isn't always feasible, it depends on what you're doing).

If you want to be more specific about what you're trying to accomplish, I can give you some more advice.

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
You can only have one vertex/pixel/geometry shader bound to the device at any one time.
That's the answer I was looking for. I'm new to the shader scene and I had a feeling that might be the case but needed conformation. Thanks!

I assume geometry shader is a new thing. Don't see much chatter on the subject.

Share this post


Link to post
Share on other sites
Quote:
Original post by howie_007
I assume geometry shader is a new thing. Don't see much chatter on the subject.


Geometry shaders were new for D3D10, and a lot of people are still working on the D3D9 level for various reasons. D3D11 actually added 3 more shader types!

Share this post


Link to post
Share on other sites

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