Skip to content

LightStorage

tobspr edited this page Nov 24, 2015 · 22 revisions

LightStorage

Each Light is stored in the LightBuffer with 4 vec4's = 16 floats

The data layout is:

+0: Light Type
+1: IES Profile Index (or -1 for no profile)
+2: Position.x
+3: Position.y
+4: Position.z
+5: Color.r
+6: Color.g
+7: Color.b
[Any additional properties depending on the light type]

For PointLights, the data layout is:

+0-7: [see above]
+8: Radius
+9: Inner Radius (For area PointLights)
+10-15: [unused]

For SpotLights, the data layout is: +0-7: [see above] +8: Radius +9: Angle +10: Direction.x +11: Direction.y +12: Direction.z

GPU Commands:

Commands have the layout:

+0: [Command ID]
+1-31: [Command Data]

There are several command types:

CMD_INVALID

    Does nothing, gets just skipped


CMD_STORE_LIGHT

    Stores a new light into the light data, command layout: