Does Polyspatial plan to support "Blend zero" for AROcculusion?

In v1.1 document, it is written that Blend Alpha , Premultiply , and Additive blending modes are supported.
https://docs.unity3d.com/Packages/com.unity.polyspatial.visionos@1.1/manual/ShaderGraph.html

But we’d like to achieve AR occulusion.
We try to check the behaviour of “Blend zero”.
As a result, all of the mesh become black with shader using “Blend zero”

The shader code is below.

Shader "WriteDepth"
{
    SubShader
    {
        Tags
        {
            "RenderPipeline"="UniversalPipeline"
            "RenderType"="Opaque"
            "Queue"="Geometry-1"
        }

        Pass
        {
            Name "Pass"

            Cull Back
            Blend One Zero
            ZTest LEqual
            ZWrite On
            ColorMask 0

            HLSLPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #pragma prefer_hlslcc gles
            #pragma exclude_renderers d3d11_9x
            #pragma target 2.0

            #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
 
            struct Attributes
            {
                float4 positionOS : POSITION;
                UNITY_VERTEX_INPUT_INSTANCE_ID
            };
 
            struct Varyings
            {
                float4 positionCS               : SV_POSITION;
                float3 positionWS               : TEXCOORD0;
                UNITY_VERTEX_INPUT_INSTANCE_ID
                UNITY_VERTEX_OUTPUT_STEREO
            };
 
            Varyings vert (Attributes input)
            {
                Varyings output = (Varyings)0;
 
                UNITY_SETUP_INSTANCE_ID(input);
                UNITY_TRANSFER_INSTANCE_ID(input, output);
                UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
 
                VertexPositionInputs vertexInput = GetVertexPositionInputs(input.positionOS.xyz);
                output.positionCS = vertexInput.positionCS;
                output.positionWS = vertexInput.positionWS;
 
                return output;
            }
 
            half4 frag (Varyings input) : SV_Target
            {
                UNITY_SETUP_INSTANCE_ID(input);
                UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input);
 
                return half4(1, 1, 1, 1);
            }

            ENDHLSL
        }
    }
}

( Reference from: https://qiita.com/aa_debdeb/items/d39b0ea8cbfcdc464c02 )

So, my question is that does polyspatial plan to support Blend mode “zero” or other features which can achieve to AR Occulusion.

For Occlusion you should be able to use AR/Basic Occlusion shader and apply it to any object you want to occlude others. This can be used to create a portal-like effect (see Correct way to achieve Portal Effect - #6 by Lexokon)

1 Like

For shader graphs specifically (and note that we don’t support ShaderLab shaders, like the one you quoted, at all), we’re limited by the options provided by Apple’s ShaderGraphMaterial and its MaterialX support. There’s no “zero” blend mode there, but you should be able to achieve the same result by using the “Transparent” blend mode and supplying an Alpha value of 0.

However, as @DanMillerU3D says, the easiest way to do this by far is to use the AR/Basic Occlusion shader, which maps to Apple’s OcclusionMaterial. Using a shader graph would only be necessary if, for example, you need to modify the vertices in the shader.

@DanMillerU3D @kapolka
AR/Basic Occulusion works well !!
This is what I want !

Thank you for replying to my question :slight_smile:

1 Like