[原]unity3d GLSL无法pc上显示

pc编写GLSL:

Shader "Custom/GLSL" {
    Properties {
        _MainTex ("Base (RGB)", 2D) = "white" {}
    }
    SubShader {
        Tags { "RenderType"="Opaque" }
        LOD 200
        pass{
            GLSLPROGRAM
            
                #ifdef VERTEX
                void main()
                {
                    gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
                }
                #endif
                
                #ifdef FRAGMENT
                void main()
                {
                    gl_FragColor = vec4(1,0,0,0);
                }
                #endif
                
            ENDGLSL
        }
    }
}

出现:shader has error or is not supported by your graphics card

需要通过这样的设置:(设置完后需要重启unity

 

 

重启后的效果:

 

posted @ 2014-09-12 11:08  U_探索  阅读(803)  评论(0编辑  收藏  举报