Additive texturemode?

  • Thread starter Thread starter sfx1999
  • Start date Start date
Status
Not open for further replies.
S

sfx1999

Guest
I was wondering how an effect was achived in Half-life. What happens is you set a texture to additive and it lights up the stuff behind it (it is useful for lightbeams coming off lights and rotating ones). Does anyone know how this would be done in OpenGL?
 
icon_question.gif


add.jpg
 
I wasn't sure what he was asking either, however that was my guess as well.

sfx1999 goto
NeHe Productions.
They have some great stuff there and the texture blending tutorial they have is probably one of the best.

Cyb
 
So it is supposed to make it look washed out. I see now. That's what I needed to know.
 
So it is supposed to make it look washed out. I see now. That's what I needed to know.
When you add a texture to another texture like that, and you exceed the maximum pixel threshold
IE
Code: [Select]
Code:
RGBA 0x78, 0x90, 0x78, 0x00 + 0x70, 0x80, 0x70, 0x00 = 0xE8, 0xFF, 0xE8, 0x00
It should tend toward 'clamping' the upper values.  This can give it a washed out look unfortunately.  If you wish to have a better method then you should use OGL's lighting model.  You need the normals for each corner of the polygon then compute the brightness for each corner.  Commonly guruad shading is used across the polygon to give the right look.

Of note NONE of the FF series 3d engines use light shading!  If they did the models would look too dark very likely.

What are you trying to do? We might be able to help you get there with less pain! (maybe)

Cyb - Good fortune with your experiments!
 
Ahhh.. hmmm.  You'll need to blend the texture at interesting angles then.  The fun part comes if you have a repeating texture or the light map texture exceeds the perimeter of the polygon.  If that happens you will need to examine each polygon and comput the cliping then blend the texture for those polygons as well.  The fun part might be a ceiling which requires a different light map texture pattern to blend. Woo hoo.

Here is a better looking example and more realistic as well.
LightRoom.jpg

Notice the light maping on the floor and wall match the correct light pattern.  Granted it was a cheesy thing to whip together but that is more realistic than  the half life example.  I believe they might be just taking the 3d image and blending the light map into that image, giving you that well result. It's 'OK' looking at least.

Cyb
 
They use Kislinskiy's way because OpenGL has direct support for it. That lightmap method requires a bit of computation.
 
Status
Not open for further replies.
Back
Top