alpha shader on ase model = invisability


(Hewster) #1

Hi Ydnar,

This is in relation to the 2.5.15 dev builds (RtCW).

I have noticed in all the dev builds which I have downloaded and tested, it seems something
odd is happeneing to the geomatry of ase models (might be other formats too) when
an alpha channel shader is applied to the said model.

In game, the model geomatry is not visible, however, r_showtris says it is there :confused:
(notice also the models do cast shadows)

See screenies from my test map:

From within radiant:

In_Game:

with show_tris:

Sample shader used on the plant models:

textures/ww_town/models/reeds02
{
	qer_editorimage textures/ww_town/models/reeds02.tga
	surfaceparm alphashadow
	cull none
	q3map_bounce 0
	q3map_forcesunlight
	{
		map textures/ww_town/models/reeds02.tga
		alphaFunc GE128
		depthWrite
		rgbGen vertex
	}
}

Obviously these results are from dev builds of q3map2,and so I expect bugs,
but I thought you may be interested in this one. :slight_smile:

Hewster


(Gringo Starr) #2

http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8689 :slight_smile:


(Gringo Starr) #3

Hewster, have you remembered that option that prevents light from leaking out from inside of a model? I’ve been searching here. EDIT: In case you misunderstood what I meant before, I’ve posted a question about it anyway :).


(Hewster) #4

Thanks Gringo, I seem to have missed that post :confused:

err, but you didn’t answer weather yndars suggestion worked ?

Add this to the shader and recompile, see if it fixes the problem:

q3map_alphaGen const 1.0

err the light shader thing is err q3map_backlight or something…

… searching …
…

http://shaderlab.com/q3map2/shader_manual/ch3.htm#backsplash

I’m not 100% sure this is what you want, but it is the command I was thinking of.
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=search&mode=results

Hewster


(Gringo Starr) #5

Sorry, I didn’t try that fix for the missing alpha shaders yet. :frowning: Thanks, I’ll try backsplash.


(Hewster) #6

And the answer is YES, using q3map_alphaGen const 1.0 fixes the issue :slight_smile:

new example shader:

textures/ww_town/models/reeds02
{
qer_editorimage textures/ww_town/models/reeds02.tga
surfaceparm alphashadow
cull none
q3map_bounce 0
q3map_forcesunlight
q3map_alphaGen const 1.0
{
map textures/ww_town/models/reeds02.tga
alphaFunc GE128
depthWrite
rgbGen vertex
}
}

Hewster


(Gringo Starr) #7

Cool, thanks.


(ydnar) #8

Bug in the ASE loader. Will fix.

y


(ydnar) #9

OK, I think I’ve fixed it. Download the development build again and see if that corrects the problem.


(Hewster) #10

Just to confirm, the latest dev build is on this page:
http://akiba.shaderlab.com/GtkRadiant/tools/quake3/q3map2/Release/

and the most recent version identifies itself as:
GtkRadiant - v1.5.0 Jun 27 2004 16:22:59

This is the version I used in the original post, so I think there is still a problem…
I have noticed that not all alpha blended models disappear, but most,
If you need any more info / sample model / map, just let me know Ydnar.

Hewster


(ydnar) #11

Can you re-download and see if that works now?


(Hewster) #12

ok I’ve tried with the version compiled 4th July, and the problem still exists
on most of my alpha models.

Here is the ascii of one of the effected models:


