Alpha Issue In User Diffened Material

alex_dergian

02-09-2006 11:53:52

I finaly found a way to get the custom materials to load however the convection use of the keyword Alpha is only accessed once in the programm? So it only paints one material on top of the base.

Here is my material code thinking the issue might be in there.

material kazular_fort_inland
{
receive_shadows on

technique
{
// base pass
pass
{
// no lighting
lighting off

texture_unit
{
// We use the grass texture as the base. other textures are blended over it
texture grass_lush.dds
// Scale the texture so, that it looks nice
scale 0.1 0.1
// Only blend colour
//colour_op_ex source1 src_texture src_texture
}
}

// dirt pass
pass
{
// no lighting
lighting off

// blend with former pass
scene_blend alpha_blend

// only overwrite fragments with the same depth
depth_func equal

// alpha map for the dirt
texture_unit
{
texture Alpha

alpha_op_ex source1 src_texture src_texture
// and colour from last pass
colour_op_ex source2 src_texture src_texture
}

// detail texture
texture_unit
{
texture defalt.dds
scale 0.15 0.15
// alpha blend colour with colour from last pass
colour_op_ex blend_diffuse_alpha src_texture src_current
}
}

// ground pass
pass
{
// no lighting
lighting off

// blend with former pass
scene_blend alpha_blend

// only overwrite fragments with the same depth
depth_func equal

// alpha map for the ground
texture_unit
{
texture Alpha

alpha_op_ex source1 src_texture src_texture
// and colour from last pass
colour_op_ex source2 src_texture src_texture
}

// detail texture
texture_unit
{
texture ground_root_moss.dds
scale 0.15 0.15
// alpha blend colour with colour from last pass
colour_op_ex blend_diffuse_alpha src_texture src_current
}
}

// lighting pass
pass
{
ambient 0.5 0.5 0.5 1
diffuse 0.3 0.3 0.3


depth_func equal
scene_blend zero src_colour
}
}

}

tuan kuranes

05-09-2006 08:31:34

It should replace all Alpha keywords, in order it does see it.
First alpha in techniqua would be Alpha.order.X.Z.
Make sure you do have all alpha files needed (check inside plsm2.log)

PatrickB3

05-09-2006 21:22:10

Actually I had a simular problem with Coverage. It replaced them all with _coverage_0.x.z and I think alpha too. I haven't tried again in a while though as I'm using Falagard's shader which only has one pass that uses those.

alex_dergian

25-09-2006 13:15:13

Well as the code goes i must be doing somthing wrong cause it is only loading one alpha cord and then using it for every pass, so how do i get it to load alpha.1.x.z.png since it loads the alpha.0.x.z.png? Confusing i do think it is not trying to load any other of the alpha textures this list was in the log file as you can see it only load one alpha but still all the textures, the met script up top is same except i tryed to do another pass. 05:09:38: D3D9 : Loading 2D Texture, image name : 'defalt.dds' with 2147483647 mip map levels
05:09:38: Texture: test.Alpha.0.1.1.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
05:09:38: D3D9 : Loading 2D Texture, image name : 'grass_jungel.dds' with 2147483647 mip map levels
05:09:38: D3D9 : Loading 2D Texture, image name : 'rock_dry.dds' with 2147483647 mip map levels
05:09:38: D3D9 : Loading 2D Texture, image name : 'ground_dirt.dds' with 2147483647 mip map levels
05:09:39: Texture: test.Alpha.0.1.0.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
05:09:39: Texture: test.Alpha.0.0.1.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.
05:09:39: Texture: test.Alpha.0.0.0.png: Loading 1 faces(PF_A8B8G8R8,512x512x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,512x512x1.

tuan kuranes

03-10-2006 16:18:23

Fixed in cvs.