Skip to content

Commit 5360a81

Browse files
committed
r98
1 parent f8dc0a9 commit 5360a81

File tree

6 files changed

+262
-220
lines changed

6 files changed

+262
-220
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Please also include a live example if possible. You can start from these templat
1919
##### Three.js version
2020

2121
- [ ] Dev
22-
- [ ] r97
22+
- [ ] r98
2323
- [ ] ...
2424

2525
##### Browser

build/three.js

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185

186186
} );
187187

188-
var REVISION = '98dev';
188+
var REVISION = '98';
189189
var MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2 };
190190
var CullFaceNone = 0;
191191
var CullFaceBack = 1;
@@ -6166,7 +6166,7 @@
61666166

61676167
var background_frag = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n}\n";
61686168

6169-
var background_vert = "varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = vec4( position, 1.0 );\n\tgl_Position.z = 1.0;\n}\n";
6169+
var background_vert = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position, 1.0 );\n\tgl_Position.z = 1.0;\n}\n";
61706170

61716171
var cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n";
61726172

@@ -7400,6 +7400,7 @@
74007400
background: {
74017401

74027402
uniforms: {
7403+
uvTransform: { value: new Matrix3() },
74037404
t2D: { value: null },
74047405
},
74057406

@@ -14624,6 +14625,7 @@
1462414625
boxMesh = new Mesh(
1462514626
new BoxBufferGeometry( 1, 1, 1 ),
1462614627
new ShaderMaterial( {
14628+
type: 'BackgroundCubeMaterial',
1462714629
uniforms: UniformsUtils.clone( ShaderLib.cube.uniforms ),
1462814630
vertexShader: ShaderLib.cube.vertexShader,
1462914631
fragmentShader: ShaderLib.cube.fragmentShader,
@@ -14660,6 +14662,7 @@
1466014662
planeMesh = new Mesh(
1466114663
new PlaneBufferGeometry( 2, 2 ),
1466214664
new ShaderMaterial( {
14665+
type: 'BackgroundMaterial',
1466314666
uniforms: UniformsUtils.clone( ShaderLib.background.uniforms ),
1466414667
vertexShader: ShaderLib.background.vertexShader,
1466514668
fragmentShader: ShaderLib.background.fragmentShader,
@@ -14678,6 +14681,14 @@
1467814681

1467914682
planeMesh.material.uniforms.t2D.value = background;
1468014683

14684+
if ( background.matrixAutoUpdate === true ) {
14685+
14686+
background.updateMatrix();
14687+
14688+
}
14689+
14690+
planeMesh.material.uniforms.uvTransform.value.copy( background.matrix );
14691+
1468114692
// push to the pre-sorted opaque render list
1468214693
renderList.push( planeMesh, planeMesh.geometry, planeMesh.material, 0, null );
1468314694

@@ -38861,6 +38872,7 @@
3886138872

3886238873
parseMaterials: function ( json, textures ) {
3886338874

38875+
var cache = {}; // MultiMaterial
3886438876
var materials = {};
3886538877

3886638878
if ( json !== undefined ) {
@@ -38880,7 +38892,15 @@
3888038892

3888138893
for ( var j = 0; j < data.materials.length; j ++ ) {
3888238894

38883-
array.push( loader.parse( data.materials[ j ] ) );
38895+
var material = data.materials[ j ];
38896+
38897+
if ( cache[ material.uuid ] === undefined ) {
38898+
38899+
cache[ material.uuid ] = loader.parse( material );
38900+
38901+
}
38902+
38903+
array.push( cache[ material.uuid ] );
3888438904

3888538905
}
3888638906

@@ -38889,6 +38909,7 @@
3888938909
} else {
3889038910

3889138911
materials[ data.uuid ] = loader.parse( data );
38912+
cache[ data.uuid ] = materials[ data.uuid ];
3889238913

3889338914
}
3889438915

0 commit comments

Comments
 (0)