🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Blending a lightmap in OpenGL

Started by
1 comment, last by wtrsltnk 15 years, 5 months ago
Hi everybody! First of all, NeHe and crew, thank you for your great tutorials!!! Although i have learned a lot from your tutorials I now have a situation i cannot find the right solution for:( It's about rendering a Half-Life bsp file. I have most of the rendering working and it works great! I got it working with the code from botman by my side, it taught me a lot! But there is a small uglyness in the code from botman and I can't get it fixed either. It's this: In the Half-Life bsp file there is a lighmap texture for every face in de file. Rendering such a lightmap is easy, first you render a face with it's regular texture without using blending, and after that you re-render the face with it's lightmap and use the following blen function: glBlendFunc(GL_ZERO, GL_SRC_COLOR); For every texture that doesn't use color transparency this works, but when I render a face which has some transparent parts the shading of the lightmap also covers the transparent parts. Its really ugly! you can find an image with an example here: http://www.saaltink.net/img/blendproblem.jpg My question now is: is there a blend function to fix this? greetings from Holland Wouter Saaltink
Advertisement
No there are no direct blending modes like that, you could try multitexturing.
But you should really be using shaders, if your not then they are pretty easy to add.
http://www.flashbang.se/index.php?id=20

using shader it's easy to add shadows only to the color part, also it allows you to enhance the look of it later on pretty dramatically.
Hmm, ofcourse, didn't think of that, but must say that I haven't used shaders yet.

Thanks for the your answer and the website! I am on it!

Wouter Saaltink

This topic is closed to new replies.

Advertisement