Problem with AlphaMod


(tomas.chavez) #1

Im having a litle proble because I have a sea that goes into sky color, in fact it goes into transparency (SCREENSHOT BELOW)

but the sand below that do the same makes a strange effect… like superposed or something like that… (SCREENSHOT BELOW)


There the SEA EDGE that is suposed to be over the sand is below … like a illusion and the SAND EDGE is acting like the SEA EDGE…

i dont know what to do

here are the shaders (the go to transparency with alpha mod brushes

//ALL TEXTURES WITHOUT ALPHACHANNEL EXCEPT textures/chaez/chaez_sea.tga
//SAND TO TRANSPARENCY
textures/chaez/chaez_underwater_end
{
	qer_editorimage textures/desert_sd/sand_disturb_desert.tga
	surfaceparm nolightmap
	surfaceparm landmine
	surfaceparm gravelsteps
	q3map_novertexshadows
	q3map_forcesunlight
	nopicmip
	{
		map textures/chaez/chaez_fog_ocean.tga //OCEAN FOG COLOR
		blendFunc blend
		rgbGen identity
		alphaGen const 1.0
	}
	{
		map textures/desert_sd/sand_disturb_desert.tga
		blendFunc blend
		rgbGen vertex
		alphaGen vertex
	}
}

//SEA TO TRANSPARENCY
textures/e_o_ocean/terrain_end
{
	q3map_baseshader textures/e_o_ocean/ocean_base
	{
		map textures/chaez/chaez_fog_sky.tga //SKY HORIZONT COLOR
		blendfunc blend
		rgbGen identity
		alphaGen const 1.0
	}
	{
		//LIKE THE REST OF THE SEA BUT WITH ALPHA CHANNEL OF 0.45*
		//*I  REALISED THAT THIS TEXTURE IS NOT NECESARY BECAUSE I CAN USE THE ALPHAMOD IN 0.45 INSTEAD OF AN ALPHACHANNEL
		map textures/chaez/chaez_sea.tga
		blendfunc blend
		rgbGen identity
		tcMod scroll 0.005 0.03
		alphaGen Vertex
	}
}

//OCEAN BASE
textures/e_o_ocean/ocean_base
{
	qer_editorimage textures/liquids_sd/seawall_ocean.tga
	surfaceparm nomarks
	surfaceparm nonsolid
	surfaceparm trans
	surfaceparm pointlight
	surfaceparm lightfilter
	surfaceparm water
	nopicmip
	qer_trans 0.75
	q3map_globaltexture
	q3map_tcGen ivector ( 512 0 0 ) ( 0 512 0 )
}

The other problem is that like it goes int transparency you can see a part of the sky that is ugly (all the skies have the same problem) and I don’tknow what to do but first I wanna solve the first problem :disgust:


(redRum) #2

To avoid the HOM effect in the lower parts of the sky you can use a skybox in the background. You can easily make one just with the base color you want for your background and add it to the sky shader. It will also affect the rest of the sky so you might need to modify it.

About your main trouble, I’m not very sure I understood your post properly. Looking at your pic it seems like the water is not blending at all. If the problem is that the game is drawing the textures in an incorrect order then you can try to insert this in your sand and water shaders; from the Q3A shader manual:

3.9 sort <value>
Use this keyword to fine-tune the depth sorting of shaders as they are compared against other shaders in the game world. The basic concept is that if there is a question or a problem with shaders drawing in the wrong order against each other, this allows the designer to create a hierarchy of which shader draws in what order.

The default behavior is to put all blended shaders in sort “additive” and all other shaders in sort “opaque”, so you only need to specify this when you are trying to work around a sorting problem with multiple transparent surfaces in a scene.

The value here can be either a numerical value or one of the keywords in the following list (listed in order of ascending priority):

  portal (1): This surface is a portal, it draws over every other shader seen inside the portal, but before anything in the main view.

  Sky (2): Typically, the sky is the farthest surface in the game world. Drawing this after other opaque surfaces can be an optimization on some cards. This currently has the wrong value for this purpose, so it doesn't do much of anything.

  Opaque (3): This surface is opaque (rarely needed since this is the default with no blendfunc)

  Banner (6) : Transparent, but very close to walls.

  Underwater (8): Draw behind normal transparent surfaces.

  Additive (9): normal transparent surface (default for shaders with blendfuncs)

  nearest (16): this shader should always sort closest to the viewer, e.g. muzzle flashes and blend blobs 

hope it helps


(tomas.chavez) #3

Thnks!!

About the problem of SKY there is something I have discovered: The skies that don’t use ENV effect don’t have the “down floor” of the sky box (like Fueldump sky) and if you add a ENV effect to one of those skies, this (the ENV effect) will be drawn above the rest of the sky so you will have a “down floor” for your sky, the only thing you need to do is to make the ENV images concord with the color of the rest of the sky.