我是 Three.js 的新手,我认为它很棒。我试图更好地控制将纹理数据移动到着色器,以便我可以主要使用 GPU。我的程序基于 Doob 先生的魔法灰尘示例,但我没有使用粒子,而是使用存储在纹理中的加载模型。我目前遇到了闪烁的问题。下面的代码是闪烁的粗略示例,与我正在做的事情有些接近。如果有人能帮助我理解我做错了什么或闪烁的来源......我很确定一切都是最新的,就像纹理映射和three.js修订版一样。非常感谢
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Sample Three.js</title>
</head>
<div id="container">
</div>
<body>
<script type="text/javascript" src="./Scripts/three.js"></script>
<script type="text/javascript">
//
// as name suggests - utilty functions mostly from Mr.doob from THREE.FBOUtils
//
UtilityFuncs = function() {
this.textureWidth = 0;
this.textureHeight = 0;
this.scene = null;
this.camera = null;
this.renderer = null;
this.material = null;
this.jsonLoader = null;
this.jsonModel = null;
this.loadCount = 0;
}
UtilityFuncs.prototype.createScene = function( textureWidth, textureHeight, renderer ) {
var …Run Code Online (Sandbox Code Playgroud)