Blending a lightmap in OpenGL
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
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.
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.
www.flashbang.se | www.thegeekstate.com | nehe.gamedev.net | glAux fix for lesson 6 | [twitter]thegeekstate[/twitter]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement