现在的位置: 首页 > 综合 > 正文

effect编译时通过uniform函数变量判断条件

2018年05月27日 ⁄ 综合 ⁄ 共 551字 ⁄ 字号 评论关闭

There is nothing that limits us to one parameter. 

We will need to combine shadow quality, textures, and the number of lights all together so the vertex and pixel shaders would look like the following: 

VertexOut VS(VertexOut pin, uniform int gLightCount) {} 

float4 PS(VertexOut pin, uniform int gQuality, uniform bool gApplyTexture) : SV_Target {}

 So for example, to create a technique that uses low quality shadows, two lights, and no textures, we would write: 

technique11 LowShadowsTwoLightsNoTextures

 { 

pass P0 { 

SetVertexShader(CompileShader(vs_5_0, VS(2))); 

SetPixelShader(CompileShader(ps_5_0, PS(LowQuality, false)));

}

 }

抱歉!评论已关闭.