未验证 提交 7bf355c4 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #20189 from Mugen87/dev51

Examples: Assign equirect env map directly to Scene.background.
......@@ -29,6 +29,7 @@
textureLoader.load( 'textures/2294472375_24a3b8ef46_o.jpg', function ( texture ) {
texture.encoding = THREE.sRGBEncoding;
texture.mapping = THREE.EquirectangularReflectionMapping;
init( texture );
animate();
......@@ -40,19 +41,14 @@
renderer = new THREE.WebGLRenderer( { antialias: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
renderer.outputEncoding = THREE.sRGBEncoding;
document.body.appendChild( renderer.domElement );
scene = new THREE.Scene();
scene.background = texture;
camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 1000 );
// background
var options = {}; // none required
scene.background = new THREE.WebGLCubeRenderTarget( 1024, options ).fromEquirectangularTexture( renderer, texture );
//
cubeRenderTarget1 = new THREE.WebGLCubeRenderTarget( 256, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册