Sign in to follow this  
enigmatix

Shaders and What They Do

Recommended Posts

So I've been working with MDX9 for the past 2 months now and I've gotten a pretty good feel for it. I think I'm ready to move onto Shaders, but before I do, I wanted to clear up a few things that were not covered or expanded on in the tutorials and articles that I've read. With that said, I'm working on an engine thats object oriented. I basically have a class for a light, camera, sphere, cube, etc... I know how the Shader fits into the pipeline, but I'm not quite sure how it handles things. For example, the shader handles texturing and lighting, but how does that fit into setting up lights or texturing with stages. I mean, right now i would use something like this to setup my light:
[SOURCE]

DXdevice.Lights[0].Type = LightType.Point;
DXdevice.Lights[0].Position = new Vector3(4, 4, -2);

[/SOURCE]
Or this to set my texture...
[SOURCE]

DXdevice.SetTexture(0, mytext);

[/SOURCE]
If i start using Shaders, does this all become redundant?

Share this post


Link to post
Share on other sites
The entire light setting structure is completely ignored if you use the programmable pipeline.

As for texturing, calling Device::SetTexture still has an effect, but in general, you'd want to avoid using the device function, and would instead use Effect::SetTexture.

So, in short, if you use Effects correctly, you shouldn't be calling either of these two.

Hope this helps.

Share this post


Link to post
Share on other sites
when you move to using your own shaders, you'll be responsible for all of the transformation and lighting yourself, and passing in lights as constants. this gives you a lot of flexibility in shading, and you'll get a good understanding of how the pipeline is working under you once you implement your own shaders.

directx lights suck anyway.

if you need basic shader help email me at programmer_tom@hotmail.com and i'll send you some simple startup stuff.

-programmer tom

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