How to create an hole/portal/Window effect in EasyAR & Unity3D?

0 votes
asked Mar 9, 2020 by alvaro (280 points)

Hi, i have found on YouTube many video-tutorials, that explain how to create a hole on a plan, but nothing for easyAR.

in this video, is used a depthMask Material, how to make it, in EasyAR & Unity3D?

thanks

1 Answer

0 votes
answered Mar 10, 2020 by alvaro (280 points)

solution:

create a material DepthMask and link it to the shader below:
CODE:

Shader "DepthMask" {
   
    SubShader {
        // Render the mask after regular geometry, but before masked geometry and
        // transparent things.
       
        Tags {"Queue" = "Geometry-10" }
       
        // Turn off lighting, because it's expensive and the thing is supposed to be
        // invisible anyway.
       
        Lighting Off

        // Draw into the depth buffer in the usual way.  This is probably the default,
        // but it doesn't hurt to be explicit.

        ZTest LEqual
        ZWrite On

        // Don't draw anything into the RGBA channels. This is an undocumented
        // argument to ColorMask which lets us avoid writing to anything except
        // the depth buffer.

        ColorMask 0

        // Do nothing specific in the pass:

        Pass {}
    }
}

i find the solution into a vuforia's materials pack

Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...