{"issue":{"state":"open","created_at":"2011-11-23T21:53:02Z","updated_at":"2011-11-23T23:01:40Z","user":{"gravatar_id":"16b0c0be8a2d1f5c2b7ce4d880dff4d9","id":197418,"url":"https://api.github.com/users/idflood","login":"idflood","avatar_url":"https://secure.gravatar.com/avatar/16b0c0be8a2d1f5c2b7ce4d880dff4d9?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"Is it possible to change the material of a mesh at runtime? I was using the second solution before but updating three.js broke this I think. Is there anything I'm missing?\r\n\r\nSimply setting the material property doesn't work:\r\nhttp://jsfiddle.net/GKCx6/13/\r\n\r\nRecreating the mesh doesn't help:\r\nhttp://jsfiddle.net/GKCx6/14/","assignee":null,"number":790,"id":2335166,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"Switching material at runtime","closed_at":null,"html_url":"https://github.com/mrdoob/three.js/issues/790","milestone":null,"url":"https://api.github.com/repos/mrdoob/three.js/issues/790"},"action":"created","comment":{"created_at":"2011-11-23T23:01:40Z","updated_at":"2011-11-23T23:01:40Z","user":{"gravatar_id":"05a9ea8209c0f0d038d94865d380b210","id":438022,"url":"https://api.github.com/users/alteredq","login":"alteredq","avatar_url":"https://secure.gravatar.com/avatar/05a9ea8209c0f0d038d94865d380b210?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"body":"You can't go from simpler material to more complex material (as then geometry will not get necessary buffers, e.g. lighting needs normals but Basic material doesn't need them so they will not get baked into WebGL buffers).\r\n\r\nIf you render first with Lambert then it works:\r\n\r\nhttp://jsfiddle.net/GKCx6/15/","id":2856173,"url":"https://api.github.com/repos/mrdoob/three.js/issues/comments/2856173"}}