Texture2D texture1;
SamplerState Sampler;
struct PixelShaderInput
{
float4 position : SV_POSITION;
float3 normal : NORMAL;
float2 UV : UV;
float4 World_pos : World_pos;
};
struct S_L //Spotlight
{
float3 pos; // Position of the spotlight
float range; // Range of the spotlight
float3 dir; // Direction of the spotlight
float cone; // Cone angle of the spotlight
float3 att; // Attenuation of the spotlight (constant, linear, quadratic)
float pad2; // Padding for alignment
float4 ambient; // Ambient color of the spotlight
float4 diffuse; // Diffuse color of the spotlight
};
float4 main(PixelShaderInput input) : SV_TARGET
{
S_L LIGHT;
float4(abs(input.normal), 1.0f);
float4 sampling = texture1.Sample(Sampler, input.UV);
return sampling;
}
\$\begingroup\$
\$\endgroup\$
2
-
1\$\begingroup\$ What does this code do? How do current results differ from what you expect? In fact, what implementation details are you focusing on? \$\endgroup\$liggiorgio– liggiorgio2024-01-18 11:07:43 +00:00Commented Jan 18, 2024 at 11:07
-
\$\begingroup\$ i think i have figure it out. i need to implement a light source. \$\endgroup\$mueoc mueoc– mueoc mueoc2024-01-18 11:12:11 +00:00Commented Jan 18, 2024 at 11:12
Add a comment
|