Jump to content
  • Advertisement
Sign in to follow this  
Prof72

DirectX Material/Texture/Lighting question

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

Hi all,
I am just starting to learn DirectX and have various books on the subject.

But one thing I can't get my head round is why do you have to set a material for a primitive that has a texture?

To me it doesn't make sense, surely the colour(s) of the texture and what it might represent (wall,door etc) define what colour each pixel of the primitive should be? A material as I understand it has to be set for the entire primitive, but the texture could have a varying colour/theme across it's pixels.

Many Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Basically the material defines how light will act on the surface. Light will have a different effect on a metal surface than on a wood surface. The texture gives the surface it's basic color then the lighting is applied based on the material.

Share this post


Link to post
Share on other sites
If you're not using lighting, and you're just doing basic texturing you don't need a material. This may be of interest, and shows a textured cube, with each face additionally coloured based on the vertex colour.

Share this post


Link to post
Share on other sites
Quote:
Original post by X Abstract X
Basically the material defines how light will act on the surface. Light will have a different effect on a metal surface than on a wood surface. The texture gives the surface it's basic color then the lighting is applied based on the material.


So essentially if I needed a quad with a half metal and half wood texture (for example), I should really define two quads each with a seperate half of the texture and seperate material? Otherwise a single material couldn't describe it properly?

Share this post


Link to post
Share on other sites
Quote:
Original post by Prof72
Quote:
Original post by X Abstract X
Basically the material defines how light will act on the surface. Light will have a different effect on a metal surface than on a wood surface. The texture gives the surface it's basic color then the lighting is applied based on the material.


So essentially if I needed a quad with a half metal and half wood texture (for example), I should really define two quads each with a seperate half of the texture and seperate material? Otherwise a single material couldn't describe it properly?


Yep.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!