problems with lightgrid and alpha channel

Discuss the creation of various model formats for Quake engines, and related matters to modeling.
Post Reply
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

problems with lightgrid and alpha channel

Post by Nahuel »

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.
Image


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.
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: problems with lightgrid and alpha channel

Post by Spike »

'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.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: problems with lightgrid and alpha channel

Post by leileilol »

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.
i should not be here
goldenboy
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel
Contact:

Re: problems with lightgrid and alpha channel

Post by goldenboy »

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.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: problems with lightgrid and alpha channel

Post by Nahuel »

Thank you guys :) rgbGen lightingDiffuse works perfect!
hi, I am nahuel, I love quake and qc.
Nahuel
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Re: problems with lightgrid and alpha channel

Post by Nahuel »

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
hi, I am nahuel, I love quake and qc.
Post Reply