-
In Malt, is there a way to intentionally swap the order in which objects are drawn? I have eyes embedded in a face object. Please help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Transparency in Malt is handled in a different (more precise) way than EEVEE, so it's not possible to use the same technique. You can, however, change the pixel depth (gl_FragDepth) to get the same effect. vec4 depth_offset(vec4 color, float depth_offset)
{
#if defined(PIXEL_SHADER) && !defined(SHADOW_PASS)
{
vec3 offset_position = POSITION - view_direction() * depth_offset;
float projected_depth = project_point(PROJECTION * CAMERA, offset_position).z;
float far = gl_DepthRange.far;
float near = gl_DepthRange.near;
gl_FragDepth = (((far-near) * projected_depth) + near + far) / 2.0;
}
#endif
return color;
} |
Beta Was this translation helpful? Give feedback.
Transparency in Malt is handled in a different (more precise) way than EEVEE, so it's not possible to use the same technique.
You can, however, change the pixel depth (gl_FragDepth) to get the same effect.
I want to add a Depth Offset option to the PixelOutput, but for now you can add this node to your Shader Library: