From 175c72557b21f356e295a6f8a4acd91b7e744bef Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Fri, 24 Oct 2025 15:40:40 -0700 Subject: Consolidate LLR into a single file. --- src/llr/llr_impl.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/llr/llr_impl.h') diff --git a/src/llr/llr_impl.h b/src/llr/llr_impl.h index 3f6a68f..6318ee0 100644 --- a/src/llr/llr_impl.h +++ b/src/llr/llr_impl.h @@ -3,6 +3,8 @@ #include #include +#include "scene/types.h" + #include #include @@ -17,6 +19,35 @@ typedef struct Material Material; typedef struct ShaderProgram ShaderProgram; typedef struct Texture Texture; +/// An environment light. +typedef struct EnvironmentLight { + const Texture* environment_map; + const Texture* irradiance_map; // Renderer implementation. + const Texture* prefiltered_environment_map; // Renderer implementation. + int max_reflection_lod; // Mandatory when prefiltered_environment_map is + // given. +} EnvironmentLight; + +/// A scene light. +typedef struct Light { + LightType type; + union { + EnvironmentLight environment; + }; + node_idx parent; // Parent SceneNode. +} Light; + +typedef struct Material { + ShaderUniform uniforms[GFX_MAX_UNIFORMS_PER_MATERIAL]; + int num_uniforms; +} Material; + +typedef struct Mesh { + const Geometry* geometry; + const Material* material; + ShaderProgram* shader; // TODO: Move this back to Material? +} Mesh; + /// Immediate mode renderer. /// /// The renderer caches state changes in memory and only programs the underlying -- cgit v1.2.3