Sign in to follow this  

shader dx 10 light and textures

Recommended Posts

giugio    246
Hy. I have a mesh that have a part with texture and a part with color , how i implement a shader that if there is a texture on the geometry(UV) draw the color of the texture and if i not have texture draw a good light algorithm for rappresent the light ? There is a sample? thanks.

Share this post

Link to post
Share on other sites
brekehan    101
You use effect variables.

You right shaders that take any effect variable you like. You define you own material properties that way. You then communicate between the effect and the application, setting the effect varibales to the desired values before applying a pass.

Read the effect section of the MSDN docs for more info.

You can also read my post as I struggle with lighting myself.

I'd start without any lighting at all though, just look up the color from a texture. Then try one light with lambert shading. Then try Phong, Then try multiple lights.

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