I want to share a little idea, that I got today. It’s about making your objects transparent without using Translucency mode. I don’t know, if somebody has already posted it, I want to share it aswell.
So, the trick is really really simple.
- First of all, you have to set your material blend mode to Masked
- Next you need to call Checker node and connect it to Opacity Mask pin.
- In order to make material masking by screenspace (we do not need to use model’s UV here), you must connect ScreenPosition node to UV parameter of Checker node.
- The last thing is to make checker node mask half of all pixels. It can be done by connecting ScreenResolution (Buffer) to Tile parameter.
Here is a result and material graph:
Advantages and disadvantages:
[table=“width: 700, class: grid, align: left”]
- Can have any translucent value
- Can only have 0%, 50% or 100%.
But actually you can somehow mask more or less 50%, so you will have other values
- Have many shading and lighting parameters you can choose from to make the look you want.
- Support all the stuff from Opaque. Correctly recieving shadows.
- Does not cast shadows.
Cast shadows. Moreover shadows will be 50% transparent.
Works correct with all AA methods.
Work better on FXAA and without motion blur.
You should change material in order to make your opaque mesh transparent.
- You do not need to change material, just activate it by using parameter. It’s very helpful. for example, when player can move stuff around and it has to be transparent while doing so.
- Is not rendered in ZDepth.
- Rendered with depth, wich means you can find your mesh by using SceneDepth in PostProcess. Note, that it renders in scene depth also with transparency
There are more disadvanteges ofcourse, like refraction or SceneTexture, but I hope someone will find the use of this technique.
For example, I’m going to use it in my strategy game. When player move objects or constructions, they must have collision disabled and be transparent. By using this I won’t need to create another translucent material, I’ll just set translusent parameter.