Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Feature/cubemap prefilter #143
Added cubemap filtering utility.
Added new properties to texture:
Removed hdr property from texture. Now texture can be considered HDR based on either format or rgbm property.
Filter utility syntax is:
options.filteredFixedRGBM will now contain mip levels as separate cubemaps. Those can be inserted into material.prefilteredCubemap* properties (which later might be concatenated together into a single mipmapped cubemap by engine depending on HW).
Source cubemap is better to be RGBA32F. It can be RGBM but then quality will suffer.
All options should be either null or empty array to be filled with cubemaps.
There are currently 2 filtering methods: simple and blinn-phong importance sampling. Difference is on the pic.
Simple is fast (can be done in-game), but may produce a bit "flat" specular highlights. Usually 256 samples is enough for it.
Importance sampled requires more samples, 4096 looks fine, and it takes 1-2 sec, but looks much closer to reference.