-
Notifications
You must be signed in to change notification settings - Fork 132
LightStorage
tobspr edited this page Nov 24, 2015
·
22 revisions
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: Position.x
[V0.w] +3: Position.y
[V1.x] +4: Position.z
[V1.y] +5: Color.r
[V1.z] +6: Color.g
[V1.w] +7: Color.b
+8-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-7: [see above]
[V2.x] +8: Radius
[V2.y] +9: Inner Radius (For area PointLights)
+10-15: [unused]
+0-7: [see above]
[V2.x] +8: Radius
[V2.y] +9: Angle
[V2.z] +10: Direction.x
[V2.w] +11: Direction.y
[V3.x] +12: Direction.z
+13-15: [unused]
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-17: [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.
+0 [Command ID]
+1: [Light ID]
This command just sets all of the light data to zeroes, so that the light gets a NullLight, and ignored.
Rendering Pipeline by tobspr (c) 2014 - 2016
For developers: