消失的物体 - Three.js CanvasRenderer [英] Disappearing Objects - Three.js CanvasRenderer

查看:755
本文介绍了消失的物体 - Three.js CanvasRenderer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困难,我不明白为什么我的对象会随着画布渲染器而消失。虽然它与webGL渲染器完全一样,我需要在移动设备上显示它,因此无法访问webGL渲染器

I am very stuck, I do not understand why my objects are disappearing with canvas renderer. While it works exactly as expected with webGL renderer, I need to display this on mobile devices and as such do not have access to a webGL renderer

我尝试过度绘制:true但这似乎并没有使丢失的物品消失

I have tried overdraw:true but this does not seem to make the missing objects disappear

http://jsfiddle.net/xH9GD/3/

当我在房间里发表评论时,这些盒子仍然存在,但是我的iPhone上却出现了严重损坏。

When I comment out the room the boxes remain but they get very mangled on my iPhone.

我理解Z战斗的概念但是我不认为这是因为每个面的zPosition应该与其他人分开

I understand the concept of Z-fighting however I don't think this is occurring as the zPosition of each of the faces should be seperate to the others

floor = drawTopFacingWall(room.width, room.length );
wall1 = drawLeftFacingWall( room.length, room.depth );
wall2 = drawFrontFacingWall( room.width, room.depth );
wall3 = drawRightFacingWall( room.length, room.depth );
roof = drawBottomFacingWall( room.width, room.length );
wall4 = drawBackFacingWall( room.width, room.depth );


推荐答案

消失的几何形状是由于 CanvasRenderer 由于它处理深度排序的方式。

The "disappearing" geometry is caused by a limitation of CanvasRenderer due to the way it handles depth-sorting.

WebGLRenderer 在像素级别进行排序, CanvasRenderer 在多边形级别进行排序。

While WebGLRenderer sorts at the pixel level, CanvasRenderer sorts at the polygon level.

你能做的最好是增加几何体的细分。

The best you can do is to increase the tessellation of your geometry.

var geometry = new THREE.PlaneGeometry( width, height, 10, 10 );

three.js r.66

three.js r.66

这篇关于消失的物体 - Three.js CanvasRenderer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