Code: Select all
if (!b->Material.Texture2){
// replaced this line...
//b->Material.MaterialType = video::EMT_SOLID;
// with this line:
b->Material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF;
}
Now there's a new problem. The mountains in the background seem to occlude the leaf textures in the foreground. This didn't happen before I changed everybody's material type. Turning off the back face culling doesn't seem to be the problem. I tried turning it back on and the problem persisted.
Here's a screen shot of the scene before I changed the MaterialType:
Here's the same scene with everybody's material type changed to video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF:
Notice how the brown mountains are now occludig the tree leaves.
I'm using version 0.10.0. This occlusion problem didn't happen in 0.9, when I was using ZDimitor's patch (link) for transparency.
Any idea why this could be happening? Any suggestions on what I could try to narrow down source of the problem would be appreciated.
Thanks,
-- Matt