透明着色器允许下面的对象显示在顶部(Transparent shader allows the objects below to show on top)

编程入门 行业动态 更新时间:2024-10-12 22:33:45
透明着色器允许下面的对象显示在顶部(Transparent shader allows the objects below to show on top)

在我的场景中,表情符号(带有png图像的四边形)放置在Y:0处,点(带有平铺3X3的四边形)放置在Y:-0.25处。 我需要用于表情符号的着色器是透明 - 漫反射,因为我正在使用圆形png图像。

但我在下面使用的点数显示在笑脸之上。 使用像漫反射这样的任何其他着色器解决了问题,但笑脸变成了正方形。

截图:

如果您需要更多说明,请不要犹豫。

编辑:我已经从检查员面板上附上了笑脸和圆点的着色器细节。 链接: http : //postimg.org/image/cvws1os7d/

编辑2:我发现问题应该是MainCamera,尤其是距离和“Field Of View”。 我需要使用“Perspective”作为投影类型,使用140作为Field of View。

如果我将投影类型更改为“正交”,则问题将完全修复。

下面的屏幕截图显示了距离和视野如何控制笑脸上点的外观。

屏幕截图1:Y位置:8.48视野:30链接: http : //postimg.org/image/s31tttrkp/

屏幕截图2:Y位置:9.7视野:30链接: http : //postimg.org/image/f71sq0y4b/

屏幕截图3:Y位置:11.41视野:30链接: http : //postimg.org/image/3uk4az3d3/

屏幕截图4:Y位置:1视野:140链接: http : //postimg.org/image/bul9zwg7z/

这可能是一个线索吗?

In my scene, the smileys(Quad with png image) are placed at Y:0 and the dots(Quad with tiling 3X3) are placed at Y: -0.25. The shader I need to use for the smileys is Transparent-Diffuse as I am using a circle png image.

But the dots I use below are showing up above the smiley. Using any other shader like Diffuse solves the issue but the smiley becomes a square.

Screenshot:

If you need any more clarifications please dont hesitate to ask.

Edit: I have attached the shader details of both the smiley and the dots from the inspector panel. link: http://postimg.org/image/cvws1os7d/

Edit 2: I have found that the issue should be with the MainCamera and especially with distance & "Field Of View". I need to use "Perspective" as projection type and 140 as Field of View.

If I change the projection type to Orthographic the issue is completely fixed.

The below screenshots show how the distance and Field of View controls the appearance of the dots over the smiley.

Screenshot 1: Y position: 8.48 Field of View: 30 link: http://postimg.org/image/s31tttrkp/

Screenshot 2: Y position: 9.7 Field of View: 30 link: http://postimg.org/image/f71sq0y4b/

Screenshot 3: Y position: 11.41 Field of View: 30 link: http://postimg.org/image/3uk4az3d3/

Screenshot 4: Y position: 1 Field of View: 140 link: http://postimg.org/image/bul9zwg7z/

Can this be a clue?

更多推荐

本文发布于:2023-08-05 17:57:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1437223.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:透明   对象   着色器   Transparent   top

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!