Pixel-Composer/datafiles/Shaders/3dInstance/3dInstancePS.hlsl

21 lines
483 B
HLSL
Raw Normal View History

2023-10-28 10:53:11 +02:00
#include "CommonPS.hlsl"
2023-10-28 13:31:13 +02:00
struct VS_out {
2023-10-28 10:53:11 +02:00
float4 Position : SV_POSITION;
float3 Normal : NORMAL0;
float4 Color : COLOR0;
float2 TexCoord : TEXCOORD0;
};
2023-10-28 13:31:13 +02:00
struct PS_out {
2023-10-28 10:53:11 +02:00
float4 Color : SV_Target0;
};
2023-10-28 13:31:13 +02:00
void main(in VS_out IN, out PS_out OUT) {
2023-10-28 10:53:11 +02:00
OUT.Color = gm_BaseTextureObject.Sample(gm_BaseTexture, IN.TexCoord);
float3 N = normalize(IN.Normal);
2023-10-28 13:31:13 +02:00
float3 L = normalize(float3(1.0, 1.0, 2.0));
2023-10-28 10:53:11 +02:00
float NdotL = saturate(dot(N, L));
OUT.Color.rgb *= lerp(0.2, 1.0, NdotL);
}