mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
GLSL 'include' support
This commit is contained in:
parent
e6ecd558a9
commit
a60cc70246
20 changed files with 238 additions and 35 deletions
11
res/shaders/lib/commons.glsl
Normal file
11
res/shaders/lib/commons.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Example of a GLSL library
|
||||
|
||||
vec4 decompress_light(float compressed_light) {
|
||||
vec4 result;
|
||||
int compressed = floatBitsToInt(compressed_light);
|
||||
result.r = ((compressed >> 24) & 0xFF) / 255.f;
|
||||
result.g = ((compressed >> 16) & 0xFF) / 255.f;
|
||||
result.b = ((compressed >> 8) & 0xFF) / 255.f;
|
||||
result.a = (compressed & 0xFF) / 255.f;
|
||||
return result;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue