Extending - THREE.MeshBasicMaterial

安稳与你 提交于 2019-12-20 07:42:05

问题


I am looking to make a copy of THREE.MeshBasicMaterial, and create my own modified material based on it. I will need to edit the shader a little, and add some uniforms ( but I can deal with that ) .

For a start I would like to have the material work just like MeshBasicMaterial and take things from there.

This is my poor attempt (where I started), which is not working: https://gist.github.com/karimbeyrouti/80c00a6b3731f52fe173

How do you create a new material based on MeshBasicMaterial in threejs ?


回答1:


this slide might be helpful
https://speakerdeck.com/yomotsu/low-level-apis-using-three-dot-js?slide=22

Use ShaderMaterial with build-in Shader-Chunks.
https://github.com/mrdoob/three.js/blob/master/src/renderers/shaders/ShaderLib.js

then you can make own extended MeshBasicMaterial.



来源:https://stackoverflow.com/questions/34853621/extending-three-meshbasicmaterial

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!