Jump to content
  • Advertisement

Archived

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

B00Zagl0

problem with lights/blending

This topic is 5528 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, I notice a weird stuff in a project i did latly. today i tried to blend an object on a screen. i did it right , and it seems blended. the problem is that my object is a square and two of is faces are some how blend but the background is invisible. mostly the same happend to me with a light. i used light and diffuse and ambient , when i rotate my object (not my camera) some faces are lighted and when rotating it 180deg the faces are totaly black. it seems like i am doing somthing wrong but I have no clue what. someone can help me please ? B00Zagl0

Share this post


Link to post
Share on other sites
Advertisement
If I understood right... You want light on both sides of the polygon?

You have to call glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);

Hope this helps!

Share this post


Link to post
Share on other sites
do not use two sided lighting. draw the back faces, and use backface culling to prevent z fighting. It''s significantly more efficient.

"the problem is that my object is a square and two of is faces are some how blend but the background is invisible."

are you saying that things behind the square don''t show though?
if this is the case, render blended objects last, and make sure you disable depth writing with glDepthMask(0), glDepthMask(1) to enable again.

| - Project-X - my mega project.. close... - | - adDeath - | - email me - |

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!