-
Notifications
You must be signed in to change notification settings - Fork 132
LightStorage
Each Light is stored in the LightBuffer with 4 vec4's = 16 floats
The data layout is:
[V0.x] +0: Light Type
[V0.y] +1: IES Profile Index (or -1 for no profile)
[V0.z] +2: First Shadow Source index (or -1 for no shadows)
[V0.w] +3: Position.x
[V1.x] +4: Position.y
[V1.y] +5: Position.z
[V1.z] +6: Color.r
[V1.w] +7: Color.g
[V2.x] +8: Color.b
+9-15: [Any additional properties depending on the light type]
Null lights have a light type of 0, to indicate there is no light at that slot. They don't have any additional properties, too.
+0-8: [see above]
[V2.y] +9: Radius
[V2.z] +10: Inner Radius (For area PointLights)
+11-15: [unused]
+0-8: [see above]
[V2.y] +9: Radius
[V2.z] +10: FOV
[V2.w] +11: Direction.x
[V3.x] +12: Direction.y
[V3.y] +13: Direction.z
+14-15: [unused]
Each Shadow source is stored in the SourceBuffer with 5 vec4's = 20 floats
The data layout is:
[V0.x - V3.w] +0-16: View-Projection Matrix
[V4.x] +17: uv-coordinate x
[V4.y] +18: uv-coordinate y
[V4.z] +19: uv-coordinate width
[V4.w] +20: uv-coordinate height
Commands have the layout:
+0: [Command ID]
+1-31: [Command Data]
There are several command types:
Does nothing, gets just skipped
Stores a new light into the light data, command layout:
+0: [Command ID]
+1: [Light ID]
+2-31: [Light Data, see above]
The light id is used to figure where to write the light into the global lights storage buffer. This command basically just takes the Light Data, and writes it to the specified location.
This command just sets all of the light data to zeroes, so that the light gets a NullLight, and ignored. +0 [Command ID] +1: [Light ID] +2-31: [unused]
Stores a new shadow source into the shadow source data, command layout:
+0: [Command ID]
+1: [Light ID]
+2-31: [Source Data, see above]
This command sets all of the source data to zeroes, to indicate its not further used.
+0: [Command ID]
+1: [Source ID]
+2-31: [unused]
Rendering Pipeline by tobspr (c) 2014 - 2016
For developers: