代码的实际部分是做什么?
//this partical >> SubProgram "opengl " { <<<
Keywords { "LIGHTMAP_ON" "DIRLIGHTMAP_ON" "HDR_LIGHT_PREPASS_OFF" }
Vector 0 [_Color]
SetTexture 0 [_MainTex] 2D 0
SetTexture 1 [_LightBuffer] 2D 1
SetTexture 2 [unity_Lightmap] 2D 2
"!!ARBfp1.0
PARAM c[2] = { program.local[0],
{ 8 } };
发布于 2017-01-13 21:48:58
子程序是一种为特定API提供特定着色器(片段着色器或顶点着色器)的方法。
因此,假设您有以下内容
SubShader
{
Pass
{
Tags { "RenderType"="Opaque" }
Program "vp"
{
SubProgram "opengl"
{
//Do something if we're rendering with OpenGL
}
SubProgram "gles"
{
//Do something if we're rendering with GLES
}
}
}
}
然后,您可以指定唯一的着色器给定您正在渲染的API,作为一个相同的“着色器”资源的一部分。
https://stackoverflow.com/questions/41619047
复制相似问题