diff --git a/Includes.hlsli b/Includes.hlsli index e5002e5..d27c845 100644 --- a/Includes.hlsli +++ b/Includes.hlsli @@ -1,6 +1,27 @@ #ifndef __SHADER_INCLUDES__ #define __SHADER_INCLUDES__ +#define LIGHT_TYPE_DIRECTIONAL 0 +#define LIGHT_TYPE_POINT 1 +#define LIGHT_TYPE_SPOT 2 + +#define MAX_SPECULAR_EXPONENT 256.0f + +struct Light +{ + int Type; + float3 Direction; + + float Range; + float3 Position; + + float Intensity; + float3 Color; + + float SpotFalloff; + float3 Padding; +}; + // Struct representing the data we expect to receive from earlier pipeline stages // - Should match the output of our corresponding vertex shader // - The name of the struct itself is unimportant diff --git a/Lights.h b/Lights.h index b3085ed..546f6f6 100644 --- a/Lights.h +++ b/Lights.h @@ -1,8 +1,10 @@ #pragma once + +#include + #define LIGHT_TYPE_DIRECTIONAL 0 #define LIGHT_TYPE_POINT 1 #define LIGHT_TYPE_SPOT 2 -#include struct Light { diff --git a/SimplePixelShader.hlsl b/SimplePixelShader.hlsl index a85c019..8a34fb8 100644 --- a/SimplePixelShader.hlsl +++ b/SimplePixelShader.hlsl @@ -5,10 +5,11 @@ cbuffer ExternalData : register(b0) float3 cameraPosition; float roughness; float3 ambient; + Light directionalLight1; } float4 main(VertexToPixel input) : SV_TARGET { input.normal = normalize(input.normal); - return float4(input.normal, 1); + return float4(directionalLight1.Color, 1); }