DirectX Material/Texture/Lighting question

Started by
4 comments, last by Prof72 13 years, 9 months ago
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.
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.
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.
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?
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.

Ok thanks for the replies :)

This topic is closed to new replies.

Advertisement