*3DSMAX_ASCIIEXPORT	200
*COMMENT "AsciiExport Version  2.00 - Sun Jul 20 07:51:32 2003"
*SCENE {
	*SCENE_FILENAME ""
	*SCENE_FIRSTFRAME 0
	*SCENE_LASTFRAME 39
	*SCENE_FRAMESPEED 10
	*SCENE_TICKSPERFRAME 480
	*SCENE_BACKGROUND_STATIC 0.0000	0.0000	0.0000
	*SCENE_AMBIENT_STATIC 0.0000	0.0000	0.0000
}
*MATERIAL_LIST {
	*MATERIAL_COUNT 1
	*MATERIAL 0 {
		*MATERIAL_NAME "textures/ww_town/models/reeds02"
		*MATERIAL_CLASS "Standard"
		*MATERIAL_AMBIENT 0.5880	0.5880	0.5880
		*MATERIAL_DIFFUSE 0.5880	0.5880	0.5880
		*MATERIAL_SPECULAR 0.9000	0.9000	0.9000
		*MATERIAL_SHINE 0.1000
		*MATERIAL_SHINESTRENGTH 0.0000
		*MATERIAL_TRANSPARENCY 0.0000
		*MATERIAL_WIRESIZE 1.0000
		*MATERIAL_SHADING Blinn
		*MATERIAL_XP_FALLOFF 0.0000
		*MATERIAL_SELFILLUM 0.0000
		*MATERIAL_FALLOFF In
		*MATERIAL_XP_TYPE Filter
		*MAP_DIFFUSE {
			*MAP_NAME "Bitmaptexture"
			*MAP_CLASS "Bitmap"
			*MAP_SUBNO 1
			*MAP_AMOUNT 1.0000
			*BITMAP "C:\games\Return to Castle Wolfenstein\WildWest	extures\ww_town\models\reeds02.tga"
			*MAP_TYPE Screen
			*UVW_U_OFFSET 0.0000
			*UVW_V_OFFSET 0.0000
			*UVW_U_TILING 1.0000
			*UVW_V_TILING 1.0000
			*UVW_ANGLE 0.0000
			*UVW_BLUR 1.0000
			*UVW_BLUR_OFFSET 0.0000
			*UVW_NOUSE_AMT 1.0000
			*UVW_NOISE_SIZE 1.0000
			*UVW_NOISE_LEVEL 1
			*UVW_NOISE_PHASE 0.0000
			*BITMAP_FILTER Pyramidal
		}
	}
}
*GEOMOBJECT {
	*NODE_NAME "Box02"
	*NODE_TM {
		*NODE_NAME "Box02"
		*INHERIT_POS 0 0 0
		*INHERIT_ROT 0 0 0
		*INHERIT_SCL 0 0 0
		*TM_ROW0 1.0000	0.0000	0.0000
		*TM_ROW1 0.0000	1.0000	0.0000
		*TM_ROW2 0.0000	0.0000	1.0000
		*TM_ROW3 0.0000	0.0000	0.0000
		*TM_POS 0.0000	0.0000	0.0000
		*TM_ROTAXIS 0.0000	0.0000	0.0000
		*TM_ROTANGLE 0.0000
		*TM_SCALE 1.0000	1.0000	1.0000
		*TM_SCALEAXIS 0.0000	0.0000	0.0000
		*TM_SCALEAXISANG 0.0000
	}
	*MESH {
		*TIMEVALUE 0
		*MESH_NUMVERTEX 6
		*MESH_NUMFACES 2
		*MESH_VERTEX_LIST {
			*MESH_VERTEX    0	50.6719	37.1406	-0.2969
			*MESH_VERTEX    1	-56.1719	-41.7813	-0.2969
			*MESH_VERTEX    2	74.7813	26.9375	114.5313
			*MESH_VERTEX    3	-50.0469	-39.4063	125.3594
			*MESH_VERTEX    4	74.7813	26.9375	114.5313
			*MESH_VERTEX    5	-56.1719	-41.7813	-0.2969
		}
		*MESH_FACE_LIST {
			*MESH_FACE    0:    A:    0 B:    2 C:    1 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
			*MESH_FACE    1:    A:    3 B:    5 C:    4 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 2 	*MESH_MTLID 0
		}
		*MESH_NUMTVERTEX 6
		*MESH_TVERTLIST {
			*MESH_TVERT 0	1.0000	-1.0000	0.0000
			*MESH_TVERT 1	0.0000	-1.0000	0.0000
			*MESH_TVERT 2	1.0000	-0.1908	0.0000
			*MESH_TVERT 3	0.0000	-0.1908	0.0000
			*MESH_TVERT 4	1.0000	-0.1908	0.0000
			*MESH_TVERT 5	0.0000	-1.0000	0.0000
		}
		*MESH_NUMTVFACES 2
		*MESH_TFACELIST {
			*MESH_TFACE 0	0	2	1
			*MESH_TFACE 1	3	5	4
		}
		*MESH_NORMALS {
			*MESH_FACENORMAL 0	0.5830	-0.7893	-0.1925
				*MESH_VERTEXNORMAL 0	0.5830	-0.7893	-0.1925
				*MESH_VERTEXNORMAL 2	0.5830	-0.7893	-0.1925
				*MESH_VERTEXNORMAL 1	0.5830	-0.7893	-0.1925
			*MESH_FACENORMAL 1	0.4689	-0.8832	-0.0062
				*MESH_VERTEXNORMAL 3	0.4689	-0.8832	-0.0062
				*MESH_VERTEXNORMAL 5	0.4689	-0.8832	-0.0062
				*MESH_VERTEXNORMAL 4	0.4689	-0.8832	-0.0062
		}
	}
	*PROP_MOTIONBLUR 0
	*PROP_CASTSHADOW 1
	*PROP_RECVSHADOW 1
	*MATERIAL_REF 0
}
*GEOMOBJECT {
	*NODE_NAME "Box03"
	*NODE_TM {
		*NODE_NAME "Box03"
		*INHERIT_POS 0 0 0
		*INHERIT_ROT 0 0 0
		*INHERIT_SCL 0 0 0
		*TM_ROW0 1.0000	0.0000	0.0000
		*TM_ROW1 0.0000	1.0000	0.0000
		*TM_ROW2 0.0000	0.0000	1.0000
		*TM_ROW3 0.0000	0.0000	0.0000
		*TM_POS 0.0000	0.0000	0.0000
		*TM_ROTAXIS 0.0000	0.0000	0.0000
		*TM_ROTANGLE 0.0000
		*TM_SCALE 1.0000	1.0000	1.0000
		*TM_SCALEAXIS 0.0000	0.0000	0.0000
		*TM_SCALEAXISANG 0.0000
	}
	*MESH {
		*TIMEVALUE 0
		*MESH_NUMVERTEX 6
		*MESH_NUMFACES 2
		*MESH_VERTEX_LIST {
			*MESH_VERTEX    0	66.2031	-13.3281	-0.2969
			*MESH_VERTEX    1	-55.3438	12.1406	-0.2969
			*MESH_VERTEX    2	79.9063	11.0938	126.5938
			*MESH_VERTEX    3	-69.0313	32.1250	108.6875
			*MESH_VERTEX    4	79.9063	11.0938	126.5938
			*MESH_VERTEX    5	-55.3438	12.1406	-0.2969
		}
		*MESH_FACE_LIST {
			*MESH_FACE    0:    A:    0 B:    2 C:    1 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
			*MESH_FACE    1:    A:    3 B:    5 C:    4 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 2 	*MESH_MTLID 0
		}
		*MESH_NUMTVERTEX 6
		*MESH_TVERTLIST {
			*MESH_TVERT 0	1.0000	-1.0000	0.0000
			*MESH_TVERT 1	0.0000	-1.0000	0.0000
			*MESH_TVERT 2	1.0000	-0.1812	0.0000
			*MESH_TVERT 3	0.0000	-0.1812	0.0000
			*MESH_TVERT 4	1.0000	-0.1812	0.0000
			*MESH_TVERT 5	0.0000	-1.0000	0.0000
		}
		*MESH_NUMTVFACES 2
		*MESH_TFACELIST {
			*MESH_TFACE 0	0	2	1
			*MESH_TFACE 1	3	5	4
		}
		*MESH_NORMALS {
			*MESH_FACENORMAL 0	-0.2007	-0.9578	0.2060
				*MESH_VERTEXNORMAL 0	-0.2007	-0.9578	0.2060
				*MESH_VERTEXNORMAL 2	-0.2007	-0.9578	0.2060
				*MESH_VERTEXNORMAL 1	-0.2007	-0.9578	0.2060
			*MESH_FACENORMAL 1	-0.1568	-0.9747	0.1590
				*MESH_VERTEXNORMAL 3	-0.1568	-0.9747	0.1590
				*MESH_VERTEXNORMAL 5	-0.1568	-0.9747	0.1590
				*MESH_VERTEXNORMAL 4	-0.1568	-0.9747	0.1590
		}
	}
	*PROP_MOTIONBLUR 0
	*PROP_CASTSHADOW 1
	*PROP_RECVSHADOW 1
	*MATERIAL_REF 0
}
*GEOMOBJECT {
	*NODE_NAME "Box04"
	*NODE_TM {
		*NODE_NAME "Box04"
		*INHERIT_POS 0 0 0
		*INHERIT_ROT 0 0 0
		*INHERIT_SCL 0 0 0
		*TM_ROW0 1.0000	0.0000	0.0000
		*TM_ROW1 0.0000	1.0000	0.0000
		*TM_ROW2 0.0000	0.0000	1.0000
		*TM_ROW3 0.0000	0.0000	0.0000
		*TM_POS 0.0000	0.0000	0.0000
		*TM_ROTAXIS 0.0000	0.0000	0.0000
		*TM_ROTANGLE 0.0000
		*TM_SCALE 1.0000	1.0000	1.0000
		*TM_SCALEAXIS 0.0000	0.0000	0.0000
		*TM_SCALEAXISANG 0.0000
	}
	*MESH {
		*TIMEVALUE 0
		*MESH_NUMVERTEX 6
		*MESH_NUMFACES 2
		*MESH_VERTEX_LIST {
			*MESH_VERTEX    0	23.5938	-51.8438	-0.2969
			*MESH_VERTEX    1	-29.2813	60.6094	-0.2969
			*MESH_VERTEX    2	-7.5156	-67.3906	116.7969
			*MESH_VERTEX    3	-34.8906	70.5781	130.6250
			*MESH_VERTEX    4	-7.5156	-67.3906	116.7969
			*MESH_VERTEX    5	-29.2813	60.6094	-0.2969
		}
		*MESH_FACE_LIST {
			*MESH_FACE    0:    A:    0 B:    2 C:    1 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 1 	*MESH_MTLID 0
			*MESH_FACE    1:    A:    3 B:    5 C:    4 AB:    1 BC:    1 CA:    1	 *MESH_SMOOTHING 2 	*MESH_MTLID 0
		}
		*MESH_NUMTVERTEX 6
		*MESH_TVERTLIST {
			*MESH_TVERT 0	1.0000	-1.0000	0.0000
			*MESH_TVERT 1	0.0000	-1.0000	0.0000
			*MESH_TVERT 2	1.0000	-0.1812	0.0000
			*MESH_TVERT 3	0.0000	-0.1812	0.0000
			*MESH_TVERT 4	1.0000	-0.1812	0.0000
			*MESH_TVERT 5	0.0000	-1.0000	0.0000
		}
		*MESH_NUMTVFACES 2
		*MESH_TFACELIST {
			*MESH_TFACE 0	0	2	1
			*MESH_TFACE 1	3	5	4
		}
		*MESH_NORMALS {
			*MESH_FACENORMAL 0	-0.8675	-0.4079	-0.2846
				*MESH_VERTEXNORMAL 0	-0.8675	-0.4079	-0.2846
				*MESH_VERTEXNORMAL 2	-0.8675	-0.4079	-0.2846
				*MESH_VERTEXNORMAL 1	-0.8675	-0.4079	-0.2846
			*MESH_FACENORMAL 1	-0.9810	-0.1919	-0.0274
				*MESH_VERTEXNORMAL 3	-0.9810	-0.1919	-0.0274
				*MESH_VERTEXNORMAL 5	-0.9810	-0.1919	-0.0274
				*MESH_VERTEXNORMAL 4	-0.9810	-0.1919	-0.0274
		}
	}
	*PROP_MOTIONBLUR 0
	*PROP_CASTSHADOW 1
	*PROP_RECVSHADOW 1
	*MATERIAL_REF 0
}

