Re: [hlcoders] Blending and fog

2009-02-28 Thread Tobias Kammersgaard
Go away, I don't want to read about OpenGL. Later dudes. /ScarT 2009/2/28 Julian Moschüring > Ouh, you render a light map and than the textures with dynamic lights? > Multiplying the light map with the dynamic light geometry will not add > the light as intended. > > An easy solution would be:

Re: [hlcoders] Blending and fog

2009-02-28 Thread Julian Moschüring
Ouh, you render a light map and than the textures with dynamic lights? Multiplying the light map with the dynamic light geometry will not add the light as intended. An easy solution would be: glBlendEquation( GL_FUNC_ADD ); glDisable( GL_FOG ); DrawLightmaps( ); glBlendFunc( GL_ONE, GL_ONE );

Re: [hlcoders] Blending and fog

2009-02-28 Thread Andrew Lucas
Nah, it doesn't want to work. The unlit triangles not only become much darker, but the fog affects all of them incorrectly. I guess it's not that important anyway, I could just render the dynlights after everything else has been rendered, except that they won't be able to light up completely da

Re: [hlcoders] Blending and fog

2009-02-28 Thread Julian Moschüring
No, OpenGL, ot Tobias Kammersgaard schrieb: > Is this GoldSrc or am I just really hungover? > > /ScarT > > > 2009/2/28 Andrew Lucas > > >> I thought your wrote GL_FUNC_REPLACE by mistake, because >> >> I couldn't find any references of it at all, so I tried using all >> >> the others that they

Re: [hlcoders] Blending and fog

2009-02-28 Thread Tobias Kammersgaard
Is this GoldSrc or am I just really hungover? /ScarT 2009/2/28 Andrew Lucas > > I thought your wrote GL_FUNC_REPLACE by mistake, because > > I couldn't find any references of it at all, so I tried using all > > the others that they listed, but they all produced weird results. > > > > Also, usi

Re: [hlcoders] Blending and fog

2009-02-28 Thread Julian Moschüring
Oups, this should be correct. glDisable( GL_FOG ); DrawLightmaps( ); glEnable( GL_FOG ); glBlendEquation( GL_FUNC_ADD ); glBlendFunc( GL_DST_COLOR, GL_ZERO ); DrawUnlitGeometry( ); glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); -- This way the second pass will set the destination to d1 = d0

Re: [hlcoders] Blending and fog

2009-02-28 Thread Andrew Lucas
I thought your wrote GL_FUNC_REPLACE by mistake, because I couldn't find any references of it at all, so I tried using all the others that they listed, but they all produced weird results. Also, using GL_ZERO as the destination ruins the lighting quality on my brushes, wich I'd like to avo

Re: [hlcoders] Blending and fog

2009-02-28 Thread Julian Moschüring
Did you try what i said? Should work in your order too: glDisable( GL_FOG ); DrawLightmaps( ); glEnable( GL_FOG ); glBlendEquation( GL_FUNC_REPLACE ); glBlendFunc( GL_DST_COLOR, GL_ZERO ); DrawLitUntexturedHere( ); Andrew Lucas schrieb: > Ah, sorry. I thought hlcoders wasn't cut into different sec

Re: [hlcoders] Blending and fog

2009-02-28 Thread Andrew Lucas
Ah, sorry. I thought hlcoders wasn't cut into different sections like that. Anyway, what I'm doing is rendering only the lightmap in the first pass, then I render the texture and the detail texture in the final pass. Anyway, I tried messing with glBlendEquation but couldn't get anything goo

Re: [hlcoders] Blending and fog

2009-02-28 Thread Julian Moschüring
This clearly is the wrong list, hl2 modding only. However, it's not fully clear to me what your rendering passes are. You draw the fully lit geometry and then modulate it by a second pass using your lights and untextured geometry? Try the following: glDisable( GL_FOG ); DrawFullyLitPassHere( );

[hlcoders] Blending and fog

2009-02-28 Thread Andrew Lucas
Hello there. I'd like to ask with a problem I'm having related to fog and blending. I'm using a modified Paranoia renderer to render my world, and when I have dynamic lights in a level, I have to render the world in two passes for lighting to be correct. This causes an odd problem with