WebGL 动画闪烁,对象太大?
我使用 scenejs 库创建了一个 webgl 动画 (通过单击左下角的按钮启动它,注意它还可以播放您当前无法禁用的音乐)。
我遇到的问题是中间的地板/平面开始闪烁,并在整个动画中继续闪烁/闪烁。只有到了最后,闪烁才会减弱,并在最后完全停止(当飞机即将结束时)。
如果我将平面的大小减小到其大小的 10%(从 ~26000 到 ~2600),它根本不会闪烁。
我尝试过调整纹理比例,没有效果。降低 fps 似乎也没有效果。 WebGL 在渲染大型对象时是否存在问题?有解决办法吗?
也许可以使飞机静止,并使其具有移动的纹理,但这肯定会使更多事情变得更加棘手,特别是当添加更多元素时。
设置 requestAnimationFrame
没有效果,删除 Flash 视频也没有效果。唯一能正常工作的时候是当飞机明显变小时,或者当它到达末端时。
I created a webgl animation using scenejs library (start it by clicking the button at the bottom left, note it plays music as well which you can't currently disable).
The problem I am encountering is that the floor/plane in the middle starts flickering and continues to flicker/blink through out the animation. Only towards the very end does the flickering lower and by the end stops completely (when the plane is about to end).
If I reduce the size of the plane to 10% of its size (from ~26000 to ~2600), it does not flicker at all.
I've tried adjusting the texture scales, has no effect. Lowering the fps didn't seem to have an effect either. Does WebGL have problems rendering large objects? Are there any work arounds this?
Could probably make the plane static, and have the texture of it moving, but it certainly would make a lot more things trickier, especially when more elements are added to it.
Setting the requestAnimationFrame
had no effect, nor did removing the flash video. The only time it works fine is when the plane is significantly smaller, or when it is reaching the end of it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
场景对我来说看起来不错 - 当你移除闪光灯时会发生什么?
附言。如果您愿意,请在 jsFiddle 上分享此内容。http://jsfiddle.net/
另外,当您在渲染循环中使用 requestAnimationFrame 选项时会发生什么?
这里的例子:
http://scenejs.wikispaces.com/scene#Starting
Scene looks fine to me - what happens when you remove the Flash?
PS. Share this on a jsFiddle if you like..http://jsfiddle.net/
Also, what happens when you use the requestAnimationFrame option for the render loop?
Example here:
http://scenejs.wikispaces.com/scene#Starting