Per-channel reflectivity and opacity plus metallic reflection mode

Going against the project spec ever so slightly, I decided to make the material properties for reflectivity and opacity into vec3's. This gives more flexibility to the material system in that reflectivity and opacity can be controlled for each color component (RGB) individually. Having completed the change, I tried to use the new flexibility to create a metallic material, but had trouble getting the reflections to get tinted the way i wanted. As a test, I added a "metallic" flag to the material structure and had the raytracer give special treatment to such materials by converting the color gathered from reflection into grayscale (by RGB average) and multiplying with the diffuse color of the material. This is probably wildly inaccurate in a physical sense, but it actually seems to work pretty well so I decided to leave it in.

Without "metallic" flag

Using the "metallic" flag

Comments

Popular posts from this blog

Specular reflection and Phong shading/lighting