mrdoob/three.js — Issue #1383: WebGLRenderer does not support switching materials
Author: piersh
Created: 2012-02-23 17:51:09+00:00
State: open

I can't find a way to get WebGLRenderer to notice when the material changes. I don't mean changing properties of a material, i mean switching one material for another.

here's an example: http://jsfiddle.net/qkAjR/

this one changes the materialIndex of each of the faces. It works fine in CanvasRenderer, not in WebGLRenderer.

i tried setting the face[i].mesh property, that doesn't work in CanvasRenderer either.

I also tried using a THREE.Mesh and setting the mesh.material property, doesn't work either.

how is one supposed to dynamically switch materials?