0
\$\begingroup\$
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;
    
}
\$\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\$ Commented Jan 18, 2024 at 11:07
  • \$\begingroup\$ i think i have figure it out. i need to implement a light source. \$\endgroup\$ Commented Jan 18, 2024 at 11:12

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.