Light styles and depthFunc equal compatibility issues
Posted: Wed Jan 03, 2018 10:23 am
Hi. I'm trying to tweak little settings for each possible lightmapped shader to be hit by light styles by rearranging lightmap and texture order and inserting style marker between lightmap and texture stages:
But here's the issue. It looks like I need to first write depth using alphaFunc to define depth and depthWrite to write depth into buffer before I can use depthFunc equal to use that depth buffer, which is incompatible with light style marked lightmapped shader. When I did this arrangement, the lightmap doesn't work in these shaders, resulting in grates being alpha masked and blended into background. In addition, it creates HOM effect when displayed over fog brush surface landed over skybox surface, which makes the texture pretty much rendered full-bright (in fact, I'm testing maps using devmap command to get rid of HOM effect by using r_clear cvar set to 1, which creates an ugly pink color, but it's still more nice to eyes than HOM effect).
And yes, this is Sock's industrial texturepack, being used in my currently WIP map Schöna. Since original texturepack doesn't have any shaders, I had to create some myself.
Styled light shaders look like following one:
All styled light shaders have style marker in order to get hit by its own style. Currently, only one light style is used, and that's this flicker effect. If you have better idea, how to make flickering light effect, that works good with in-game timeline, go ahead and tell 
Code: Select all
textures/czq3dm1_tech/metb_grate1
{
surfaceparm metalsteps
surfaceparm nonsolid
surfaceparm noimpact
surfaceparm trans
surfaceparm alphashadow
cull none
{
map $lightmap
tcGen lightmap
depthFunc equal
}
q3map_styleMarker
{
map textures/czq3dm1_tech/metb_grate1.tga
rgbGen identity
blendFunc GL_ZERO GL_SRC_COLOR
alphaFunc GE128
depthWrite
}
}
And yes, this is Sock's industrial texturepack, being used in my currently WIP map Schöna. Since original texturepack doesn't have any shaders, I had to create some myself.
Styled light shaders look like following one:
Code: Select all
textures/czq3dm1_tech/metb_light3_flicker
{
q3map_lightimage textures/czq3dm1_tech/metb_light3_blend.tga
q3map_surfacelight 250
q3map_lightstyle 1
qer_editorimage textures/czq3dm1_tech/metb_light3.tga
surfaceparm nomarks
{
map $lightmap
tcGen lightmap
}
q3map_styleMarker
{
map textures/czq3dm1_tech/metb_light3.tga
rgbGen identity
blendFunc GL_ZERO GL_SRC_COLOR
}
{
map textures/czq3dm1_tech/metb_light3_blend.tga
blendFunc GL_ONE GL_ONE
rgbGen wave square 0 .5 .2 8
}
{
map textures/czq3dm1_tech/metb_light3_blend.tga
blendFunc GL_ONE GL_ONE
rgbGen wave square 0 .5 .7 3
}
}
