I'm creating terrain editor with three.js and i have encountered few problems.
First. Shadows renders on MeshLambertMaterial, but it wont on ShaderMaterial.
Second. How to change object's material (from lambert to shader) on runtime?
Here's demo of my editor: http://78.62.160.169/webgl/editor/
And source code: http://78.62.160.169/webgl/editor/script.js
问问题
1581 次
2 回答
1
LambertMaterial
是插件支持的内置材质。所以阴影插件支持在 上渲染LambertMaterial
,虽然ShaderMaterial
是你自己的着色器/材质,应该手动启用阴影支持,默认情况下没有设置。
于 2013-09-23T18:34:59.200 回答
0
这是带有阴影和雾的 ShaderMaterial 的示例
https://gist.github.com/wmcmurray/6696fc95f25bbd2401d72a74e9493261
或者您也可以从 LambertMaterial 或其他重写着色器,
让它支持你自己的着色器
于 2020-07-19T15:15:53.247 回答