I'm not sure if this is where I should post this, but, I'm working on an indie-styled map with cartoon textures, grass, trees, sun, etc.
I'm trying to retexture the default grass patch to look like dead grass / a dead bush, and instead of transparency behind the doodle, it's just black, so it looks very blotchy.
The image is a 512x512 .png image, and I made a new .material with the grass's code, but I'm not sure what else to do for this, and if there's a different material code to use. I tried looking around the site, but could only find things about preset transparency. Help?
Code I used looks like this:
material Edeadbush
{
transparency_casts_shadows off
receive_shadows off
technique
{
pass
{
diffuse 0.05 0.05 0.05 1
cull_hardware none
cull_software none
alpha_rejection greater_equal 128
texture_unit
{
texture deadbush.png
}
}
}
}
See, that's with presets so I'm not 100% sure it'll work?
I haven't been retexturing for that long, so I'm not too sure.
I know exactly what you're going through~ I posted a help thread for this very thing.
Here's the reply I got that helped immediately<3
I believe you have to add the line "alpha_rejection greater_equal 128" over the texture_unit line so that the code is more like this:
material whbl3
{
technique
{
pass
{
alpha_rejection greater_equal 128
texture_unit
{
texture 9cdc8b28_D.tga
filtering trilinear
}
}
}
}
If that doesn't work, I'd try changing the image file to a .png and then trying it. Hopefully this helps!
In the code you provided, there are a few 'enter' spaces or blank lines between the "alpha_rejection" line and the "texture_unit" line.
Ah thank you, turns out it was just a faulty image though! All the others worked perfectly fine with this code, except for the dead bush I was using.