Decals and fog
Decals and fog
Has anybody got any experience using decals in conjunction with fog?
I have a problem where the decal is being drawn on top of the fog. Is this another Q3 fog problem or is there a way around it, maybe using sort n? I would normally use sort 6 on a decal shader, but maybe something different when used in fog?
I have a problem where the decal is being drawn on top of the fog. Is this another Q3 fog problem or is there a way around it, maybe using sort n? I would normally use sort 6 on a decal shader, but maybe something different when used in fog?
Whatever....
just to highlight this:
Decal jump pad with no fog:

Then Decal in the fog:

For these shots I was trying sort 8, which I thought drew behind transparent effects, like water.
Maybe I'm barking up the wrong tree, maybe its the blendFunc in the shader, in that case here is the script:
Decal jump pad with no fog:

Then Decal in the fog:

For these shots I was trying sort 8, which I thought drew behind transparent effects, like water.
Maybe I'm barking up the wrong tree, maybe its the blendFunc in the shader, in that case here is the script:
Code: Select all
textures/dk_geo4/dk_jp
{
qer_editorimage textures/dk_geo4/dk_jp.tga
surfaceparm trans
surfaceparm nomarks
q3map_lightimage textures/dk_geo4/dk_jp_fx.tga
q3map_surfacelight 50
polygonOffset
sort 8
nopicmip
{
map textures/dk_geo4/dk_jp.tga
blendFunc GL_ONE GL_ZERO
alphaFunc GE128
depthWrite
rgbGen identity
}
{
clampmap textures/dk_geo4/dk_jp_fx.tga
blendfunc add
tcMod stretch sin 1 .5 0 .8
rgbGen wave square .5 .5 .25 1.5
}
{
map $lightmap
rgbGen identity
blendFunc GL_DST_COLOR GL_ZERO
depthFunc equal
}
}
Whatever....
Just make a normal transparent shader with notsolid and apply it on a nodraw brush that is 1U over the ground... why mess with decals?
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
I've done it on my entire map, all windows, metal plates that is under my weapons, no zfight there, you don't get zfight in 32bpp if you don't build a texture into another on the same plane.
You would get zfight with you way also, if you were using 16bpp.
(the map http://www.quake3world.com/forum/viewtopic.php?t=18126 check the windows and that)
You would get zfight with you way also, if you were using 16bpp.
(the map http://www.quake3world.com/forum/viewtopic.php?t=18126 check the windows and that)
ydnar posted a trick using a inverse shader and the actually texture also inverted which he called 'Inverse multiplicative shadows'. Thread is here - scroll down a bit - but since he lost control over shaderlab.com the images are missing:
Decal tricks
Maybe that can help you
Decal tricks
Maybe that can help you
I did make a post on MC a while back explaining the same thing, the images for that should still be up. In fact I'm pretty sure donks has used it in at least one of his maps, is that right guv?
Unfortunately, the inverse blend trick is only really useful for stuff like stains which would actually need to be blended with the texture underneath, it wouldn't really work with something that needs to have opaque areas like a jump-pad.
Unfortunately, the inverse blend trick is only really useful for stuff like stains which would actually need to be blended with the texture underneath, it wouldn't really work with something that needs to have opaque areas like a jump-pad.
yep I have. You're both right. That works, but as Shallow says it makes the texture semi-trans and blends with the underlying texture. Dumping polygonoffset works in this case, even at 16bit you cant see any z-fighting as you cant get far enough away from the jump pad for LOD to have an effect.
Whatever....