Flywheel/docs/shader-api/common.glsl
Jozufozu 3692dbdf3c Ayo!
- Calculate AO in flw_light
- Pack block light, sky light, and valid block count into a single uint
  when reading the 3x3x3 light volume for a fragment. This saves a
  significant amount of memory and integer additions in the shader, but
  does require slightly more alu ops overall for the packing/unpacking
- Add pragma optionNV (unroll all) for significant perf boost, may want
  to manually unroll to be cross-platform
- Remove redundant flw_light
2024-08-01 11:12:47 -07:00

8 lines
337 B
GLSL

/// Get the light at the given world position.
/// This may be interpolated for smooth lighting.
bool flw_light(vec3 worldPos, vec3 normal, out vec3 light);
/// Fetches the light value at the given block position.
/// Returns false if the light for the given block is not available.
bool flw_lightFetch(ivec3 blockPos, out vec2 light);