阴影

发布于 2025-01-22 13:25:14 字数 455 浏览 1 评论 0原文

有一棵带有α叶纹理的树。落下的阴影将叶子在“下方”的叶子强烈变暗,这就是为什么模型本身变黑的原因。

​ 态

There is a tree with alpha leaf textures. The falling shadow strongly darkens the leaves "below", which is why the model itself becomes dark.

enter image description hereenter image description here

Is there any way to avoid this blackout without affecting the rest of the shadows?
Demo and code in the same place

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

橪书 2025-01-29 13:25:14

有一个 Shadow -Material 是看不见的,但仅呈现阴影。您可以将其不透明度设置为模仿阴影黑暗,以下是一个演示:

var planeMaterial = new THREE.ShadowMaterial();
planeMaterial.opacity = 0.5;
var shadowPlane = new THREE.Mesh( geometry, planeMaterial );
shadowPlane.receiveShadow = true;

缺点:在较旧的版本中,有一个shadowdarkness - property被删除。现在,您需要额外的几何形状和材料来模仿简单的属性。

There is a shadowMaterial that is invisible but only renders shadow. You can set its opacity to mimic shadow darkness, here is a demonstration:

var planeMaterial = new THREE.ShadowMaterial();
planeMaterial.opacity = 0.5;
var shadowPlane = new THREE.Mesh( geometry, planeMaterial );
shadowPlane.receiveShadow = true;

Drawback: In older releases there has been a shadowDarkness-property that has been removed. Now you need extra geometry and material to emulate what has been a simple property.

话少心凉 2025-01-29 13:25:14

我创建了另一个方向光(比主亮度略微明亮,带有阴影),它仅在与主侧面的另一侧照亮,从而突出了阴影的位置。

这是一个愚蠢的主意,但它帮助了我。

enter image description here

I created another DirectionLight (slightly less bright than the main one, with a shadow) that only illuminates, on the opposite side from the main one, thereby it highlights the shaded places.

It's a stupid idea, but it helped me.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文