1

I'm trying to find any example of tessellation on web, but no luck.

The shader I tried to implement is this:

Shader "Custom/BzKovSoft/RollProgressedTest"
{
    Properties
    {
        _Color ("Color", Color) = (1,1,1,1)
        _MainTex ("Albedo (RGB)", 2D) = "white" {}

        _Tess ("Tessellation", Range(1,32)) = 4
    }
    SubShader
    {
        Tags { "RenderType" = "Opaque" }

        CGPROGRAM
        #pragma surface surf Lambert addshadow vertex:vert tessellate:tessFixed
        //#pragma target 4.6
        #pragma require tessellation tesshw
        
        #include "UnityCG.cginc"
        

        sampler2D _MainTex;
        float4 _Color;

        float _Tess;

        struct Input {
            float2 uv_MainTex;
        };

        float4 tessFixed()
        {
            return _Tess;
        }
        
        void vert(inout appdata_full v)
        {
            // ...
        }

        void surf (Input IN, inout SurfaceOutput o) {
            float4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
        
            o.Albedo = 1-c;
        }

        ENDCG
    }
    //Fallback "Diffuse"
}

But it do not work on mobile. If you remove tessellation, it will work.

Could you please share an example of such a shader or say what is wrong with mine?

Thank you very match!

Stas BZ
  • 1,184
  • 1
  • 17
  • 36

0 Answers0