Added normal + ambient occlusion + displacement mapping demo.
A lot of things going on in this commit: - added tangents computation for geometries - mesh must have UV coordinates - to be called explicitly once geometry is loaded like this: geometry.computeTangents() - tangents are stored in Vertex objects - quads are not solved properly (though workaround hack seems to work at least somehow, as far as each vertex appears at least somewhere) - extended VBOs in WebGLRenderer to include tangent streams (when available) - added "normal" shader to ShaderUtils (to be used with MeshShaderMaterial) - Blinn-Phong with one directional and one point light (7 varyings gone, just one spare) - normal maps are in tangent space - displacement maps use simple luminance value (could be changed if better precision is needed) - displacement mapping uses vertex texture fetch - this requires GPU with Shader Model 3.0 - not currently supported in ANGLE - for this, added "supportsVertexTextures" method to WebGLRenderer API, so that application can handle this
Showing
此差异已折叠。
此差异已折叠。
此差异已折叠。
examples/materials_normalmap.html
0 → 100644
examples/obj/ninja/.htaccess
0 → 100644
文件已添加
examples/obj/ninja/NinjaLo_bin.js
0 → 100644
70.8 KB
87.1 KB
164.3 KB