首页 > 代码库 > [原]unity3d GLSL无法pc上显示
[原]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)
重启后的效果:
[原]unity3d GLSL无法pc上显示