Hewtser


(Gringo Starr) #13

Hewster, I’ve seen this problem on ww_boulderdash, but not on Machogrande. Try the shader I used for Macho.

textures/ww_machogrande/models/reeds02
{
	qer_editorimage textures/ww_machogrande/models/reeds02.tga
	q3map_cloneShader textures/ww_machogrande/models/reeds02_back
	q3map_forcemeta
	q3map_lightmapsamplesize 20
	//q3map_lightmapGamma 1
	q3map_bounce 0
	surfaceparm alphashadow
	surfaceparm nomarks
	//cull none
	{
		map textures/ww_machogrande/models/reeds02.tga
		rgbgen identity
		alphaFunc GE128
	}
	{
		map $lightmap
		blendFunc filter
		rgbgen identity
		alphaFunc GE128
	}
}
textures/ww_machogrande/models/reeds02_back
{
	qer_editorimage textures/ww_machogrande/models/reeds02.tga
	q3map_invert
	q3map_forcemeta
	q3map_lightmapsamplesize 20
	//q3map_lightmapGamma 1
	q3map_bounce 0
	//surfaceparm alphashadow
	surfaceparm nomarks
	surfaceparm trans
	//cull none
	{
		map textures/ww_machogrande/models/reeds02.tga
		rgbgen identity
		alphaFunc GE128
	}
	{
		map $lightmap
		blendFunc filter
		rgbgen identity
		alphaFunc GE128
	}
}

