Formalize forward lighting contract

This commit is contained in:
2026-04-05 15:44:37 +08:00
parent f6da4d0eb6
commit 2c96f0d164
18 changed files with 152 additions and 90 deletions

View File

@@ -64,6 +64,9 @@ private:
Math::Matrix4x4 view = Math::Matrix4x4::Identity();
Math::Matrix4x4 model = Math::Matrix4x4::Identity();
Math::Matrix4x4 normalMatrix = Math::Matrix4x4::Identity();
};
struct LightingConstants {
Math::Vector4 mainLightDirectionAndIntensity = Math::Vector4::Zero();
Math::Vector4 mainLightColorAndFlags = Math::Vector4::Zero();
};
@@ -103,6 +106,7 @@ private:
std::vector<OwnedDescriptorSet> staticDescriptorSets;
PassResourceBindingLocation perObject = {};
PassResourceBindingLocation material = {};
PassResourceBindingLocation lighting = {};
PassResourceBindingLocation shadowReceiver = {};
PassResourceBindingLocation baseColorTexture = {};
PassResourceBindingLocation linearClampSampler = {};
@@ -200,6 +204,7 @@ private:
Core::uint64 objectId,
const Resources::Material* material,
const MaterialConstantPayloadView& materialConstants,
const LightingConstants& lightingConstants,
const ShadowReceiverConstants& shadowReceiverConstants,
RHI::RHIResourceView* baseColorTextureView,
RHI::RHIResourceView* shadowMapTextureView);