0
我有以下的CG像素着色器:當我沒有訪問我的紋理之一,出現在其他紋理查找黑
float4 main(
float2 texCoord : TEXCOORD0,
float4 position : TEXCOORD2,
float4 color : COLOR,
uniform sampler2D texture_sample : TEX1,
uniform sampler2D stipple_sample : TEX2,
uniform float camera_target_distance) : COLOR
{
float4 OUT;
float2 vpos= position.xy/position.w;
if (tex2D(stipple_sample, vpos).x > 0.5f)
{
discard;
}
OUT= tex2D(texture_sample, texCoord) * color;
return OUT;
}
但是,如果我註釋掉/移除丟棄,或第一tex2D使用stipple_sample(和丟棄)訪問,我對texture_sample的紋理查找總是產生黑色而不是紅色/黃色。