Selinux24 / Skirmish

Game and prototypes with SharpDX and Directx 11
MIT License
50 stars 4 forks source link

SPECULAR MAPS #64

Closed Selinux24 closed 7 years ago

Selinux24 commented 7 years ago

Add specular map to light calculations

Selinux24 commented 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; }

Selinux24 commented 7 years ago

Forward Renderer done! a3f5e38b07971fd32ab4ec1e9d36bf0d88dc4dfc

Next step, Deferred Renderer

Selinux24 commented 7 years ago

Almost done

d1240e7b4d6e712be865217a9484166f047f027d

Selinux24 commented 7 years ago

Won't do it now