problems with lightgrid and alpha channel
Moderator: InsideQC Admins
6 posts
• Page 1 of 1
problems with lightgrid and alpha channel
Hello forum
i am using q3bsp and you know this format uses lithgrid to iluminate the models. Well this works great but I have some problems with some models with alpha channel in some faces. The lightgrid iluminate some faces and anothers seems totally black 
you can see the ugly effect here. This models are not compiled inside the bsp, they are called by qc like entities.

the image above is a q3bsp and you can see the effect: some faces are totally black. The image below is from a q1bsp, where the problem does not appear (all the lighting of model is based in the "origin"). My idea would be to use a shader to the leaves, to avoid this effect. BBut uses the lighgrid for the tree trunk.
I am not a specialist in dp scripts shaders, so I apologize
I am usign darkplaces engine. This is the shader for the leaves of the tree. I tested all the "cull" variables, and many other shaders for alpha channel with no pòsitive results
you can see the ugly effect here. This models are not compiled inside the bsp, they are called by qc like entities.

the image above is a q3bsp and you can see the effect: some faces are totally black. The image below is from a q1bsp, where the problem does not appear (all the lighting of model is based in the "origin"). My idea would be to use a shader to the leaves, to avoid this effect. BBut uses the lighgrid for the tree trunk.
I am not a specialist in dp scripts shaders, so I apologize
I am usign darkplaces engine. This is the shader for the leaves of the tree. I tested all the "cull" variables, and many other shaders for alpha channel with no pòsitive results
- Code: Select all
models/tree_leaf
{
cull back
qer_trans 0.2
surfaceparm nolightmap
surfaceparm trans
// deformVertexes wave 128 sin 0 1 0 0.25
{
map models/tree_leaf
alphaFunc GT0
rgbGen vertex
}
}
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
Re: problems with lightgrid and alpha channel
'rgbGen vertex' should result in the entire thing basically being fullbright (iqm supports vertex colours, but they're a pain to export so I doubt you're using that, thus fullbright).
if the engine is already ignoring stuff like that then there's not really much you can do from the perspective of the shader.
you can try throwing more lights onto the map, to try to ensure that the base light levels are bright enough to light everything. the light grid has min+max+dir values, so you need to make sure both sides are light enough. I don't know enough about q3map2 to do this, try minlight? :s
remember the light grid is 3d, so you'll probably need lights both near AND far from the ground.
also, make sure your entity's origin isn't weird and inside the ground.
if the engine is already ignoring stuff like that then there's not really much you can do from the perspective of the shader.
you can try throwing more lights onto the map, to try to ensure that the base light levels are bright enough to light everything. the light grid has min+max+dir values, so you need to make sure both sides are light enough. I don't know enough about q3map2 to do this, try minlight? :s
remember the light grid is 3d, so you'll probably need lights both near AND far from the ground.
also, make sure your entity's origin isn't weird and inside the ground.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Re: problems with lightgrid and alpha channel
The lightgrid doesn't apply to models lit with rgbGen vertex. Models compiled into Q3BSP maps become part of the map geometry and use calculated baked lighting on their vertices (on map compile) via rgbGen vertex, not the lightgrid.
so, use rgbGen lightingDiffuse for your non-Q3BSP cases.
so, use rgbGen lightingDiffuse for your non-Q3BSP cases.
i should not be here
- leileilol
- Posts: 2783
- Joined: Fri Oct 15, 2004 3:23 am
Re: problems with lightgrid and alpha channel
I'd suggest to use misc_model and compile them into the BSP, and just use vertex lighting on those trees.
That's just my opinion though.
That's just my opinion though.
-

goldenboy - Posts: 924
- Joined: Fri Sep 05, 2008 11:04 pm
- Location: Kiel
Re: problems with lightgrid and alpha channel
Thank you guys
rgbGen lightingDiffuse works perfect!
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
Re: problems with lightgrid and alpha channel
hi guys !!
is there a way to ignore the lightgrid and to get a model working like q1bsp, i mean the lighting of model is based in the "origin" instead of lightgrid.
I want to emule sprite illumination using flat models.
I did try using RgbGen entity but doesnt work
is there a way to ignore the lightgrid and to get a model working like q1bsp, i mean the lighting of model is based in the "origin" instead of lightgrid.
I want to emule sprite illumination using flat models.
I did try using RgbGen entity but doesnt work
hi, I am nahuel, I love quake and qc.
-

Nahuel - Posts: 492
- Joined: Wed Jan 12, 2011 8:42 pm
- Location: mar del plata
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest