What are you working on?
Moderator: InsideQC Admins
Re: What are you working on?
qbism wrote:q2bsp vs q3bsp - q2bsp lighting is additive, q3 is a multiplier. The q3 method is faster but dynamic lighting fails in dark areas. Anything x 0 = 0.
That's not really a feature of the BSP format though. Additive dynamic lighting could be added to Q3 in engine code.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
We knew the words, we knew the score, we knew what we were fighting for
-

mh - Posts: 2292
- Joined: Sat Jan 12, 2008 1:38 am
Re: What are you working on?
qbism wrote:q2bsp vs q3bsp - q2bsp lighting is additive, q3 is a multiplier. The q3 method is faster but dynamic lighting fails in dark areas. Anything x 0 = 0.
Khm q2 use multiplying lightmaps blending (in gl)
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: What are you working on?
q1+q2: The light map is ADDED to the texture map to produce shading.
q3: The light map is MULTIPLIED with the texture map to produce shading.
So it takes a lighting tool change as well to flip from one type to the other?
q3: The light map is MULTIPLIED with the texture map to produce shading.
So it takes a lighting tool change as well to flip from one type to the other?
-
qbism - Posts: 1236
- Joined: Thu Nov 04, 2004 5:51 am
Re: What are you working on?
qbism wrote:q1+q2: The light map is ADDED to the texture map to produce shading.
that would make dark areas impossible.
q1+q2 support multiple lightstyles per surface. the multiple lightmaps per surface are added together and then the result of that is multiplied with the wall texture's colour (traditionally via the colourmap).
q3 doesn't support lightstyles, so it can skip the add part and go straight to multiplying. the result is the same.
there is a difference when it comes to dynamic lights, in that q3 does everything in the framebuffer instead of by editing the lightmaps, and thus they are typically additive (and untextured due to trying to not depend upon multitexture).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: What are you working on?
There are debug tools gl_saturatelighting (additive if 1) gl_monolightmap with values I, L (multiplication), A (alpha blending)
otherwise, multitextured or 2-pass, there is multiplicative blending of a lightmap into diffuse texture
if ( qglMTexCoord2fSGIS )
{
GL_EnableMultitexture( true );
GL_SelectTexture( GL_TEXTURE0_SGIS );
GL_TexEnv( GL_REPLACE );
GL_SelectTexture( GL_TEXTURE1_SGIS );
if ( gl_lightmap->value )
GL_TexEnv( GL_REPLACE );
else
GL_TexEnv( GL_MODULATE );
R_RecursiveWorldNode (r_worldmodel->nodes);
GL_EnableMultitexture( false );
}
else
{
R_RecursiveWorldNode (r_worldmodel->nodes);
}
otherwise, multitextured or 2-pass, there is multiplicative blending of a lightmap into diffuse texture
if ( qglMTexCoord2fSGIS )
{
GL_EnableMultitexture( true );
GL_SelectTexture( GL_TEXTURE0_SGIS );
GL_TexEnv( GL_REPLACE );
GL_SelectTexture( GL_TEXTURE1_SGIS );
if ( gl_lightmap->value )
GL_TexEnv( GL_REPLACE );
else
GL_TexEnv( GL_MODULATE );
R_RecursiveWorldNode (r_worldmodel->nodes);
GL_EnableMultitexture( false );
}
else
{
R_RecursiveWorldNode (r_worldmodel->nodes);
}
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: What are you working on?
Spike wrote:the multiple lightmaps per surface are added together and then the result of that is multiplied with the wall texture's colour
That's what I should have said.
Barnes, I didn't know about the additive debug mode. Anyway, nice decals. It looks like they wrap properly around the "outside corner" but do not align on "inside corner".
The qfmap complier from the qfusion project brings back q1/q2 additive lightstyles to engines that support that format.
-
qbism - Posts: 1236
- Joined: Thu Nov 04, 2004 5:51 am
Re: What are you working on?
qbism wrote:Spike wrote:the multiple lightmaps per surface are added together and then the result of that is multiplied with the wall texture's colour
That's what I should have said.![]()
Ah, yes, now we have no misunderstandings
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: What are you working on?
qbism wrote:Anyway, nice decals. It looks like they wrap properly around the "outside corner" but do not align on "inside corner".
Sometimes looks good, sometimes very good, but it is not good. Basically we have a good result
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: What are you working on?
qbism wrote: Anyway, nice decals. It looks like they wrap properly around the "outside corner" but do not align on "inside corner".
Remembers me of this Wolfire post. Seems much more involved though, and no example code
- Spiney
- Posts: 63
- Joined: Mon Feb 13, 2012 1:35 pm
Re: What are you working on?
is another technique (projected texture).
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Re: What are you working on?
That's pretty cool Barnes. Good decals always impress me.
As for me, I've managed to implement a "dithering" effect on the particles. However, it's not a filter and it doesn't use the kernel matrices — it's a completely different approach. Everything in it is precalculated, and due to the reduced number of writes to the buffers, the impact on the framerate should be negligible.
The code still needs a good amount of cleanup and optimizations, and the translucent particles version will be implemented after that.
Also, no screenshot yet because I'm with very limited Internet access. Whoohoo!
As for me, I've managed to implement a "dithering" effect on the particles. However, it's not a filter and it doesn't use the kernel matrices — it's a completely different approach. Everything in it is precalculated, and due to the reduced number of writes to the buffers, the impact on the framerate should be negligible.
The code still needs a good amount of cleanup and optimizations, and the translucent particles version will be implemented after that.
Also, no screenshot yet because I'm with very limited Internet access. Whoohoo!
-

mankrip - Posts: 915
- Joined: Fri Jul 04, 2008 3:02 am
-

Barnes - Posts: 226
- Joined: Thu Dec 24, 2009 2:26 pm
- Location: Russia, Moscow
Who is online
Users browsing this forum: No registered users and 1 guest
