Search Unity

[Issue] Curious Shader Compiler Error

Discussion in 'Shaders' started by Quatum1000, Nov 27, 2015.

  1. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Hi everyone,

    does anyone know why this simple shader produce an syntax error in the Properties section?
    Un-comment line // _AnyOtherTexture("Any Other Texture ", 2D) = "black" {}
    compile well.

    Did you have this issue also on this shader code?

    Untitled-1.png

    Code (CSharp):
    1. Shader "Custom/BugShader" {
    2.    Properties{
    3.      _MainTex("_MainTex", 2D) = "black" {}
    4.      _CubeInterior("Cube Interior", Cube) = ""
    5.      _CubeMapRef("Cube Map Ref World Reflection", Cube) = ""
    6.   //_AnyOtherTexture("Any Other Texture ", 2D) = "black" {}
    7.      _AnyIntensity("Any Intensity", Range(0, 1)) = 0
    8.    }
    9.    SubShader{
    10.        LOD 200
    11.        Tags{ "RenderType" = "Opaque" }
    12.        CGPROGRAM
    13.        #pragma surface surf StandardSpecular
    14.        #pragma target 3.0
    15.        sampler2D _MainTex;
    16.        sampler2D _AnyOtherTexture;
    17.        samplerCUBE _CubeInterior;
    18.        samplerCUBE _CubeMapRef;    
    19.        struct Input {
    20.          half2 uv_MainTex;
    21.          INTERNAL_DATA
    22.        };
    23.        void surf(Input IN, inout SurfaceOutputStandardSpecular o)
    24.        {
    25.        }
    26.        ENDCG
    27.    }
    28.    FallBack "Diffuse"
    29. }
     
    Last edited: Nov 27, 2015
  2. Alex-Lian

    Alex-Lian

    Guest

    What build of 5.3 ?
    Bug # report with submitted repro?
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,435
    same error with 5.2.1p3,
    but works if add {} after cubes

    Code (CSharp):
    1.          _CubeInterior("Cube Interior", Cube) = "" {}
    2.          _CubeMapRef("Cube Map Ref World Reflection", Cube) = "" {}
     
  4. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    (Case 747712)

    Thanks, but is this a bug or a fault by me missing the braces?
    Because the previous cube properties working without {}