ydnar: alphaMod problem


(Quaker-X) #1

Got a little problem with alphaMod. Ok, in my level, I have an island in the middle of the level surrounded by water on all sides. (using the water shader you provided in shaderlab_1337) The water fades perfectly into the distance. However, I have 2 terrain entities also. One of these is the more detailed one, surrounding the island with various small hills and such. The other is simply another 5-sided brush like the water shader. This brush is the one I want to fade into the distance like the water. These 2 terrain entities have the same “sand” texture on them, and I would like them to blend with each other. However, when using the same terrain shader, either the pentagon shaped brush is not effected by the alphaMod, or when I adjust the 2 shaders to work with alphaMod, the first, more detailed terrain is halfway transparent.

When I use a combo of both, whereas the detailed terrain works properly and so does the other brush with alphaMod, the 2 are different color shades. (the detailed one is much lighter than the other)

Here is the “detailed” terrain shader:

textures/duelx_1/beach_base
{
	nopicmips
	q3map_shadeangle 120 
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_lightmapsize 512 512
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
}

textures/duelx_1/beach_0
{
	q3map_baseshader textures/duelx_1/beach_base
	
	{
		map textures/duelx_1/sand.jpg
	}
	{
     		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
	}
}

textures/duelx_1/beachb_base
{
	nopicmips
	q3map_shadeangle 120 
	q3map_lightmapaxis z
	q3map_lightmapmergable
	q3map_lightmapsize 512 512
	q3map_tcGen ivector ( 256 0 0 ) ( 0 256 0 )
}

textures/duelx_1/beachb_0
{
	q3map_baseshader textures/duelx_1/beachb_base
	
	{
		map textures/duelx_1/sand.jpg
		blendFunc blend
		alphaGen vertex
	}
	{
     		map $lightmap
		blendFunc GL_DST_COLOR GL_ZERO
		alphaGen vertex
	}
}


(ratty redemption) #2

if you want any shaders to be affected by alphamod volume brushes you need to add alphagen vertex and blendfunc blend or similar, to each shader stage you want affected, including the lightmap stage, if you want a full range of transparency, rather then just fading out the tex stage, leaving the lightmap stage, like ydnar did in his 1337 sample map.


(ydnar) #3

Heh, where to begin. Your shaders are totally jacked. Sorry… :slight_smile:

  • Both of your base shaders are the same. Use the same base shader.

  • Both of your terrain shaders are identical, aside from this jacked “alphaGen vertex” nonsense which won’t work anyway, given that your terrain is lightmapped. Lightmaps can’t be faded using vertex alpha and blend with the destination color.

  • “nopicmips” isn’t a valid shader keyword, it’s “nopicmip” and even then it isn’t allowable in a base shader. ONLY Q3Map2 sees the base shader, not the game.

  • your base shader doesn’t have q3map_nonplanar. This is bad. Add it.

I assume you edited your post based on what Ratty suggested. Unfortunately that stuff won’t work.

Post your main (alphaMod) terrain shader with the two texture stages in a REPLY so I can show you how to fix it.

I also assume you want to blend the terrain off into the solid color below the water. The best way to do this is to use a fog brush with the fog color matching the skybox flat color. Then make the fog brush use the visible water surface as its shader stages, and lay it down inline with a larger nodraw-water brush.

y


(Quaker-X) #4

lol, yeah, kinda new with the terrain stuff. oh well. i didn’t edit my post before, either.

anyways, i fixed the problem by using the fog method. works perfectly, so im sticking with it and not messing with the terrain anymor :slight_smile: thanks for the replies though.


(ratty redemption) #5

@quaker-x, cool you got it working and could you post some more pics when your happy with it, as it looks an interesting map :slight_smile:

@ydnar, sorry if I`m confusing matters… but in one of my test maps, I got a lightmap stage to fade with alphamod volume brushes, although previously I thought it was impossible.

the shader I used was


textures/_water_test4/shallow_water2
{
	qer_editorimage textures/_water_test/qer_shallow.tga
	qer_trans 0.98
	surfaceparm nonsolid
 	surfaceparm water
	surfaceparm trans
	cull none
	{
		map $lightmap
		tcgen lightmap
		alphagen vertex
		blendfunc blend
	}
	{ 
		map textures/_water_test/shallow_water.tga
		rgbgen vertex
		blendfunc blend
	}
}

or are we talking about different things here?


(Quaker-X) #6

will do ratty. the level is for a mod of mine i am developing, which should be released in the coming weeks. it’s a simple level mainly to demonstrate the new effects and gameplay features of the mod.


(ratty redemption) #7

although I don`t have q3a, it sounds interesting :slight_smile: