LEARN // EFFECTS
What is six-way lighting
Six-way lighting stores how smoke looks when lit from the right, left, top, bottom, front and back, packed into the color channels of two textures. Your shader blends those six images by the direction of your scene's light, so a precomputed smoke flipbook brightens on the sunny side and darkens on the shadow side as the light moves.
- Godot 4 Available
- Unity Manual setup
- Unreal Engine Manual setup
- Roblox Studio Manual setup
- three.js Available
A draft compile is from $0.05, and new accounts start with $5 of usage.
01 // HOW IT WORKS
Six lightmaps in two RGBA textures
A plain smoke flipbook has its lighting painted in, so it looks wrong the moment your sun moves. Six-way lighting renders the smoke once per light direction and keeps only the brightness of each. Six grayscale images fit in the red, green and blue channels of two textures, and the two alpha channels hold opacity and one extra value.
At runtime the shader takes the light direction in the particle's own space and weights the right or left map by its sideways part, the top or bottom map by its vertical part, and the front or back map by its depth part, then adds them. Ambient light uses the same maps, so the smoke picks up a sky tint too.
02 // IN YOUR SCENE
What changes on screen
- Smoke from a burning building looks thick and rounded, with a bright rim toward the sun.
- A day and night cycle relights the same plume without a second compile.
- The cost is two texture reads per pixel instead of one, plus a few multiplies.
- For a manual engine setup, use a material that blends the six channels by the direction of the scene light.
03 // REAL OUTPUT
Two smoke compiles with six-way lighting
The smoke plume is a 4 s loop that leans with the wind, and the smoke column a 6 s one-shot that climbs and thins.
04 // SPATIAL COMPILER
Relit smoke in Godot 4 today
Every compile stores six-way lighting by default. main_pos.png holds light from the right, from above and from behind in red, green and blue, with opacity in alpha. main_neg.png holds light from the left, from below and from the front, with flame brightness in alpha. In Godot 4 the scene your agent writes relights the smoke from your DirectionalLight3D and ambient light. See the six-way channels.
How does six way lighting improve flipbook smoke?
It lets precomputed smoke react to scene lights by blending lit and shadow sides as the sun moves, making flat quads look volumetric.
How should transparency be stored in a six way lightmap?
Store straight opacity in the alpha channel of one texture, such as the alpha channel of main_pos.png in Spatial Compiler outputs.
Why are two RGBA textures commonly used for six way lighting?
Six grayscale lightmaps need six color channels, so two RGBA textures provide those six channels plus two alpha channels for opacity and extra data.
Which texture channels store the six lighting directions?
Right, top and back usually sit in the RGB channels of one texture, while left, bottom and front sit in the second, like main_pos.png and main_neg.png.
Does Unity support six way lighting?
Yes, a custom or shader graph material in Unity can blend the six smoke channels using the scene light direction.
Compile your first effect
You pay per compile and see the price before it runs. New accounts start with $5 of usage.