Closed Selinux24 closed 7 years ago
Color Packing
float packColor(vec3 color) {
return color.r + color.g * 256.0 + color.b * 256.0 * 256.0;
}
vec3 unpackColor(float f) {
vec3 color;
color.b = floor(f / 256.0 / 256.0);
color.g = floor((f - color.b * 256.0 * 256.0) / 256.0);
color.r = floor(f - color.b * 256.0 * 256.0 - color.g * 256.0);
// now we have a vec3 with the 3 components in range [0..255]. Let's normalize it!
return color / 255.0;
}
Forward Renderer done! a3f5e38b07971fd32ab4ec1e9d36bf0d88dc4dfc
Next step, Deferred Renderer
Almost done
d1240e7b4d6e712be865217a9484166f047f027d
Won't do it now
Add specular map to light calculations