From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/Camera/LightTypes.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Runtime/Camera/LightTypes.h (limited to 'Runtime/Camera/LightTypes.h') diff --git a/Runtime/Camera/LightTypes.h b/Runtime/Camera/LightTypes.h new file mode 100644 index 0000000..189236d --- /dev/null +++ b/Runtime/Camera/LightTypes.h @@ -0,0 +1,28 @@ +#pragma once + +struct ActiveLight; + +struct ForwardLightsBlock +{ + float sh[9][3]; + const ActiveLight* mainLight; + int addLightCount; + int vertexLightCount; + float lastAddLightBlend; + float lastVertexLightBlend; + // followed by ActiveLight pointers; additive lights first, then vertex lights + + const ActiveLight* const* GetLights() const { + return reinterpret_cast( reinterpret_cast(this) + sizeof(ForwardLightsBlock) ); + } +}; + +struct VertexLightsBlock +{ + int lightCount; + // followed by ActiveLight pointers + + const ActiveLight* const* GetLights() const { + return reinterpret_cast( reinterpret_cast(this) + sizeof(VertexLightsBlock) ); + } +}; -- cgit v1.1-26-g67d0