Using boolean vector instead of "if ( expression && expression )".
This helps for hard shadows code path. There are still some problems with soft shadows code path, which still don't want to compile.
This exists also in Blender, useful for when you want to add shadows independent of lighting (it's cheaper to turn off SpotLight than to have it with 0 intensity).
Work in progress. For the moment works just with CTMLoader. Still not sure where some pieces of code would go.
Upsides:
- initialization time cut down significantly (1.8 seconds => 0.7 seconds for CTM example)
- much smaller GL buffers thanks to fully used indexing (Walt has 6x less vertices)
- consequently much smaller memory footprint all around, both for main and GPU memories,
which means less swapping and better vertex caching
Downsides:
- can't have anymore sharp per-face effects like flat shading (at least if mesh is not constructed in a way where each face has own vertices)
- can't have multiple materials per mesh
- no more easy manipulation of anything (for the moment actually no runtime manipulation at all, typed arrays are just thrown away, dynamic geometries code path not yet implemented)
Doing normalization of normals / binormals / tangents in fragment shader instead of vertex shader. This seems to help with artefacts appearing in certain models with OpenGL rendering backend.
Also added modulating environment reflection by specular map.
Turns out it may be useful after all, seems some GPUs may have troubles dealing with texture coordinates outside of <0,1> (need to be tested if normalization helps there).
This is optional, for now by default it's off, like it was before. It's up to application to update geometry bounding sphere if vertex positions change (like for meshes).
This should allow attaching of lights to objects. As a side effect, directional lights positions don't need to be normalized explicitly anymore.
Also changed viewport dimensions passed to render plugins to work with render targets with different dimensions than the screen framebuffer.
And fixed new dependencies in build script.
Also some refactoring in plugins.
Still not really satisfied with a solution, will need to handle somehow ordering of plugins (both among them and with respect to rest of rendering, this would be needed for example to be able to redo shadow maps as a plugin).