Skip to main content
Bumped by Community user
Cleanup
Source Link
DMGregory
  • 141k
  • 23
  • 258
  • 401

Multi pass Surface Syntax error in multi- erro syntaxpass Surface Shader

I'm trying to make a Surface Shader that uses multiple pass usingpasses, with two [blending]different blending functions for each one, but he accuses in one place, there is nothing,I get the following error I don't understand why:

Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 28

Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 28

    SubShader
{
    ZWrite Off
    Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "PreviewType"="Plane" }
    Pass
    {
        //transparency
        Blend SrcAlpha One
        CGPROGRAM
            #pragma surface surf Lambert 
            #pragma target 3.0
            struct Input
            {
                //
            };
            sampler2D //;
            void surf (Input IN, inout SurfaceOutput o)
            {
                //
            }
        }
     ENDCG
    }
    Pass
    {
         //alphabend
        Blend SrcAlpha OneMinusSrcAlpha
        CGPROGRAM
        #pragma surface surf Lambert
        #pragma target 3.0
 
         sampler2D//;
         fixed4 //;
 
         struct Input 
         {
          //;
         };
         void surf(Input IN, inout SurfaceOutput o)
         {
         //
         }
        ENDCG
    }
}

Multi pass Surface - erro syntax

I'm trying to make a multiple pass using two [blending] for each one, but he accuses in one place, there is nothing, I don't understand why

Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 28

    SubShader
{
    ZWrite Off
    Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "PreviewType"="Plane" }
    Pass
    {
        //transparency
        Blend SrcAlpha One
        CGPROGRAM
            #pragma surface surf Lambert 
            #pragma target 3.0
            struct Input
            {
                //
            };
            sampler2D //;
            void surf (Input IN, inout SurfaceOutput o)
            {
                //
            }
        }
     ENDCG
    }
    Pass
    {
         //alphabend
        Blend SrcAlpha OneMinusSrcAlpha
        CGPROGRAM
        #pragma surface surf Lambert
        #pragma target 3.0
 
         sampler2D//;
         fixed4 //;
 
         struct Input 
         {
          //;
         };
         void surf(Input IN, inout SurfaceOutput o)
         {
         //
         }
        ENDCG
    }
}

Syntax error in multi-pass Surface Shader

I'm trying to make a Surface Shader that uses multiple passes, with two different blending functions for each one, but I get the following error I don't understand:

Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 28

SubShader
{
    ZWrite Off
    Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "PreviewType"="Plane" }
    Pass
    {
        //transparency
        Blend SrcAlpha One
        CGPROGRAM
            #pragma surface surf Lambert 
            #pragma target 3.0
            struct Input
            {
                //
            };
            sampler2D //;
            void surf (Input IN, inout SurfaceOutput o)
            {
                //
            }
        }
     ENDCG
    }
    Pass
    {
         //alphabend
        Blend SrcAlpha OneMinusSrcAlpha
        CGPROGRAM
        #pragma surface surf Lambert
        #pragma target 3.0
 
         sampler2D//;
         fixed4 //;
 
         struct Input 
         {
          //;
         };
         void surf(Input IN, inout SurfaceOutput o)
         {
         //
         }
        ENDCG
    }
}
Bumped by Community user
Bumped by Community user
Source Link
Nitecki
  • 21
  • 1
  • 7

Multi pass Surface - erro syntax

I'm trying to make a multiple pass using two [blending] for each one, but he accuses in one place, there is nothing, I don't understand why

Parse error: syntax error, unexpected TOK_PASS, expecting TOK_SETTEXTURE or '}' at line 28

    SubShader
{
    ZWrite Off
    Tags { "QUEUE"="Transparent" "IGNOREPROJECTOR"="true" "RenderType"="Transparent" "PreviewType"="Plane" }
    Pass
    {
        //transparency
        Blend SrcAlpha One
        CGPROGRAM
            #pragma surface surf Lambert 
            #pragma target 3.0
            struct Input
            {
                //
            };
            sampler2D //;
            void surf (Input IN, inout SurfaceOutput o)
            {
                //
            }
        }
     ENDCG
    }
    Pass
    {
         //alphabend
        Blend SrcAlpha OneMinusSrcAlpha
        CGPROGRAM
        #pragma surface surf Lambert
        #pragma target 3.0
 
         sampler2D//;
         fixed4 //;
 
         struct Input 
         {
          //;
         };
         void surf(Input IN, inout SurfaceOutput o)
         {
         //
         }
        ENDCG
    }
}