Skip to content

swapping drawing order #147

Answered by pragma37
POPREQ asked this question in Q&A
Oct 12, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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:

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 =

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@POPREQ
Comment options

Answer selected by POPREQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants