Jump to content
vblack

Transparency rendering

Recommended Posts

I'm trying to create a shader with transparency (like a glass). I set the Material in Alpha (I would expect more type like, choosing Dest and Src Blend), but I notice that the objects behind the transparent door are red, and sort is not correct.

How to achieve the correct effect ? Is that supported ? Also I need more mode like premultiplied alpha or additive etc..

 

_Glass.mat

diffuse+normal+alpha.shader

Share this post


Link to post

There is already a glass material provided. :)

See Materials\Effects\glass.mat

Share this post


Link to post

Yes I'm using it in fact (attached), but it doesn't do what I want. I have 'Diffuse' the texture with alpha, also I want to use the texture4 for using for reflection. Also the one used doesn't work with double sided.

I set

Blend-mode: Alpha
Two sided
Depth Test
Depth Mask (OFF), assuming the transparent are rendered after the opaque geometry.

Here the screenshot : The objet behind looks 'red'

Untitled-1.jpg

Share this post


Link to post

The default glass material looks correct to me.  What are you changing that makes it behave like that?  You might have to write a new shader if you are doing something different from what the refraction glass material provides.

Share this post


Link to post

apparently the objects which have environment mapping are 'red' under transparency

Here better version :

close.jpg

open.jpg

Share this post


Link to post

Thanks, again, it affects mainly the object using environment mapping. It looks that the rendering is doing some multiple passes, and this transparent material is in the 'wrong' pass (should be rendered just before the post processing).

Share this post


Link to post

If you load this map you can see transparency working correctly with probes, with both a model and a brush painted with the glass material.

If you modified your glass material, you may need to restore it with the attached one.

If you still have problems please tell me your graphics card and operating system.

probes.map

screenshot16.jpg

glass.mat

Share this post


Link to post

Does the same. In fact, it works in editor mode, but when I switch to game mode, it get red.

I will ask our artist to prepare a project with the issue, it will be simpler (Tested on nVidia GT 770, does the same on GT 900).

EDIT: For me, it is a problem with deferred rendering engine and transparency, and what I'm seeing 'red' is one of the G Buffer, I know that transparency and deferred can be tricky something, maybe it is an edge case ?

Share this post


Link to post

Reopening this topic. The transparency works now on 4.4 version, however, light probes are not. If I disable the blending mode, it works, else, I lose it. If I use the 'Light' blendmode, the objects appears red

Here 3 screenshots with a simple scene with light probe

- Alpha Blend Enabled
- Light Blend Enabled (objects behind appears red)
- No Alpha

I'm trying to achieve a material used for glass panel with reflections from the Light probe.

 

alpha-enabled.png

light-enabled.png

no-alpha.png

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...