Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stickben

Illuminating an object?

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

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.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • 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!