Page 1 of 3

playing with q3map2

Posted: Tue Aug 23, 2011 11:02 pm
by gsigms
I am working on a map at the moment.

I am extensively using light emitting/non solid/detail/invisible brushes to create lights. this is done with the following shader:

Code: Select all

textures/test/inv_light
{
   q3map_lightColor .1 .1 .3
   q3map_surfacelight 300
   q3map_nolightmap

   surfaceparm nomarks
   surfaceparm nonsolid
   surfaceparm trans
   surfaceparm nolightmap
   surfaceparm detail

   surfaceparm strip       // :)

   qer_editorimage   textures/7g_light/blue.tga
   qer_trans 0.6

   {
      map $whiteimage
      rgbGen const ( 0.000000 0.000000 0.000000 )
      blendFunc GL_ONE GL_ONE
   }
}


what it looks like ig on a test room:
unmodified
unmodified


with r_showtris, we can see the light emitting brush:
unmodified showtriss
unmodified showtriss


after discussing this on cmm's irc, we wondered if using extensively that kind of brushes would impact fps, and since lights are calculated at compile-time if it was possible to get ride of those brushes.

well it turns out that a "dirty/very likely to provoke the armagedon" implementation can be writtten in 10 lines of code inside q3map2 and an extra surfaceparm directive:

with the modified q3map2:
modified showtriss
modified showtriss

Re: playing with q3map2

Posted: Wed Aug 24, 2011 4:01 am
by johnnyenglish
I'm going to ask the obvious questions now.

Why might this be better than using a light entity?

Do you still need that shader listed in your shaders file afterwards?

Re: playing with q3map2

Posted: Wed Aug 24, 2011 8:22 am
by gsigms
johnnyenglish wrote:I'm going to ask the obvious questions now.

Why might this be better than using a light entity?

Do you still need that shader listed in your shaders file afterwards?


This is just an opinion, light/invis brushes are very conveniant in some situations, for example, ambiant light in rooms and corridors: you don't need to place X light entities all along, and then when you need to modify that room/corridor, you just need to modifiy that light brush with it, adjusting the light amount is straighforward too, either in the shader, or by redimensionning the brush itself.

As to the shader, you can remove it after compilation.

Re: playing with q3map2

Posted: Wed Aug 24, 2011 9:30 am
by xandaxs
That's good for jump maps, I've tons of light entities already and I've to click 1 by 1 ....

Re: playing with q3map2

Posted: Wed Aug 24, 2011 10:36 am
by HappyDay
I've used brushes like this in HappyWorldJumps but I wouldn't use it again. Some guys have reported issues with mitsu's build where the brushes are not invisible.

Re: playing with q3map2

Posted: Wed Aug 24, 2011 10:53 am
by gsigms
HappyDay wrote:I've used brushes like this in HappyWorldJumps but I wouldn't use it again. Some guys have reported issues with mitsu's build where the brushes are not invisible.


I think that would no longer be a problem, since the brushes are deleted from the bsp.

Re: playing with q3map2

Posted: Wed Aug 24, 2011 12:57 pm
by Rylius
Uh...
surfaceparm nodraw? lol
And please rename the strip surfaceparm to q3map_strip since surfaceparms are game related

Re: playing with q3map2

Posted: Wed Aug 24, 2011 7:26 pm
by gsigms
Rylius wrote:Uh...
surfaceparm nodraw? lol
And please rename the strip surfaceparm to q3map_strip since surfaceparms are game related


checked what I told you on irc, nodraw faces can't emit light.

Re: playing with q3map2

Posted: Wed Aug 24, 2011 7:38 pm
by Rylius
Now that's bullshit - maybe we should change that?

Re: playing with q3map2

Posted: Sat Aug 27, 2011 8:51 am
by Delirium
Lol who is this guy? and ry is correct about surfaceparm. looks legit. i wouldnt use it though. seeming lights are stripped from bsp too. adds for shader parameters though. good job