Graphics: Move LightData to a shader module and add hotreload in debug
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
[nzsl_version("1.0")]
|
||||
module;
|
||||
|
||||
option MaxLightCount: u32 = u32(3); //< FIXME: Fix integral value types
|
||||
|
||||
[export]
|
||||
[layout(std140)]
|
||||
struct Light
|
||||
{
|
||||
type: i32,
|
||||
color: vec4[f32],
|
||||
factor: vec2[f32],
|
||||
parameter1: vec4[f32],
|
||||
parameter2: vec4[f32],
|
||||
parameter3: vec4[f32],
|
||||
hasShadowMapping: u32
|
||||
}
|
||||
|
||||
[export]
|
||||
[layout(std140)]
|
||||
struct LightData
|
||||
{
|
||||
lights: array[Light, MaxLightCount],
|
||||
lightCount: u32,
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
module;
|
||||
|
||||
import Engine/InstanceData;
|
||||
import Engine/LightData;
|
||||
import Engine/ViewerData;
|
||||
|
||||
// Basic material options
|
||||
@@ -15,8 +16,6 @@ option HasHeightTexture: bool = false;
|
||||
option HasNormalTexture: bool = false;
|
||||
option HasSpecularTexture: bool = false;
|
||||
|
||||
option MaxLightCount: u32 = u32(3); //< FIXME: Fix integral value types
|
||||
|
||||
// Billboard related options
|
||||
option Billboard: bool = false;
|
||||
option BillboardCenterLocation: i32 = -1;
|
||||
@@ -55,25 +54,6 @@ const DirectionalLight = 0;
|
||||
const PointLight = 1;
|
||||
const SpotLight = 2;
|
||||
|
||||
[layout(std140)]
|
||||
struct Light
|
||||
{
|
||||
type: i32,
|
||||
color: vec4[f32],
|
||||
factor: vec2[f32],
|
||||
parameter1: vec4[f32],
|
||||
parameter2: vec4[f32],
|
||||
parameter3: vec4[f32],
|
||||
hasShadowMapping: u32
|
||||
}
|
||||
|
||||
[layout(std140)]
|
||||
struct LightData
|
||||
{
|
||||
lights: array[Light, MaxLightCount],
|
||||
lightCount: u32,
|
||||
}
|
||||
|
||||
external
|
||||
{
|
||||
[binding(0)] settings: uniform[MaterialSettings],
|
||||
|
||||
Reference in New Issue
Block a user