Page 1 of 1
Texture lighting
Posted: Thu Nov 22, 2007 6:44 am
by highlanderstl
Ok, when I'm trying to have a texture emit light, it always create these "hotspots" of light.
In this pic, left side is NOT emitting light at all & the right side is emitting light by (q3map_surfacelight 20000) the shader. This is the only factor different between the two.
What I'm trying to do is have the entire texture emit a constant light across the entire texture; therefore, no "hotspots" showing. What am I missing?
Following is the code for the shader emitting light:
Code: Select all
textures/liquids/trimlight
{
qer_editorimage textures/suxass/bluelava_trim.tga
q3map_globaltexture
surfaceparm trans
surfaceparm noimpact
surfaceparm lava
surfaceparm nolightmap
[b]q3map_surfacelight 20000[/b]
cull disable
tesssize 128
cull disable
{
map textures/suxass/bluelava_trim.tga
tcMod scroll -.5 0
}
}
Re: Texture lighting
Posted: Thu Nov 22, 2007 9:58 am
by Fjoggs
20k? Jesus, that's high. My shaders has max max max 1k surfacelight for trims like that. Try lowering the value, and then add the level more generally. I've always had better results with it. Then again, I'm more of an entity boy then a shader boy.

Re: Texture lighting
Posted: Thu Nov 22, 2007 1:09 pm
by dichtfux
Doesn't the value to choose depend on the size of the texture? Maybe he's not talking of the blue trim in the middle, but of the whole texture.
Re: Texture lighting
Posted: Thu Nov 22, 2007 4:07 pm
by highlanderstl
Fjoggs wrote:20k? Jesus, that's high. My shaders has max max max 1k surfacelight for trims like that. Try lowering the value,
It is high, I just wanted to make it stick out more for the pic for you guys. It's truely at a lower value, but it still does that "hotspots" just not as obvious.
Fjoggs wrote: and then add the level more generally. I've always had better results with it. Then again, I'm more of an entity boy then a shader boy.

What do you mean " then add the level more generally"? What put that texture in more spots in the map? I really just want it to be in the inside of that trim work.
dichtfux wrote: Doesn't the value to choose depend on the size of the texture?
I believe you are right. Lighting on shaders play differently than entity lighting. I believe that large the size of the texture, the lower the "q3map_surfacelight" would need to be and vis averse. Can someone confirm what I'm saying here?
Maybe we need a highly experienced shader to tell us what is going on with these "hotspots"?
Re: Texture lighting
Posted: Thu Nov 22, 2007 5:12 pm
by Fjoggs
It just looked like you hadn't added any other light sources except that beam. But I might be mistaken so never mind me.

Re: Texture lighting
Posted: Thu Nov 22, 2007 5:36 pm
by Survivor
What you suspect is correct i believe. I also remember those problems and there was something about a division value, can't remember the line though.
Re: Texture lighting
Posted: Thu Nov 22, 2007 10:21 pm
by highlanderstl
Fjoggs wrote:It just looked like you hadn't added any other light sources except that beam. But I might be mistaken so never mind me.

That is right, but that is what I want. However, I want that light to be constant all the way across that beam, and not making these "spots".
Survivor wrote:
I also remember those problems and there was something about a division value, can't remember the line though.
I see that there is a q3map_lightsubdivide <value>. I tried it out and it didn't seem to help at all.
Re: Texture lighting
Posted: Thu Nov 22, 2007 10:39 pm
by highlanderstl
After thinking about what is happening. I relooked at that shader and it is due to tessSize.
tessSize <amount>
The tessSize shader controls the tessellation size (how finely a surface is chopped up in to triangles), in game units, of the surface. This is only applicable to solid brushes, not curves, and is generally only used on surfaces that are flagged with the deformVertexes keyword. Abuse of this can create a huge number of triangles. This happens during q3map processing, so maps must be reprocessed for changes to take effect.
Design Note: It can also be used on tesselating surfaces to make sure that tesselations are large, and thus, less costly in terms of triangles created.
Re: Texture lighting
Posted: Fri Nov 23, 2007 2:15 am
by Kaz
play around with:
q3map_backsplash p d
q3map_lightsubdivide n
Light emitting shaders are also lit by the light they produce, and backsplash controls the distance and percentage of that light. Increasing the distance will probably help your situation.
Light subdivide will give you a finer distribution of point lights.
Re: Texture lighting
Posted: Fri Nov 23, 2007 2:16 am
by Kaz
you don't want to go around splitting up all of those surfaces with tessSize, that's alot of wasted polies
Re: Texture lighting
Posted: Fri Nov 23, 2007 7:57 am
by highlanderstl
Kaz wrote:play around with:
q3map_backsplash p d
q3map_lightsubdivide n
Can you use both of them on one shader? I thought q3map_backsplash will not work on q3map_lightsubdivide.
I tried using backsplash and it is not working for me.
Re: Texture lighting
Posted: Sat Nov 24, 2007 3:56 pm
by obsidian
Of primary concern is that your shader does not have a lightmap stage and lightmaps surpressed with nolightmap, so I'm assuming that your texture is really only being vertex lit which probably explains a great many things. You can't light something that doesn't have a lightmap in the first place. Double check your concrete texture as well and make sure it's actually lightmapped.
More Explanations:
You can use lightSubdivide and backSplash together. What surfacelight shaders do is generate light entities NxN units at the intensity specified. Larger surface space means more of these lights generated, resulting in a brighter overall light.
q3map_lightSubdivide controls the distribution of these generated point lights so you can scale them to be closer together though you will end up with longer light compile times. I've been meaning to fix an error in the shader manual, this does not "chop up polygons". Reminds self to fix.
q3map_backSplash controls the distance from the surface that the point lights are generated as well as controlling the percentage of light that is redirected back at the surface. Increasing both values slightly will probably do wonders.
q3map_tessSize (it's been renamed in q3map2 for consistency) does not do what you think it does. It only somewhat does what you're after because it's creating a finer array of vertexes for vertex lighting (no lightmap), but that's more of a side effect than anything else. tessSize literally chops up the surface into small squares and is generally used for water or other vertex deforming shaders to simulate deforming waves and ripples.
Read up:
http://www.robotrenegade.com/q3map2/doc ... l/ch3.html
Re: Texture lighting
Posted: Sat Nov 24, 2007 5:20 pm
by highlanderstl
obsidian wrote:Of primary concern is that your shader does not have a lightmap stage and lightmaps surpressed with nolightmap, so I'm assuming that your texture is really only being vertex lit which probably explains a great many things. You can't light something that doesn't have a lightmap in the first place. Double check your concrete texture as well and make sure it's actually lightmapped.
I understand what q3map_lightSubdivide, q3map_backSplash and q3map_tessSize does. It just wasn't working :P However, what I didn't know about what you mentioned first, about the different stages.
Now, it makes sense. I will add these stages and see what happens.
Thanks.