Decals and fog

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Decals and fog

Post by dnky »

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?
Whatever....
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

just to highlight this:
Decal jump pad with no fog:
Image
Then Decal in the fog:
Image

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....
Fjoggs
Posts: 2555
Joined: Fri May 03, 2002 7:00 am

Post by Fjoggs »

Simply add the decal to a seperate texture, so it wouldn't be a decal?
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

there is that, but being lazy, it was easier to make a single texture I could use on any floor rather than several on different backgrounds.
Whatever....
Fjoggs
Posts: 2555
Joined: Fri May 03, 2002 7:00 am

Post by Fjoggs »

correct, you are lazy! :p
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

lol, I love you too!
Whatever....
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Post by Hipshot »

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
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

That will be my final resort I think. I need to test whether or not you can get far enough above the jp for doing it that way to cause z-fighting.
Whatever....
User avatar
Hipshot
Posts: 1547
Joined: Sun Jan 20, 2002 8:00 am

Post by Hipshot »

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)
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

yep thats true for sure. I tend to be obsessive about things looking right on all settings, even 16bit. Maybe nobody even looks at Q3 under 16bit mode anymore.
Whatever....
codey-
Posts: 44
Joined: Mon Mar 07, 2005 10:45 pm

Post by codey- »

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
Shallow
Posts: 167
Joined: Wed Feb 09, 2005 1:58 pm

Post by Shallow »

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.
dnky
Posts: 188
Joined: Thu Nov 24, 2005 3:49 pm

Post by dnky »

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....
Post Reply