(Hewster) #14

Thanks Gringo,
I think I might use that shader, cos I like the look of vegitation shading machogrande :slight_smile:

However, I have just tested 2.5.15, and this problem seems to be resloved
http://www.splashdamage.com/index.php?name=pnPHPbb2&file=viewtopic&t=8916

Thank-you Ydnar :slight_smile:

Hewster


(Gringo Starr) #15

I have a problem with this shader not showing up on an ASE model. The material makes it into the model, appears in Radiant, but does not appear in the game.

textures/dg_skyscraper/ma_dirtyglass
{
    q3map_alphaGen const 1.0  //added after problem
    q3map_forcemeta //added after problem
    surfaceparm glass
    surfaceparm nolightmap
    surfaceparm trans  //added after problem
    nomipmaps
    nopicmip
    {
        map textures/dg_skyscraper/ma_dirtyglass.tga
        alphaFunc GE128
	//blendFunc blend
        depthWrite
        rgbGen vertex
    }
}

Compiled with 2.5.15

 -meta -notjunc -vis -light -fast -filter -patchshadows -samples 3

(Gringo Starr) #16

Is Ydnar out riding his bike again? :slight_smile: j/k


(ydnar) #17

Is the alpha channel < 128?


(Gringo Starr) #18

No, because the same shader works when not on a model. :slight_smile:


(ydnar) #19

Try using 2.5.16, and for heaven’s sake, don’t use -filter :slight_smile:


(Gringo Starr) #20

Ok, will give it a shot. Maybe you should just nullify the -filter arg. :slight_smile: lol