UNITY_REQUIRE_ADVANCED_BLEND(all_equations) Not working

Unity manual

i don’t know how to use OpenGL Advanced Blending functions.
even UNITY_REQUIRE_ADVANCED_BLEND seems not working on gles 3.0 on unity 2020.2.0

does anyone knows how to use OpenGL Advanced Blending? please help me!

What happens if you remove this “UNITY_REQUIRE_ADVANCED_BLEND” line?

First of all, Thank you for your reply!

It works without any error message. I’ve using Unity with URP.
I insert blendOp in my shader like below without “UNITY_REQUIRE_ADVANCED_BLEND”

Shader "MyShader"
{
    Properties
    {
        [NoScaleOffset] _MainTex("_MainTex", 2D) = "white" {}
        _Color("_Color", Color) = (1, 1, 1, 1)
        _OpSelection("OpSelection", Float) = 21 // As manual, '21' refers 'Multiply' Option
    }
 
    SubShader
    {
        Tags
        {
            "RenderPipeline" = "UniversalPipeline"
            "RenderType" = "Transparent"
            "UniversalMaterialType" = "Unlit"
            "Queue" = "Transparent"
        }

        Pass
        {
            Name "Pass"

            // Render State
            Cull Back
            BlendOp [_OpSelection] // Here! I insert this line!
            Blend SrcAlpha OneMinusSrcAlpha
            ZTest LEqual
            ZWrite Off

            HLSLPROGRAM
            ... my custom shaders ...
            ENDHLSL
        }
    }
}

Is it okay to ignore caveat from manual?

According to manual, It said that

“the shaders that are used with the advanced blend operations must have a UNITY_REQUIRE_ADVANDED_BLEND(mode) declaration in the shader code where mode is one of the blend operations or “all_equations” for supporting all advanced blend operations”

I suppose the manual entry is a bit outdated :slight_smile:

Thank you! I can now continue my work.