首页>
知识库>
详情

[D3D]HLSL中如何在cpp中给uniform变量赋值?

2020-07-27 来源:CloudBest 阅读量: 0
关键词:

    例如这样一段shader脚本:
    PS_OUTPUT RenderScenePS( VS_OUTPUT In,
uniform bool bTexture )
{
PS_OUTPUT Output;// Lookup mesh texture and modulate it with diffuse
if( bTexture )
Output.RGBColor = tex2D(MeshTextureSampler, In.TextureUV) * In.Diffuse;
else
Output.RGBColor = In.Diffuse;return Output;
}
    请问如何在cpp中给 bTexture 赋值?