Illuminating an object?

Started by
5 comments, last by stickben 21 years, 2 months ago
I have one object that emits light, but the object itself appears black because there is no other lights near it. Is there any way to just make this one object illuminated? Im using DX8.1. This object is a CD3DMesh object.
Advertisement
im not sure on this at all
i think i read before you need to set the specular color of the material more than 1.0f
If the material being used for the mesh has its emissivie channels all equal to 1, I would expect it would be fully illuminated regardless of whether there were any other lights nearby. You''ve definitely got lighting enabled?
-david
Make sure D3DRS_LIGHTING = TRUE. If the emissive color is set in the material, make sure D3DRS_AMBIENTMATERIALSOURCE = D3DMCS_MATERIAL. If it''s in the vertices, make sure D3DRS_AMBIENTMATERIALSOURCE = D3DMCS_COLOR[1|2] and D3DRS_COLORVERTEX = TRUE.
Donavon KeithleyNo, Inky Death Vole!
maybe try to enable specular color too??
Wait, it occurs to me... you say that it emits light, but does that mean you''re using emissive lighting (which is what I assumed) or that you''re not sure how to make it illuminated? Maybe you have a point light source positioned inside of the mesh and it''s not being affected by the light.

If it''s the second, you can use the emissive color in the material settings to set a uniform color. Or you can set a per-vertex emissive color. Just follow the instructions I gave and make sure you''re defining a color in the material or the vertices, depending on what you want.
Donavon KeithleyNo, Inky Death Vole!
Ah, I was a little vague, I ment that I had an object that had a point light inside the object. The light was not illuminating the surface because it was inside. I found out that the when the material for the mesh was being set up, only the diffuse values were being set. I set up the ambient,emissive and specular values and it worked.

Thanks!
Ben

This topic is closed to new replies.

Advertisement