No announcement yet.

Depth test and translucent materials

  • Filter
  • Time
  • Show
Clear All
new posts

    Depth test and translucent materials

    I want to fade out a particular object on the level. At the begining is a solid object that just have a texture.

    I did a material which uses blend_tranlucent and the same diffuse texture. My plan was to start with the opacity at 1 so that it looks solid and slowly move the opacity value into 0. It sort of worked, the object fade out.

    However when using the translucent material even with opacity at 1, it doesn't look the same that a material that uses blend_opaque. It looks like with some kind of XRay where you see parts of the objects that should be occluded.

    The exact problem seems to be that Depth Test is disabled on the translucent material, so that the last polygon of the object is always visible without regarding if its occluded by some other part of the object. I hadn't found any way of enabling the depth test for that translucent material. There is a "disable depth test" option but I need the exact oppositive.

    I also tried using two materials, an opaque and a translucent, so that normally it uses the opaque one. Then, when fading, I switch to the translucent and fade out the opacity. However, the moment I do the switch, the polygons get occluded the wrong way and the switch is very apparent.

    Do you know a way of fixing that problem?

    The only thing that comes to mind immediately is to make sure that you don't have your material set to be 2 sided. It's one of the tick boxes in the material editor options.
    I'll try to find time to take a closer look and see if I can reproduce your problem.


      Thx for your answer, I finally solved it.

      It wasn't set for rendering 2 sides, however, I found an option in the material that was exactly what I needed ("Use Lit Translucency depth test"). I really don't know how I miss it so far!!!


        can u share ur material... i really need that... i tried i am having the same x-ray problem