0
結果を変更しない行を除き、ほぼすべてのコードを共有する2つのシェーダを作成しました。 それは、コードの共有部分です:HLSLシェーダが機能しない
struct VOut
{
float4 position : SV_POSITION;
float4 color : COLOR;
float4 ld1 : LD;
};
cbuffer LIGHT : register (cb0)
{
float4 light_direction;
float4 light_color;
};
cbuffer TRANSFORMATION_MATRIX : register (cb1)
{
float4x4 transformationMatrix;
};
cbuffer CAM_PROJ_MATRIX : register (cb2)
{
float4x4 cameraProjectionMatrix;
};
float4 PShader(float4 position : SV_POSITION, float4 color : COLOR) : SV_TARGET
{
return color;
}
頂点シェーダは変更部分:
VOut VShader(float3 position : POSITION, float4 color : COLOR)
{
VOut output;
float4 rpos = mul(transformationMatrix,float4(position, 1.0));
output.position = mul(cameraProjectionMatrix, rpos);
*output.ld1 = light_direction;*
output.color = color;
return output;
}
この1つは正常に動作しますが、私はアスタリスクの間に線を変更した場合(明らかにアスタリスクではありません実際のコードで)
私は画面上に何も表示されません。このことはどのように可能ですか?
'' LD''は標準的な意味ではありませんので意味がありません。有効な段間補間器を得るために '' TEXCOORD0''を使ってみてください。 –