Jump to content
  • Advertisement
Sign in to follow this  
giugio

shader dx 10 light and textures

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

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
Advertisement
in particular:in directx 9 there is the D3DMATERIAL9 class , in directx 10 what i use?
Thanks.

Share this post


Link to post
Share on other sites
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!