Sign in to follow this  
sanosuke001

Textures and Lighting

Recommended Posts

Hello, I created a TriangleStrip terrain and am trying to apply a texture to it. Before, I was using a CustomVertex.PositionNormalColored and it was fine. I then changed it to CustomVertex.PositionNormalTextured and with lights off I can see the texture fine but turning lights back on, the lights that worked fine with the Colored terrain, now displays as straight black. Is there anything else that needs to be done other than setting the texture to the device?

Share this post


Link to post
Share on other sites
You need to set a material to tell directx how to reflect the light off of the surface. I've not totally mastered how setting a material works but I've successfully made one by setting Ambient/Diffuse/Specular and Emissive Coloring values along with an Intensity Power level.

Hopefully someone else can offer more knowledgeable advice on setting up materials especially in light of a terrain system which obviously will not have pink or orange material (laughs).

edit: Although I just tried this on my latest demo project and the only section that successfully utilises the light are the mesh demo objects. Whether or not I add Normals to my PosTex objects they ignore the lighting but then I am also using effect files which I am currently having problems working with lighting with so could be the cause in my case.

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