language stringclasses 1 value | owner stringlengths 2 15 | repo stringlengths 2 21 | sha stringlengths 45 45 | message stringlengths 7 36.3k | path stringlengths 1 199 | patch stringlengths 15 102k | is_multipart bool 2 classes |
|---|---|---|---|---|---|---|---|
Other | mrdoob | three.js | d1c934903a41bd10c9bfa61dd3c1f88ac4f2d2c4.json | replace frustum vertex with vector3 | examples/jsm/csm/FrustumVertex.js | @@ -1,25 +0,0 @@
-/**
- * @author vHawk / https://github.com/vHawk/
- */
-
-export default class FrustumVertex {
-
- constructor( x, y, z ) {
-
- this.x = x || 0;
- this.y = y || 0;
- this.z = z || 0;
-
- }
-
- fromLerp( v1, v2, amount ) {
-
- this.x = ( 1 - amount ) * v1.x + amount * v2.x;
- this.y = ( 1 - amount ) * v1.y + amount * v2.y;
- this.z = ( 1 - amount ) * v1.z + amount * v2.z;
-
- return this;
-
- }
-
-} | true |
Other | mrdoob | three.js | 9fcb357600446c2f0b161196c316c4c8daff7a55.json | use projection matrix in frustum | examples/jsm/csm/CSM.js | @@ -72,6 +72,7 @@ export default class CSM {
initCascades() {
+ // TODO: Handle orthographic camera
const camera = this.camera;
const far = Math.min(camera.far, this.maxFar);
this.mainFrustum = new Frustum( {
@@ -239,7 +240,7 @@ export default class CSM {
updateUniforms() {
const far = Math.min(this.camera.far, this.maxFar);
- console.log('HERE', far);
+
for ( let i = 0; i < this.materials.length; i ++ ) {
this.materials[ i ].uniforms.CSM_cascades.value = this.getExtendedBreaks(); | true |
Other | mrdoob | three.js | 9fcb357600446c2f0b161196c316c4c8daff7a55.json | use projection matrix in frustum | examples/jsm/csm/Frustum.js | @@ -2,19 +2,19 @@
* @author vHawk / https://github.com/vHawk/
*/
-import { MathUtils, Vector3 } from '../../../build/three.module.js';
+import { MathUtils, Vector3, Matrix4 } from '../../../build/three.module.js';
import FrustumVertex from './FrustumVertex.js';
+const inverseProjectionMatrix = new Matrix4();
+
export default class Frustum {
constructor( data ) {
data = data || {};
- this.fov = data.fov || 70;
- this.near = data.near || 0.1;
- this.far = data.far || 1000;
- this.aspect = data.aspect || 1;
+ this.projectionMatrix = data.projectionMatrix;
+ this.maxFar = data.maxFar || 10000;
this.vertices = {
near: [],
@@ -25,29 +25,37 @@ export default class Frustum {
getViewSpaceVertices() {
- this.nearPlaneY = this.near * Math.tan( MathUtils.degToRad( this.fov / 2 ) );
- this.nearPlaneX = this.aspect * this.nearPlaneY;
-
- this.farPlaneY = this.far * Math.tan( MathUtils.degToRad( this.fov / 2 ) );
- this.farPlaneX = this.aspect * this.farPlaneY;
+ const maxFar = this.maxFar;
+ inverseProjectionMatrix.getInverse( this.projectionMatrix );
// 3 --- 0 vertices.near/far order
// | |
// 2 --- 1
+ // clip space spans from [-1, 1]
this.vertices.near.push(
- new FrustumVertex( this.nearPlaneX, this.nearPlaneY, - this.near ),
- new FrustumVertex( this.nearPlaneX, - this.nearPlaneY, - this.near ),
- new FrustumVertex( - this.nearPlaneX, - this.nearPlaneY, - this.near ),
- new FrustumVertex( - this.nearPlaneX, this.nearPlaneY, - this.near )
- );
+ new Vector3( 1, 1, - 1 ),
+ new Vector3( 1, - 1, - 1 ),
+ new Vector3( - 1, - 1, - 1 ),
+ new Vector3( - 1, 1, - 1 )
+ ).forEach( function( v ) {
+
+ v.applyMatrix4( inverseProjectionMatrix );
+ v.multiplyScalar( Math.min( v.z / maxFar, 1.0 ) );
+
+ } );
this.vertices.far.push(
- new FrustumVertex( this.farPlaneX, this.farPlaneY, - this.far ),
- new FrustumVertex( this.farPlaneX, - this.farPlaneY, - this.far ),
- new FrustumVertex( - this.farPlaneX, - this.farPlaneY, - this.far ),
- new FrustumVertex( - this.farPlaneX, this.farPlaneY, - this.far )
- );
+ new Vector3( 1, 1, 1 ),
+ new Vector3( 1, - 1, 1 ),
+ new Vector3( - 1, - 1, 1 ),
+ new Vector3( - 1, 1, 1 )
+ ).forEach( function( v ) {
+
+ v.applyMatrix4( inverseProjectionMatrix );
+ v.multiplyScalar( Math.min( v.z / maxFar, 1.0 ) );
+
+ } );
return this.vertices;
| true |
Other | mrdoob | three.js | cdad0aa7e536df0fa2708601d85efa732f835314.json | remove parametes redundant to camera | examples/jsm/csm/CSM.js | @@ -26,11 +26,8 @@ export default class CSM {
this.camera = data.camera;
this.parent = data.parent;
- this.fov = data.fov || this.camera.fov;
- this.near = this.camera.near;
- this.far = data.far || this.camera.far;
- this.aspect = data.aspect || this.camera.aspect;
this.cascades = data.cascades || 3;
+ this.maxFar = data.maxFar || 100000;
this.mode = data.mode || 'practical';
this.shadowMapSize = data.shadowMapSize || 2048;
this.shadowBias = data.shadowBias || 0.000001;
@@ -75,11 +72,13 @@ export default class CSM {
initCascades() {
+ const camera = this.camera;
+ const far = Math.min(camera.far, this.maxFar);
this.mainFrustum = new Frustum( {
- fov: this.fov,
- near: this.near,
- far: this.far,
- aspect: this.aspect
+ fov: camera.fov,
+ near: camera.near,
+ far: far,
+ aspect: camera.aspect
} );
this.mainFrustum.getViewSpaceVertices();
@@ -90,22 +89,24 @@ export default class CSM {
getBreaks() {
+ const camera = this.camera;
+ const far = Math.min(camera.far, this.maxFar);
this.breaks = [];
switch ( this.mode ) {
case 'uniform':
- this.breaks = uniformSplit( this.cascades, this.near, this.far );
+ this.breaks = uniformSplit( this.cascades, camera.near, far );
break;
case 'logarithmic':
- this.breaks = logarithmicSplit( this.cascades, this.near, this.far );
+ this.breaks = logarithmicSplit( this.cascades, camera.near, far );
break;
case 'practical':
- this.breaks = practicalSplit( this.cascades, this.near, this.far, 0.5 );
+ this.breaks = practicalSplit( this.cascades, camera.near, far, 0.5 );
break;
case 'custom':
if ( this.customSplitsCallback === undefined ) console.error( 'CSM: Custom split scheme callback not defined.' );
- this.breaks = this.customSplitsCallback( this.cascades, this.near, this.far );
+ this.breaks = this.customSplitsCallback( this.cascades, camera.near, far );
break;
}
@@ -221,12 +222,13 @@ export default class CSM {
}
const self = this;
+ const far = Math.min(this.camera.far, this.maxFar);
material.onBeforeCompile = function ( shader ) {
shader.uniforms.CSM_cascades = { value: breaksVec2 };
shader.uniforms.cameraNear = { value: self.camera.near };
- shader.uniforms.shadowFar = { value: self.far };
+ shader.uniforms.shadowFar = { value: far };
self.materials.push( shader );
@@ -236,11 +238,13 @@ export default class CSM {
updateUniforms() {
+ const far = Math.min(this.camera.far, this.maxFar);
+ console.log('HERE', far);
for ( let i = 0; i < this.materials.length; i ++ ) {
this.materials[ i ].uniforms.CSM_cascades.value = this.getExtendedBreaks();
this.materials[ i ].uniforms.cameraNear.value = this.camera.near;
- this.materials[ i ].uniforms.shadowFar.value = this.far;
+ this.materials[ i ].uniforms.shadowFar.value = far;
}
@@ -262,13 +266,6 @@ export default class CSM {
}
- setAspect( aspect ) {
-
- this.aspect = aspect;
- this.initCascades();
-
- }
-
updateFrustums() {
this.getBreaks(); | true |
Other | mrdoob | three.js | cdad0aa7e536df0fa2708601d85efa732f835314.json | remove parametes redundant to camera | examples/webgl_shadowmap_csm.html | @@ -65,10 +65,7 @@
};
csm = new CSM.default({
- fov: camera.fov,
- near: camera.near,
- far: params.far,
- aspect: camera.aspect,
+ maxFar: params.far,
cascades: 4,
mode: params.mode,
parent: scene,
@@ -116,7 +113,7 @@
gui.add( params, 'far', 1, 5000 ).step( 1 ).name( 'shadow far' ).onChange( function ( value ) {
- csm.far = value;
+ csm.maxFar = value;
csm.updateFrustums();
} ); | true |
Other | mrdoob | three.js | 8604213c9dd95ed42931b755bffce838f917ccb0.json | add author attribution to csm | examples/jsm/csm/CSM.js | @@ -1,3 +1,7 @@
+/**
+ * @author vHawk / https://github.com/vHawk/
+ */
+
import {
Vector2,
Vector3, | true |
Other | mrdoob | three.js | 8604213c9dd95ed42931b755bffce838f917ccb0.json | add author attribution to csm | examples/jsm/csm/Frustum.js | @@ -1,3 +1,7 @@
+/**
+ * @author vHawk / https://github.com/vHawk/
+ */
+
import { MathUtils, Vector3 } from '../../../build/three.module.js';
import FrustumVertex from './FrustumVertex.js';
| true |
Other | mrdoob | three.js | 8604213c9dd95ed42931b755bffce838f917ccb0.json | add author attribution to csm | examples/jsm/csm/FrustumBoundingBox.js | @@ -1,3 +1,7 @@
+/**
+ * @author vHawk / https://github.com/vHawk/
+ */
+
export default class FrustumBoundingBox {
constructor() { | true |
Other | mrdoob | three.js | 8604213c9dd95ed42931b755bffce838f917ccb0.json | add author attribution to csm | examples/jsm/csm/FrustumVertex.js | @@ -1,3 +1,7 @@
+/**
+ * @author vHawk / https://github.com/vHawk/
+ */
+
export default class FrustumVertex {
constructor( x, y, z ) { | true |
Other | mrdoob | three.js | 8604213c9dd95ed42931b755bffce838f917ccb0.json | add author attribution to csm | examples/jsm/csm/Shader.js | @@ -1,3 +1,7 @@
+/**
+ * @author vHawk / https://github.com/vHawk/
+ */
+
import { ShaderChunk } from '../../../build/three.module.js';
export default { | true |
Other | mrdoob | three.js | 66b4d70fb0d35175f7130b2bfb4e4a7fd8e2903f.json | remove transparent based on alphaMap #18705 | src/loaders/MaterialLoader.js | @@ -207,12 +207,7 @@ MaterialLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
if ( json.map !== undefined ) material.map = getTexture( json.map );
if ( json.matcap !== undefined ) material.matcap = getTexture( json.matcap );
- if ( json.alphaMap !== undefined ) {
-
- material.alphaMap = getTexture( json.alphaMap );
- material.transparent = true;
-
- }
+ if ( json.alphaMap !== undefined ) material.alphaMap = getTexture( json.alphaMap );
if ( json.bumpMap !== undefined ) material.bumpMap = getTexture( json.bumpMap );
if ( json.bumpScale !== undefined ) material.bumpScale = json.bumpScale; | false |
Other | mrdoob | three.js | 421eb682b993fa4b50b0e8ad15f18d7281bae557.json | Remove redundant function | examples/jsm/csm/Frustum.js | @@ -1,6 +1,5 @@
import * as THREE from '../../../build/three.module.js';
import FrustumVertex from './FrustumVertex.js';
-import { toRad } from './Utils.js';
export default class Frustum {
@@ -22,10 +21,10 @@ export default class Frustum {
getViewSpaceVertices() {
- this.nearPlaneY = this.near * Math.tan( toRad( this.fov / 2 ) );
+ this.nearPlaneY = this.near * Math.tan( THREE.MathUtils.degToRad( this.fov / 2 ) );
this.nearPlaneX = this.aspect * this.nearPlaneY;
- this.farPlaneY = this.far * Math.tan( toRad( this.fov / 2 ) );
+ this.farPlaneY = this.far * Math.tan( THREE.MathUtils.degToRad( this.fov / 2 ) );
this.farPlaneX = this.aspect * this.farPlaneY;
// 3 --- 0 vertices.near/far order | true |
Other | mrdoob | three.js | 421eb682b993fa4b50b0e8ad15f18d7281bae557.json | Remove redundant function | examples/jsm/csm/Utils.js | @@ -1,5 +0,0 @@
-export function toRad( degrees ) {
-
- return degrees * Math.PI / 180;
-
-} | true |
Other | mrdoob | three.js | 7235231a70704a20d2f25ddea482168a72abc133.json | Fix d.ts for BoxHelper constructor | src/helpers/BoxHelper.d.ts | @@ -4,7 +4,7 @@ import { LineSegments } from './../objects/LineSegments';
export class BoxHelper extends LineSegments {
- constructor( object: Object3D, color?: Color );
+ constructor( object: Object3D, color?: Color | string | number );
update( object?: Object3D ): void;
| false |
Other | mrdoob | three.js | 07b252f84d9bf69b9f0aa67ba894ec92b987ec08.json | Use ACES Filmic tone mapping | examples/webgl_materials_envmaps_exr.html | @@ -49,7 +49,6 @@
scene = new THREE.Scene();
renderer = new THREE.WebGLRenderer();
- renderer.toneMapping = THREE.LinearToneMapping;
//
@@ -108,6 +107,7 @@
container.appendChild( renderer.domElement );
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.outputEncoding = THREE.sRGBEncoding;
stats = new Stats(); | true |
Other | mrdoob | three.js | 07b252f84d9bf69b9f0aa67ba894ec92b987ec08.json | Use ACES Filmic tone mapping | examples/webgl_materials_envmaps_hdr.html | @@ -89,7 +89,7 @@
renderer = new THREE.WebGLRenderer();
renderer.physicallyCorrectLights = true;
- renderer.toneMapping = THREE.LinearToneMapping;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
//
| true |
Other | mrdoob | three.js | 07b252f84d9bf69b9f0aa67ba894ec92b987ec08.json | Use ACES Filmic tone mapping | examples/webgl_materials_envmaps_hdr_nodes.html | @@ -93,7 +93,6 @@
renderer = new THREE.WebGLRenderer();
renderer.physicallyCorrectLights = true;
- renderer.toneMapping = THREE.LinearToneMapping;
//
@@ -180,7 +179,7 @@
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
- //renderer.toneMapping = ReinhardToneMapping;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.outputEncoding = THREE.sRGBEncoding;
stats = new Stats(); | true |
Other | mrdoob | three.js | 07b252f84d9bf69b9f0aa67ba894ec92b987ec08.json | Use ACES Filmic tone mapping | examples/webgl_materials_envmaps_pmrem_nodes.html | @@ -79,7 +79,6 @@
scene.background = new THREE.Color( 0x000000 );
renderer = new THREE.WebGLRenderer();
- renderer.toneMapping = THREE.LinearToneMapping;
//
@@ -132,7 +131,7 @@
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
- //renderer.toneMapping = THREE.ReinhardToneMapping;
+ renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.outputEncoding = THREE.sRGBEncoding;
stats = new Stats(); | true |
Other | mrdoob | three.js | 77248fa3252a6e197addda1087b70f50cf7ec7b9.json | Fix explanation of Quaternion.lengthSq() | docs/api/en/math/Quaternion.html | @@ -109,7 +109,7 @@ <h3>[method:Float length]()</h3>
<h3>[method:Float lengthSq]()</h3>
<p>
- Computes the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
+ Computes the squared [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length]
(straight-line length) of this quaternion, considered as a 4 dimensional
vector. This can be useful if you are comparing the lengths of two quaternions,
as this is a slightly more efficient calculation than [page:.length length](). | false |
Other | mrdoob | three.js | 2ca7b89846423adbe0d2ec5a98785e02c8523969.json | Update initial worker config values | examples/js/loaders/BasisTextureLoader.js | @@ -31,6 +31,7 @@ THREE.BasisTextureLoader = function ( manager ) {
this.workerConfig = {
format: null,
astcSupported: false,
+ bptcSupported: false,
etcSupported: false,
dxtSupported: false,
pvrtcSupported: false,
@@ -63,11 +64,11 @@ THREE.BasisTextureLoader.prototype = Object.assign( Object.create( THREE.Loader.
var config = this.workerConfig;
config.astcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_astc' );
+ config.bptcSupported = !! renderer.extensions.get( 'EXT_texture_compression_bptc' );
config.etcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_etc1' );
config.dxtSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_s3tc' );
config.pvrtcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_pvrtc' )
|| !! renderer.extensions.get( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );
- config.bptcSupported = !! renderer.extensions.get( 'EXT_texture_compression_bptc' );
if ( config.astcSupported ) {
| true |
Other | mrdoob | three.js | 2ca7b89846423adbe0d2ec5a98785e02c8523969.json | Update initial worker config values | examples/jsm/loaders/BasisTextureLoader.js | @@ -44,6 +44,7 @@ var BasisTextureLoader = function ( manager ) {
this.workerConfig = {
format: null,
astcSupported: false,
+ bptcSupported: false,
etcSupported: false,
dxtSupported: false,
pvrtcSupported: false,
@@ -76,11 +77,11 @@ BasisTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ),
var config = this.workerConfig;
config.astcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_astc' );
+ config.bptcSupported = !! renderer.extensions.get( 'EXT_texture_compression_bptc' );
config.etcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_etc1' );
config.dxtSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_s3tc' );
config.pvrtcSupported = !! renderer.extensions.get( 'WEBGL_compressed_texture_pvrtc' )
|| !! renderer.extensions.get( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );
- config.bptcSupported = !! renderer.extensions.get( 'EXT_texture_compression_bptc' );
if ( config.astcSupported ) {
| true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | docs/api/en/lights/shadows/LightShadow.html | @@ -40,6 +40,10 @@ <h3>[property:Float bias]</h3>
The default is 0. Very tiny adjustments here (in the order of 0.0001) may help reduce artefacts in shadows
</p>
+ <h3>[property:Float normalOffset]</h3>
+ <p>Defines how much the position used to query the shadow map is offset along the object normal.</p>
+ <p>The default is 0. Increasing this value can be used to reduce shadow acne especially in large scenes where light shines onto geometry at a shallow angle. The cost is that shadows may appear distorted.</p>
+
<h3>[property:WebGLRenderTarget map]</h3>
<p>
The depth map generated using the internal camera; a location beyond a pixel's depth is | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | examples/jsm/objects/Water.js | @@ -120,6 +120,8 @@ var Water = function ( geometry, options ) {
' vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );',
' gl_Position = projectionMatrix * mvPosition;',
+ '#include <beginnormal_vertex>',
+ '#include <defaultnormal_vertex>',
'#include <logdepthbuf_vertex>',
'#include <fog_vertex>',
'#include <shadowmap_vertex>', | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/lights/LightShadow.d.ts | @@ -11,6 +11,7 @@ export class LightShadow {
camera: Camera;
bias: number;
+ normalOffset: number;
radius: number;
mapSize: Vector2;
map: RenderTarget; | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/lights/LightShadow.js | @@ -13,6 +13,7 @@ function LightShadow( camera ) {
this.camera = camera;
this.bias = 0;
+ this.normalOffset = 0;
this.radius = 1;
this.mapSize = new Vector2( 512, 512 ); | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js | @@ -63,19 +63,6 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
- #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
-
- struct DirectionalLightShadow {
- float shadowBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
-
- uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
-
- #endif
-
-
void getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {
directLight.color = directionalLight.color;
@@ -98,20 +85,6 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
- #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
-
- struct PointLightShadow {
- float shadowBias;
- float shadowRadius;
- vec2 shadowMapSize;
- float shadowCameraNear;
- float shadowCameraFar;
- };
-
- uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
-
- #endif
-
// directLight is an out parameter as having it as a return value caused compiler errors on some devices
void getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {
@@ -143,18 +116,6 @@ vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
- #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
-
- struct SpotLightShadow {
- float shadowBias;
- float shadowRadius;
- vec2 shadowMapSize;
- };
-
- uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
-
- #endif
-
// directLight is an out parameter as having it as a return value caused compiler errors on some devices
void getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {
| true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js | @@ -6,20 +6,49 @@ export default /* glsl */`
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
+ struct DirectionalLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+
+ uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
+
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
+ struct SpotLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+
+ uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
+
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
+ struct PointLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ float shadowCameraNear;
+ float shadowCameraFar;
+ };
+
+ uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
+
#endif
/* | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js | @@ -6,20 +6,49 @@ export default /* glsl */`
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
+ struct DirectionalLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+
+ uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
+
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];
varying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];
+ struct SpotLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ };
+
+ uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
+
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
+ struct PointLightShadow {
+ float shadowBias;
+ float shadowNormalOffset;
+ float shadowRadius;
+ vec2 shadowMapSize;
+ float shadowCameraNear;
+ float shadowCameraFar;
+ };
+
+ uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
+
#endif
/* | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js | @@ -1,12 +1,21 @@
export default /* glsl */`
#ifdef USE_SHADOWMAP
+ #if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0
+
+ // Offsetting the position used for querying occlusion along the world normal can be used to reduce shadow acne.
+ vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
+ vec4 shadowWorldPosition;
+
+ #endif
+
#if NUM_DIR_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
- vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;
+ shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalOffset, 0 );
+ vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
@@ -18,7 +27,8 @@ export default /* glsl */`
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
- vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;
+ shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalOffset, 0 );
+ vSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
@@ -30,7 +40,8 @@ export default /* glsl */`
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
- vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;
+ shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalOffset, 0 );
+ vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/ShaderLib/shadow_vert.glsl.js | @@ -7,6 +7,13 @@ void main() {
#include <begin_vertex>
#include <project_vertex>
#include <worldpos_vertex>
+
+ #include <beginnormal_vertex>
+ #include <morphnormal_vertex>
+ #include <skinbase_vertex>
+ #include <skinnormal_vertex>
+ #include <defaultnormal_vertex>
+
#include <shadowmap_vertex>
#include <fog_vertex>
| true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/UniformsLib.d.ts | @@ -73,6 +73,7 @@ export let UniformsLib: {
value: any[];
properties: {
shadowBias: {};
+ shadowNormalOffset: {};
shadowRadius: {};
shadowMapSize: {};
};
@@ -95,6 +96,7 @@ export let UniformsLib: {
value: any[];
properties: {
shadowBias: {};
+ shadowNormalOffset: {};
shadowRadius: {};
shadowMapSize: {};
};
@@ -114,6 +116,7 @@ export let UniformsLib: {
value: any[];
properties: {
shadowBias: {};
+ shadowNormalOffset: {};
shadowRadius: {};
shadowMapSize: {};
}; | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/shaders/UniformsLib.js | @@ -119,6 +119,7 @@ var UniformsLib = {
directionalLightShadows: { value: [], properties: {
shadowBias: {},
+ shadowNormalOffset: {},
shadowRadius: {},
shadowMapSize: {}
} },
@@ -138,6 +139,7 @@ var UniformsLib = {
spotLightShadows: { value: [], properties: {
shadowBias: {},
+ shadowNormalOffset: {},
shadowRadius: {},
shadowMapSize: {}
} },
@@ -154,6 +156,7 @@ var UniformsLib = {
pointLightShadows: { value: [], properties: {
shadowBias: {},
+ shadowNormalOffset: {},
shadowRadius: {},
shadowMapSize: {},
shadowCameraNear: {}, | true |
Other | mrdoob | three.js | 892543285102f5f00ea48fa9189b221990f244e1.json | Add shadow map normal offset
This feature offsets the position used to query shadow map occlusion along the object normal. This can be used to reduce shadow acne especially in large scenes. | src/renderers/webgl/WebGLLights.js | @@ -103,6 +103,7 @@ function ShadowUniformsCache() {
case 'DirectionalLight':
uniforms = {
shadowBias: 0,
+ shadowNormalOffset: 0,
shadowRadius: 1,
shadowMapSize: new Vector2()
};
@@ -111,6 +112,7 @@ function ShadowUniformsCache() {
case 'SpotLight':
uniforms = {
shadowBias: 0,
+ shadowNormalOffset: 0,
shadowRadius: 1,
shadowMapSize: new Vector2()
};
@@ -119,6 +121,7 @@ function ShadowUniformsCache() {
case 'PointLight':
uniforms = {
shadowBias: 0,
+ shadowNormalOffset: 0,
shadowRadius: 1,
shadowMapSize: new Vector2(),
shadowCameraNear: 1,
@@ -258,6 +261,7 @@ function WebGLLights() {
var shadowUniforms = shadowCache.get( light );
shadowUniforms.shadowBias = shadow.bias;
+ shadowUniforms.shadowNormalOffset = shadow.normalOffset;
shadowUniforms.shadowRadius = shadow.radius;
shadowUniforms.shadowMapSize = shadow.mapSize;
@@ -299,6 +303,7 @@ function WebGLLights() {
var shadowUniforms = shadowCache.get( light );
shadowUniforms.shadowBias = shadow.bias;
+ shadowUniforms.shadowNormalOffset = shadow.normalOffset;
shadowUniforms.shadowRadius = shadow.radius;
shadowUniforms.shadowMapSize = shadow.mapSize;
@@ -364,6 +369,7 @@ function WebGLLights() {
var shadowUniforms = shadowCache.get( light );
shadowUniforms.shadowBias = shadow.bias;
+ shadowUniforms.shadowNormalOffset = shadow.normalOffset;
shadowUniforms.shadowRadius = shadow.radius;
shadowUniforms.shadowMapSize = shadow.mapSize;
shadowUniforms.shadowCameraNear = shadow.camera.near; | true |
Other | mrdoob | three.js | f75df95e815b45ca9a807b5563a0234e9798875b.json | fix unique reflectnode | examples/jsm/nodes/accessors/ReflectNode.js | @@ -63,7 +63,7 @@ ReflectNode.prototype.generate = function ( builder, output ) {
if ( isUnique ) {
- builder.addNodeCode( `vec3 reflectVec = ${result};` );
+ builder.addNodeCode( `vec3 reflectVec = ${code};` );
result = 'reflectVec';
@@ -83,7 +83,7 @@ ReflectNode.prototype.generate = function ( builder, output ) {
if ( isUnique ) {
- builder.addNodeCode( `vec3 reflectCubeVec = ${result};` );
+ builder.addNodeCode( `vec3 reflectCubeVec = ${code};` );
result = 'reflectCubeVec';
@@ -103,7 +103,7 @@ ReflectNode.prototype.generate = function ( builder, output ) {
if ( isUnique ) {
- builder.addNodeCode( `vec2 reflectSphereVec = ${result};` );
+ builder.addNodeCode( `vec2 reflectSphereVec = ${code};` );
result = 'reflectSphereVec';
| false |
Other | mrdoob | three.js | 41d738ad9677a09f615a919c12495c52802ea030.json | fix ibl normals in reflectnode using StandardNode | examples/jsm/nodes/accessors/NormalNode.js | @@ -87,7 +87,7 @@ NormalNode.prototype.toJSON = function ( meta ) {
};
-NodeLib.addKeyword( 'normal', function () {
+NodeLib.addKeyword( 'viewNormal', function () {
return new NormalNode();
| true |
Other | mrdoob | three.js | 41d738ad9677a09f615a919c12495c52802ea030.json | fix ibl normals in reflectnode using StandardNode | examples/jsm/nodes/accessors/ReflectNode.js | @@ -8,7 +8,7 @@ import { NormalNode } from './NormalNode.js';
function ReflectNode( scope ) {
- TempNode.call( this, 'v3', { unique: true } );
+ TempNode.call( this, 'v3' );
this.scope = scope || ReflectNode.CUBE;
@@ -22,6 +22,12 @@ ReflectNode.prototype = Object.create( TempNode.prototype );
ReflectNode.prototype.constructor = ReflectNode;
ReflectNode.prototype.nodeType = "Reflect";
+ReflectNode.prototype.getUnique = function ( builder ) {
+
+ return !builder.context.viewNormal;
+
+};
+
ReflectNode.prototype.getType = function ( /* builder */ ) {
switch ( this.scope ) {
@@ -38,6 +44,8 @@ ReflectNode.prototype.getType = function ( /* builder */ ) {
ReflectNode.prototype.generate = function ( builder, output ) {
+ var isUnique = this.getUnique( builder );
+
if ( builder.isShader( 'fragment' ) ) {
var result;
@@ -46,32 +54,64 @@ ReflectNode.prototype.generate = function ( builder, output ) {
case ReflectNode.VECTOR:
- var viewNormal = new NormalNode().build( builder, 'v3' );
+ var viewNormalNode = builder.context.viewNormal || new NormalNode();
+
+ var viewNormal = viewNormalNode.build( builder, 'v3' );
var viewPosition = new PositionNode( PositionNode.VIEW ).build( builder, 'v3' );
- builder.addNodeCode( 'vec3 reflectVec = inverseTransformDirection( reflect( -normalize( ' + viewPosition + ' ), ' + viewNormal + ' ), viewMatrix );' );
+ var code = `inverseTransformDirection( reflect( -normalize( ${viewPosition} ), ${viewNormal} ), viewMatrix )`;
+
+ if ( isUnique ) {
+
+ builder.addNodeCode( `vec3 reflectVec = ${result};` );
+
+ result = 'reflectVec';
+
+ } else {
+
+ result = code;
- result = 'reflectVec';
+ }
break;
case ReflectNode.CUBE:
var reflectVec = new ReflectNode( ReflectNode.VECTOR ).build( builder, 'v3' );
- builder.addNodeCode( 'vec3 reflectCubeVec = vec3( -1.0 * ' + reflectVec + '.x, ' + reflectVec + '.yz );' );
+ var code = 'vec3( -' + reflectVec + '.x, ' + reflectVec + '.yz )';
- result = 'reflectCubeVec';
+ if ( isUnique ) {
+
+ builder.addNodeCode( `vec3 reflectCubeVec = ${result};` );
+
+ result = 'reflectCubeVec';
+
+ } else {
+
+ result = code;
+
+ }
break;
case ReflectNode.SPHERE:
var reflectVec = new ReflectNode( ReflectNode.VECTOR ).build( builder, 'v3' );
- builder.addNodeCode( 'vec2 reflectSphereVec = normalize( ( viewMatrix * vec4( ' + reflectVec + ', 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5;' );
+ var code = 'normalize( ( viewMatrix * vec4( ' + reflectVec + ', 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) ).xy * 0.5 + 0.5';
+
+ if ( isUnique ) {
+
+ builder.addNodeCode( `vec2 reflectSphereVec = ${result};` );
+
+ result = 'reflectSphereVec';
+
+ } else {
+
+ result = code;
- result = 'reflectSphereVec';
+ }
break;
| true |
Other | mrdoob | three.js | 41d738ad9677a09f615a919c12495c52802ea030.json | fix ibl normals in reflectnode using StandardNode | examples/jsm/nodes/materials/nodes/StandardNode.js | @@ -8,6 +8,7 @@ import {
} from '../../../../../build/three.module.js';
import { Node } from '../../core/Node.js';
+import { ExpressionNode } from '../../core/ExpressionNode.js';
import { ColorNode } from '../../inputs/ColorNode.js';
import { FloatNode } from '../../inputs/FloatNode.js';
import { RoughnessToBlinnExponentNode } from '../../bsdfs/RoughnessToBlinnExponentNode.js';
@@ -122,13 +123,20 @@ StandardNode.prototype.build = function ( builder ) {
var contextEnvironment = {
bias: RoughnessToBlinnExponentNode,
+ viewNormal: new ExpressionNode('normal', 'v3'),
gamma: true
};
var contextGammaOnly = {
gamma: true
};
+ var contextClearCoatEnvironment = {
+ bias: RoughnessToBlinnExponentNode,
+ viewNormal: new ExpressionNode('clearCoatNormal', 'v3'),
+ gamma: true
+ };
+
var useClearCoat = ! builder.isDefined( 'STANDARD' );
// analyze all nodes to reuse generate codes
@@ -212,7 +220,7 @@ StandardNode.prototype.build = function ( builder ) {
}
- var clearCoatEnv = useClearCoat && environment ? this.environment.flow( builder, 'c', { cache: 'clearCoat', context: contextEnvironment, slot: 'environment' } ) : undefined;
+ var clearCoatEnv = useClearCoat && environment ? this.environment.flow( builder, 'c', { cache: 'clearCoat', context: contextClearCoatEnvironment, slot: 'environment' } ) : undefined;
builder.requires.transparent = alpha !== undefined;
@@ -493,6 +501,7 @@ StandardNode.prototype.copy = function ( source ) {
if ( source.clearCoat ) this.clearCoat = source.clearCoat;
if ( source.clearCoatRoughness ) this.clearCoatRoughness = source.clearCoatRoughness;
+ if ( source.clearCoatNormal ) this.clearCoatNormal = source.clearCoatNormal;
if ( source.reflectivity ) this.reflectivity = source.reflectivity;
@@ -536,6 +545,7 @@ StandardNode.prototype.toJSON = function ( meta ) {
if ( this.clearCoat ) data.clearCoat = this.clearCoat.toJSON( meta ).uuid;
if ( this.clearCoatRoughness ) data.clearCoatRoughness = this.clearCoatRoughness.toJSON( meta ).uuid;
+ if ( this.clearCoatNormal ) data.clearCoatNormal = this.clearCoatNormal.toJSON( meta ).uuid;
if ( this.reflectivity ) data.reflectivity = this.reflectivity.toJSON( meta ).uuid;
| true |
Other | mrdoob | three.js | 57801e6c4693a675c4d96bea86895fe1ba7d3c09.json | fix gizmo overall scale hover | examples/js/controls/TransformControls.js | @@ -792,20 +792,20 @@ THREE.TransformControlsGizmo = function () {
[ new THREE.Line( lineGeometry, matLineBlue ), null, [ 0, - Math.PI / 2, 0 ]]
],
XYZ: [
- [ new THREE.Mesh( new THREE.OctahedronBufferGeometry( 0.1, 0 ), matWhiteTransperent ), [ 0, 0, 0 ], [ 0, 0, 0 ]]
+ [ new THREE.Mesh( new THREE.OctahedronBufferGeometry( 0.1, 0 ), matWhiteTransperent.clone() ), [ 0, 0, 0 ], [ 0, 0, 0 ]]
],
XY: [
- [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matYellowTransparent ), [ 0.15, 0.15, 0 ]],
+ [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matYellowTransparent.clone() ), [ 0.15, 0.15, 0 ]],
[ new THREE.Line( lineGeometry, matLineYellow ), [ 0.18, 0.3, 0 ], null, [ 0.125, 1, 1 ]],
[ new THREE.Line( lineGeometry, matLineYellow ), [ 0.3, 0.18, 0 ], [ 0, 0, Math.PI / 2 ], [ 0.125, 1, 1 ]]
],
YZ: [
- [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matCyanTransparent ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]],
+ [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matCyanTransparent.clone() ), [ 0, 0.15, 0.15 ], [ 0, Math.PI / 2, 0 ]],
[ new THREE.Line( lineGeometry, matLineCyan ), [ 0, 0.18, 0.3 ], [ 0, 0, Math.PI / 2 ], [ 0.125, 1, 1 ]],
[ new THREE.Line( lineGeometry, matLineCyan ), [ 0, 0.3, 0.18 ], [ 0, - Math.PI / 2, 0 ], [ 0.125, 1, 1 ]]
],
XZ: [
- [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matMagentaTransparent ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]],
+ [ new THREE.Mesh( new THREE.PlaneBufferGeometry( 0.295, 0.295 ), matMagentaTransparent.clone() ), [ 0.15, 0, 0.15 ], [ - Math.PI / 2, 0, 0 ]],
[ new THREE.Line( lineGeometry, matLineMagenta ), [ 0.18, 0, 0.3 ], null, [ 0.125, 1, 1 ]],
[ new THREE.Line( lineGeometry, matLineMagenta ), [ 0.3, 0, 0.18 ], [ 0, - Math.PI / 2, 0 ], [ 0.125, 1, 1 ]]
] | true |
Other | mrdoob | three.js | 57801e6c4693a675c4d96bea86895fe1ba7d3c09.json | fix gizmo overall scale hover | examples/jsm/controls/TransformControls.js | @@ -817,7 +817,7 @@ var TransformControlsGizmo = function () {
[ new Line( lineGeometry, matLineBlue ), null, [ 0, - Math.PI / 2, 0 ]]
],
XYZ: [
- [ new Mesh( new OctahedronBufferGeometry( 0.1, 0 ), matWhiteTransperent ), [ 0, 0, 0 ], [ 0, 0, 0 ]]
+ [ new Mesh( new OctahedronBufferGeometry( 0.1, 0 ), matWhiteTransperent.clone() ), [ 0, 0, 0 ], [ 0, 0, 0 ]]
],
XY: [
[ new Mesh( new PlaneBufferGeometry( 0.295, 0.295 ), matYellowTransparent ), [ 0.15, 0.15, 0 ]],
@@ -959,13 +959,13 @@ var TransformControlsGizmo = function () {
[ new Line( lineGeometry, matLineMagenta ), [ 0.98, 0, 0.855 ], [ 0, - Math.PI / 2, 0 ], [ 0.125, 1, 1 ]]
],
XYZX: [
- [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent ), [ 1.1, 0, 0 ]],
+ [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent.clone() ), [ 1.1, 0, 0 ]],
],
XYZY: [
- [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent ), [ 0, 1.1, 0 ]],
+ [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent.clone() ), [ 0, 1.1, 0 ]],
],
XYZZ: [
- [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent ), [ 0, 0, 1.1 ]],
+ [ new Mesh( new BoxBufferGeometry( 0.125, 0.125, 0.125 ), matWhiteTransperent.clone() ), [ 0, 0, 1.1 ]],
]
};
| true |
Other | mrdoob | three.js | d5a7bb17026ad02f61b4e5a45af3df1db72160ba.json | remove onError callback | examples/webgl_materials_cubemap_mipmaps.html | @@ -40,12 +40,10 @@
return new Promise( function ( resolve, reject) {
- new THREE.CubeTextureLoader().load( urls,function ( cubeTexture ) {
+ new THREE.CubeTextureLoader().load( urls, function ( cubeTexture ) {
resolve( cubeTexture );
- }, function ( error ) {
-
} );
| false |
Other | mrdoob | three.js | 0a837c38c7cd751c8760af1f979c0663af41c4ab.json | fix typo error | examples/webgl_materials_cubemap_mipmaps.html | @@ -28,7 +28,7 @@
init();
animate();
- //load custmized cube texture
+ //load customized cube texture
async function loadCubeTextureWithMipmaps() {
var path = 'textures/cube/angus/'; | false |
Other | mrdoob | three.js | 77fbbe2305a741f2bdf1b18fd6caed7b704527bd.json | remove unused argument width | examples/webgl_materials_cubemap_mipmaps.html | @@ -36,7 +36,7 @@
var mipmaps = [];
var maxLevel = 8;
- async function loadCubeTexture( urls, width ) {
+ async function loadCubeTexture( urls ) {
return new Promise( function ( resolve, reject) {
| false |
Other | mrdoob | three.js | 3c5f1416cc22254e342327378f8917da6257ef32.json | Add TransparancyFactor in FBXLoader | examples/jsm/loaders/FBXLoader.js | @@ -675,6 +675,7 @@ var FBXLoader = ( function () {
break;
case 'TransparentColor':
+ case 'TransparencyFactor':
parameters.alphaMap = self.getTexture( textureMap, child.ID );
parameters.transparent = true;
break; | false |
Other | mrdoob | three.js | c3ae0c88b563fba45827f79ff02111cef755037f.json | Fix THREE.Math.degToRad in example | examples/misc_controls_transform.html | @@ -83,7 +83,7 @@
case 17: // Ctrl
control.setTranslationSnap( 100 );
- control.setRotationSnap( Math.degToRad( 15 ) );
+ control.setRotationSnap( THREE.Math.degToRad( 15 ) );
break;
case 87: // W | false |
Other | mrdoob | three.js | e26a667459dc1b0bc2d0cfea66a044d84bd98f74.json | Remove JSM version of AWDLoader. | examples/jsm/loaders/AWDLoader.d.ts | @@ -1,51 +0,0 @@
-import {
- Bone,
- BufferGeometry,
- Loader,
- LoadingManager,
- Material,
- Matrix4,
- Mesh,
- Object3D,
- Texture
-} from '../../../src/Three';
-
-export class AWDLoader extends Loader {
-
- constructor( manager?: LoadingManager );
- materialFactory: any;
- path: string;
- trunk: Object3D;
-
- getBlock( id: number ): any;
- load( url: string, onLoad: ( result: Object3D ) => void, onProgress?: ( event: ProgressEvent ) => void, onError?: ( event: ErrorEvent ) => void ): void;
- loadTexture( url: string ): Texture;
- parse( data: ArrayBuffer ): Object3D;
- parseAnimatorSet(): object;
- parseAttrValue( type: number, value: number ): any;
- parseContainer(): Object3D;
- parseMaterial(): Material;
- parseMatrix4(): Matrix4;
- parseMeshData(): BufferGeometry[];
- parseMeshInstance(): Mesh;
- parseMeshPoseAnimation( poseOnly: boolean ): null;
- parseNextBlock(): void;
- parseProperties( expected: object ): object;
- parseSkeleton(): Bone[];
- parseSkeletonAnimation(): object[];
- parseSkeletonPose(): Matrix4[];
- parseTexture(): Texture;
- parseUserAttributes(): null;
- parseVertexAnimationSet(): object[];
- readU8(): number;
- readI8(): number;
- readU16(): number;
- readI16(): number;
- readU32(): number;
- readI32(): number;
- readF32(): number;
- readF64(): number;
- readUTF(): string;
- readUTFBytes( len: number ): string;
-
-} | true |
Other | mrdoob | three.js | e26a667459dc1b0bc2d0cfea66a044d84bd98f74.json | Remove JSM version of AWDLoader. | examples/jsm/loaders/AWDLoader.js | @@ -1,1235 +0,0 @@
-/**
- * Author: Pierre Lepers
- * Date: 09/12/2013 17:21
- */
-
-import {
- Bone,
- BufferAttribute,
- BufferGeometry,
- FileLoader,
- ImageLoader,
- Loader,
- Matrix4,
- Mesh,
- MeshPhongMaterial,
- Object3D,
- Texture
-} from "../../../build/three.module.js";
-
-var AWDLoader = ( function () {
-
- var //UNCOMPRESSED = 0,
- //DEFLATE = 1,
- //LZMA = 2,
-
- AWD_FIELD_INT8 = 1,
- AWD_FIELD_INT16 = 2,
- AWD_FIELD_INT32 = 3,
- AWD_FIELD_UINT8 = 4,
- AWD_FIELD_UINT16 = 5,
- AWD_FIELD_UINT32 = 6,
- AWD_FIELD_FLOAT32 = 7,
- AWD_FIELD_FLOAT64 = 8,
- AWD_FIELD_BOOL = 21,
- //AWD_FIELD_COLOR = 22,
- AWD_FIELD_BADDR = 23,
- //AWD_FIELD_STRING = 31,
- //AWD_FIELD_BYTEARRAY = 32,
- AWD_FIELD_VECTOR2x1 = 41,
- AWD_FIELD_VECTOR3x1 = 42,
- AWD_FIELD_VECTOR4x1 = 43,
- AWD_FIELD_MTX3x2 = 44,
- AWD_FIELD_MTX3x3 = 45,
- AWD_FIELD_MTX4x3 = 46,
- AWD_FIELD_MTX4x4 = 47,
-
- BOOL = 21,
- //COLOR = 22,
- BADDR = 23,
-
- //INT8 = 1,
- //INT16 = 2,
- //INT32 = 3,
- UINT8 = 4,
- UINT16 = 5,
- //UINT32 = 6,
- FLOAT32 = 7,
- FLOAT64 = 8;
-
- var littleEndian = true;
-
- function Block() {
-
- this.id = 0;
- this.data = null;
- this.namespace = 0;
- this.flags = 0;
-
- }
-
- function AWDProperties() {}
-
- AWDProperties.prototype = {
- set: function ( key, value ) {
-
- this[ key ] = value;
-
- },
-
- get: function ( key, fallback ) {
-
- if ( this.hasOwnProperty( key ) ) {
-
- return this[ key ];
-
- } else {
-
- return fallback;
-
- }
-
- }
- };
-
- var AWDLoader = function ( manager ) {
-
- Loader.call( this, manager );
-
- this.trunk = new Object3D();
-
- this.materialFactory = undefined;
-
- this._url = '';
- this._baseDir = '';
-
- this._data = undefined;
- this._ptr = 0;
-
- this._version = [];
- this._streaming = false;
- this._optimized_for_accuracy = false;
- this._compression = 0;
- this._bodylen = 0xFFFFFFFF;
-
- this._blocks = [ new Block() ];
-
- this._accuracyMatrix = false;
- this._accuracyGeo = false;
- this._accuracyProps = false;
-
- };
-
- AWDLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
-
- constructor: AWDLoader,
-
- load: function ( url, onLoad, onProgress, onError ) {
-
- var scope = this;
-
- this._url = url;
- this._baseDir = url.substr( 0, url.lastIndexOf( '/' ) + 1 );
-
- var loader = new FileLoader( this.manager );
- loader.setPath( this.path );
- loader.setResponseType( 'arraybuffer' );
- loader.load( url, function ( text ) {
-
- onLoad( scope.parse( text ) );
-
- }, onProgress, onError );
-
- },
-
- parse: function ( data ) {
-
- var blen = data.byteLength;
-
- this._ptr = 0;
- this._data = new DataView( data );
-
- this._parseHeader( );
-
- if ( this._compression != 0 ) {
-
- console.error( 'compressed AWD not supported' );
-
- }
-
- if ( ! this._streaming && this._bodylen != data.byteLength - this._ptr ) {
-
- console.error( 'AWDLoader: body len does not match file length', this._bodylen, blen - this._ptr );
-
- }
-
- while ( this._ptr < blen ) {
-
- this.parseNextBlock();
-
- }
-
- return this.trunk;
-
- },
-
- parseNextBlock: function () {
-
- var assetData,
- block,
- blockId = this.readU32(),
- ns = this.readU8(),
- type = this.readU8(),
- flags = this.readU8(),
- len = this.readU32();
-
-
- switch ( type ) {
-
- case 1:
- assetData = this.parseMeshData();
- break;
-
- case 22:
- assetData = this.parseContainer();
- break;
-
- case 23:
- assetData = this.parseMeshInstance();
- break;
-
- case 81:
- assetData = this.parseMaterial();
- break;
-
- case 82:
- assetData = this.parseTexture();
- break;
-
- case 101:
- assetData = this.parseSkeleton();
- break;
-
- case 112:
- assetData = this.parseMeshPoseAnimation( false );
- break;
-
- case 113:
- assetData = this.parseVertexAnimationSet();
- break;
-
- case 102:
- assetData = this.parseSkeletonPose();
- break;
-
- case 103:
- assetData = this.parseSkeletonAnimation();
- break;
-
- case 122:
- assetData = this.parseAnimatorSet();
- break;
-
- default:
- //debug('Ignoring block!',type, len);
- this._ptr += len;
- break;
-
- }
-
-
- // Store block reference for later use
- this._blocks[ blockId ] = block = new Block();
- block.data = assetData;
- block.id = blockId;
- block.namespace = ns;
- block.flags = flags;
-
-
- },
-
- _parseHeader: function () {
-
- var version = this._version,
- awdmagic = ( this.readU8() << 16 ) | ( this.readU8() << 8 ) | this.readU8();
-
- if ( awdmagic != 4282180 )
- throw new Error( "AWDLoader - bad magic" );
-
- version[ 0 ] = this.readU8();
- version[ 1 ] = this.readU8();
-
- var flags = this.readU16();
-
- this._streaming = ( flags & 0x1 ) == 0x1;
-
- if ( ( version[ 0 ] === 2 ) && ( version[ 1 ] === 1 ) ) {
-
- this._accuracyMatrix = ( flags & 0x2 ) === 0x2;
- this._accuracyGeo = ( flags & 0x4 ) === 0x4;
- this._accuracyProps = ( flags & 0x8 ) === 0x8;
-
- }
-
- this._geoNrType = this._accuracyGeo ? FLOAT64 : FLOAT32;
- this._matrixNrType = this._accuracyMatrix ? FLOAT64 : FLOAT32;
- this._propsNrType = this._accuracyProps ? FLOAT64 : FLOAT32;
-
- this._optimized_for_accuracy = ( flags & 0x2 ) === 0x2;
-
- this._compression = this.readU8();
- this._bodylen = this.readU32();
-
- },
-
- parseContainer: function () {
-
- var parent,
- ctr = new Object3D(),
- par_id = this.readU32(),
- mtx = this.parseMatrix4();
-
- ctr.name = this.readUTF();
- ctr.applyMatrix4( mtx );
-
- parent = this._blocks[ par_id ].data || this.trunk;
- parent.add( ctr );
-
- this.parseProperties( {
- 1: this._matrixNrType,
- 2: this._matrixNrType,
- 3: this._matrixNrType,
- 4: UINT8
- } );
-
- ctr.extra = this.parseUserAttributes();
-
- return ctr;
-
- },
-
- parseMeshInstance: function () {
-
- var name,
- mesh, geometries, meshLen, meshes,
- par_id, data_id,
- mtx,
- materials, mat, mat_id,
- num_materials,
- parent,
- i;
-
- par_id = this.readU32();
- mtx = this.parseMatrix4();
- name = this.readUTF();
- data_id = this.readU32();
- num_materials = this.readU16();
-
- geometries = this.getBlock( data_id );
-
- materials = [];
-
- for ( i = 0; i < num_materials; i ++ ) {
-
- mat_id = this.readU32();
- mat = this.getBlock( mat_id );
- materials.push( mat );
-
- }
-
- meshLen = geometries.length;
- meshes = [];
-
- // TODO : BufferGeometry don't support "geometryGroups" for now.
- // so we create sub meshes for each groups
- if ( meshLen > 1 ) {
-
- mesh = new Object3D();
- for ( i = 0; i < meshLen; i ++ ) {
-
- var sm = new Mesh( geometries[ i ] );
- meshes.push( sm );
- mesh.add( sm );
-
- }
-
- } else {
-
- mesh = new Mesh( geometries[ 0 ] );
- meshes.push( mesh );
-
- }
-
- mesh.applyMatrix4( mtx );
- mesh.name = name;
-
-
- parent = this.getBlock( par_id ) || this.trunk;
- parent.add( mesh );
-
-
- var matLen = materials.length;
- var maxLen = Math.max( meshLen, matLen );
- for ( i = 0; i < maxLen; i ++ )
- meshes[ i % meshLen ].material = materials[ i % matLen ];
-
-
- // Ignore for now
- this.parseProperties( null );
- mesh.extra = this.parseUserAttributes();
-
- return mesh;
-
- },
-
- parseMaterial: function () {
-
- var name,
- type,
- props,
- mat,
- attributes,
- num_methods,
- methods_parsed;
-
- name = this.readUTF();
- type = this.readU8();
- num_methods = this.readU8();
-
- //log( "AWDLoader parseMaterial ",name )
-
- // Read material numerical properties
- // (1=color, 2=bitmap url, 11=alpha_blending, 12=alpha_threshold, 13=repeat)
- props = this.parseProperties( {
- 1: AWD_FIELD_INT32,
- 2: AWD_FIELD_BADDR,
- 11: AWD_FIELD_BOOL,
- 12: AWD_FIELD_FLOAT32,
- 13: AWD_FIELD_BOOL
- } );
-
- methods_parsed = 0;
-
- while ( methods_parsed < num_methods ) {
-
- // read method_type before
- this.readU16();
- this.parseProperties( null );
- this.parseUserAttributes();
-
- }
-
- attributes = this.parseUserAttributes();
-
- if ( this.materialFactory !== undefined ) {
-
- mat = this.materialFactory( name );
- if ( mat ) return mat;
-
- }
-
- mat = new MeshPhongMaterial();
-
- if ( type === 1 ) {
-
- // Color material
- mat.color.setHex( props.get( 1, 0xcccccc ) );
-
- } else if ( type === 2 ) {
-
- // Bitmap material
- var tex_addr = props.get( 2, 0 );
- mat.map = this.getBlock( tex_addr );
-
- }
-
- mat.extra = attributes;
- mat.alphaThreshold = props.get( 12, 0.0 );
- mat.repeat = props.get( 13, false );
-
-
- return mat;
-
- },
-
- parseTexture: function () {
-
- var name = this.readUTF(),
- type = this.readU8(),
- asset,
- data_len;
-
- // External
- if ( type === 0 ) {
-
- data_len = this.readU32();
- var url = this.readUTFBytes( data_len );
- console.log( url );
-
- asset = this.loadTexture( url );
- asset.userData = {};
- asset.userData.name = name;
-
- } else {
- // embed texture not supported
- }
- // Ignore for now
- this.parseProperties( null );
-
- this.parseUserAttributes();
- return asset;
-
- },
-
- loadTexture: function ( url ) {
-
- var tex = new Texture();
-
- var loader = new ImageLoader( this.manager );
-
- loader.load( this._baseDir + url, function ( image ) {
-
- tex.image = image;
- tex.needsUpdate = true;
-
- } );
-
- return tex;
-
- },
-
- parseSkeleton: function () {
-
- // Array<Bone>
- //
- this.readUTF();
- var num_joints = this.readU16(),
- skeleton = [],
- joints_parsed = 0;
-
- this.parseProperties( null );
-
- while ( joints_parsed < num_joints ) {
-
- var joint, ibp;
-
- // Ignore joint id
- this.readU16();
-
- joint = new Bone();
- joint.parent = this.readU16() - 1; // 0=null in AWD
- joint.name = this.readUTF();
-
- ibp = this.parseMatrix4();
- joint.skinMatrix = ibp;
-
- // Ignore joint props/attributes for now
- this.parseProperties( null );
- this.parseUserAttributes();
-
- skeleton.push( joint );
- joints_parsed ++;
-
- }
-
- // Discard attributes for now
- this.parseUserAttributes();
-
-
- return skeleton;
-
- },
-
- parseSkeletonPose: function () {
-
- var name = this.readUTF();
-
- var num_joints = this.readU16();
- this.parseProperties( null );
-
- // debug( 'parse Skeleton Pose. joints : ' + num_joints);
-
- var pose = [];
-
- var joints_parsed = 0;
-
- while ( joints_parsed < num_joints ) {
-
- var has_transform; //:uint;
- var mtx_data;
-
- has_transform = this.readU8();
-
- if ( has_transform === 1 ) {
-
- mtx_data = this.parseMatrix4();
-
- } else {
-
- mtx_data = new Matrix4();
-
- }
- pose[ joints_parsed ] = mtx_data;
- joints_parsed ++;
-
- }
-
- // Skip attributes for now
- this.parseUserAttributes();
-
- return pose;
-
- },
-
- parseSkeletonAnimation: function () {
-
- var frame_dur;
- var pose_addr;
- var pose;
-
- var name = this.readUTF();
-
- var clip = [];
-
- var num_frames = this.readU16();
- this.parseProperties( null );
-
- var frames_parsed = 0;
-
- // debug( 'parse Skeleton Animation. frames : ' + num_frames);
-
- while ( frames_parsed < num_frames ) {
-
- pose_addr = this.readU32();
- frame_dur = this.readU16();
-
- pose = this._blocks[ pose_addr ].data;
- // debug( 'pose address ',pose[2].elements[12],pose[2].elements[13],pose[2].elements[14] );
- clip.push( {
- pose: pose,
- duration: frame_dur
- } );
-
- frames_parsed ++;
-
- }
-
- if ( clip.length === 0 ) {
-
- // debug("Could not this SkeletonClipNode, because no Frames where set.");
- return;
-
- }
- // Ignore attributes for now
- this.parseUserAttributes();
- return clip;
-
- },
-
- parseVertexAnimationSet: function () {
-
- var poseBlockAdress,
- name = this.readUTF(),
- num_frames = this.readU16(),
- props = this.parseProperties( { 1: UINT16 } ),
- frames_parsed = 0,
- skeletonFrames = [];
-
- while ( frames_parsed < num_frames ) {
-
- poseBlockAdress = this.readU32();
- skeletonFrames.push( this._blocks[ poseBlockAdress ].data );
- frames_parsed ++;
-
- }
-
- this.parseUserAttributes();
-
-
- return skeletonFrames;
-
- },
-
- parseAnimatorSet: function () {
-
- var animSetBlockAdress; //:int
-
- var targetAnimationSet; //:AnimationSetBase;
- var name = this.readUTF();
- var type = this.readU16();
-
- var props = this.parseProperties( { 1: BADDR } );
-
- animSetBlockAdress = this.readU32();
- var targetMeshLength = this.readU16();
-
- var meshAdresses = []; //:Vector.<uint> = new Vector.<uint>;
-
- for ( var i = 0; i < targetMeshLength; i ++ )
- meshAdresses.push( this.readU32() );
-
- var activeState = this.readU16();
- var autoplay = Boolean( this.readU8() );
- this.parseUserAttributes();
- this.parseUserAttributes();
-
- var targetMeshes = []; //:Vector.<Mesh> = new Vector.<Mesh>;
-
- for ( i = 0; i < meshAdresses.length; i ++ ) {
-
- // returnedArray = getAssetByID(meshAdresses[i], [AssetType.MESH]);
- // if (returnedArray[0])
- targetMeshes.push( this._blocks[ meshAdresses[ i ] ].data );
-
- }
-
- targetAnimationSet = this._blocks[ animSetBlockAdress ].data;
- var thisAnimator;
-
- if ( type == 1 ) {
-
-
- thisAnimator = {
- animationSet: targetAnimationSet,
- skeleton: this._blocks[ props.get( 1, 0 ) ].data
- };
-
- } else if ( type == 2 ) {
- // debug( "vertex Anim???");
- }
-
-
- for ( i = 0; i < targetMeshes.length; i ++ ) {
-
- targetMeshes[ i ].animator = thisAnimator;
-
- }
- // debug("Parsed a Animator: Name = " + name);
-
- return thisAnimator;
-
- },
-
- parseMeshData: function () {
-
- var name = this.readUTF(),
- num_subs = this.readU16(),
- geom,
- subs_parsed = 0,
- buffer,
- geometries = [];
-
- // Ignore for now
- this.parseProperties( { 1: this._geoNrType, 2: this._geoNrType } );
-
- // Loop through sub meshes
- while ( subs_parsed < num_subs ) {
-
- var sm_len, sm_end, attrib;
-
- geom = new BufferGeometry();
- geom.name = name;
- geometries.push( geom );
-
-
- sm_len = this.readU32();
- sm_end = this._ptr + sm_len;
-
-
- // Ignore for now
- this.parseProperties( { 1: this._geoNrType, 2: this._geoNrType } );
-
- // Loop through data streams
- while ( this._ptr < sm_end ) {
-
- var idx = 0,
- str_type = this.readU8(),
- str_ftype = this.readU8(),
- str_len = this.readU32(),
- str_end = str_len + this._ptr;
-
- if ( str_type === 1 ) {
-
- // VERTICES
-
- buffer = new Float32Array( ( str_len / 12 ) * 3 );
- attrib = new BufferAttribute( buffer, 3 );
-
- geom.setAttribute( 'position', attrib );
- idx = 0;
-
- while ( this._ptr < str_end ) {
-
- buffer[ idx ] = - this.readF32();
- buffer[ idx + 1 ] = this.readF32();
- buffer[ idx + 2 ] = this.readF32();
- idx += 3;
-
- }
-
- } else if ( str_type === 2 ) {
-
- // INDICES
-
- buffer = new Uint16Array( str_len / 2 );
- attrib = new BufferAttribute( buffer, 1 );
- geom.setIndex( attrib );
-
- idx = 0;
-
- while ( this._ptr < str_end ) {
-
- buffer[ idx + 1 ] = this.readU16();
- buffer[ idx ] = this.readU16();
- buffer[ idx + 2 ] = this.readU16();
- idx += 3;
-
- }
-
- } else if ( str_type === 3 ) {
-
- // UVS
-
- buffer = new Float32Array( ( str_len / 8 ) * 2 );
- attrib = new BufferAttribute( buffer, 2 );
-
- geom.setAttribute( 'uv', attrib );
- idx = 0;
-
- while ( this._ptr < str_end ) {
-
- buffer[ idx ] = this.readF32();
- buffer[ idx + 1 ] = 1.0 - this.readF32();
- idx += 2;
-
- }
-
- } else if ( str_type === 4 ) {
-
- // NORMALS
-
- buffer = new Float32Array( ( str_len / 12 ) * 3 );
- attrib = new BufferAttribute( buffer, 3 );
- geom.setAttribute( 'normal', attrib );
- idx = 0;
-
- while ( this._ptr < str_end ) {
-
- buffer[ idx ] = - this.readF32();
- buffer[ idx + 1 ] = this.readF32();
- buffer[ idx + 2 ] = this.readF32();
- idx += 3;
-
- }
-
- } else {
-
- this._ptr = str_end;
-
- }
-
- }
-
- this.parseUserAttributes();
-
- geom.computeBoundingSphere();
- subs_parsed ++;
-
- }
-
- //geom.computeFaceNormals();
-
- this.parseUserAttributes();
- //finalizeAsset(geom, name);
-
- return geometries;
-
- },
-
- parseMeshPoseAnimation: function ( poseOnly ) {
-
- var num_frames = 1,
- num_submeshes,
- frames_parsed,
- subMeshParsed,
-
- str_len,
- str_end,
- geom,
- idx = 0,
- clip = {},
- num_Streams,
- streamsParsed,
- streamtypes = [],
-
- props,
- name = this.readUTF(),
- geoAdress = this.readU32();
-
- var mesh = this.getBlock( geoAdress );
-
- if ( mesh === null ) {
-
- console.log( "parseMeshPoseAnimation target mesh not found at:", geoAdress );
- return;
-
- }
-
- geom = mesh.geometry;
- geom.morphTargets = [];
-
- if ( ! poseOnly )
- num_frames = this.readU16();
-
- num_submeshes = this.readU16();
- num_Streams = this.readU16();
-
- // debug("VA num_frames : ", num_frames );
- // debug("VA num_submeshes : ", num_submeshes );
- // debug("VA numstreams : ", num_Streams );
-
- streamsParsed = 0;
- while ( streamsParsed < num_Streams ) {
-
- streamtypes.push( this.readU16() );
- streamsParsed ++;
-
- }
- props = this.parseProperties( { 1: BOOL, 2: BOOL } );
-
- clip.looping = props.get( 1, true );
- clip.stitchFinalFrame = props.get( 2, false );
-
- frames_parsed = 0;
-
- while ( frames_parsed < num_frames ) {
-
- this.readU16();
- subMeshParsed = 0;
-
- while ( subMeshParsed < num_submeshes ) {
-
- streamsParsed = 0;
- str_len = this.readU32();
- str_end = this._ptr + str_len;
-
- while ( streamsParsed < num_Streams ) {
-
- if ( streamtypes[ streamsParsed ] === 1 ) {
-
- //geom.setAttribute( 'morphTarget'+frames_parsed, Float32Array, str_len/12, 3 );
- var buffer = new Float32Array( str_len / 4 );
- geom.morphTargets.push( {
- array: buffer
- } );
-
- //buffer = geom.attributes['morphTarget'+frames_parsed].array
- idx = 0;
-
- while ( this._ptr < str_end ) {
-
- buffer[ idx ] = this.readF32();
- buffer[ idx + 1 ] = this.readF32();
- buffer[ idx + 2 ] = this.readF32();
- idx += 3;
-
- }
-
-
- subMeshParsed ++;
-
- } else
- this._ptr = str_end;
- streamsParsed ++;
-
- }
-
- }
-
-
- frames_parsed ++;
-
- }
-
- this.parseUserAttributes();
-
- return null;
-
- },
-
- getBlock: function ( id ) {
-
- return this._blocks[ id ].data;
-
- },
-
- parseMatrix4: function () {
-
- var mtx = new Matrix4();
- var e = mtx.elements;
-
- e[ 0 ] = this.readF32();
- e[ 1 ] = this.readF32();
- e[ 2 ] = this.readF32();
- e[ 3 ] = 0.0;
- //e[3] = 0.0;
-
- e[ 4 ] = this.readF32();
- e[ 5 ] = this.readF32();
- e[ 6 ] = this.readF32();
- //e[7] = this.readF32();
- e[ 7 ] = 0.0;
-
- e[ 8 ] = this.readF32();
- e[ 9 ] = this.readF32();
- e[ 10 ] = this.readF32();
- //e[11] = this.readF32();
- e[ 11 ] = 0.0;
-
- e[ 12 ] = - this.readF32();
- e[ 13 ] = this.readF32();
- e[ 14 ] = this.readF32();
- //e[15] = this.readF32();
- e[ 15 ] = 1.0;
- return mtx;
-
- },
-
- parseProperties: function ( expected ) {
-
- var list_len = this.readU32();
- var list_end = this._ptr + list_len;
-
- var props = new AWDProperties();
-
- if ( expected ) {
-
- while ( this._ptr < list_end ) {
-
- var key = this.readU16();
- var len = this.readU32();
- var type;
-
- if ( expected.hasOwnProperty( key ) ) {
-
- type = expected[ key ];
- props.set( key, this.parseAttrValue( type, len ) );
-
- } else {
-
- this._ptr += len;
-
- }
-
- }
-
- }
-
- return props;
-
- },
-
- parseUserAttributes: function () {
-
- // skip for now
- this._ptr = this.readU32() + this._ptr;
- return null;
-
- },
-
- parseAttrValue: function ( type, len ) {
-
- var elem_len;
- var read_func;
-
- switch ( type ) {
-
- case AWD_FIELD_INT8:
- elem_len = 1;
- read_func = this.readI8;
- break;
-
- case AWD_FIELD_INT16:
- elem_len = 2;
- read_func = this.readI16;
- break;
-
- case AWD_FIELD_INT32:
- elem_len = 4;
- read_func = this.readI32;
- break;
-
- case AWD_FIELD_BOOL:
- case AWD_FIELD_UINT8:
- elem_len = 1;
- read_func = this.readU8;
- break;
-
- case AWD_FIELD_UINT16:
- elem_len = 2;
- read_func = this.readU16;
- break;
-
- case AWD_FIELD_UINT32:
- case AWD_FIELD_BADDR:
- elem_len = 4;
- read_func = this.readU32;
- break;
-
- case AWD_FIELD_FLOAT32:
- elem_len = 4;
- read_func = this.readF32;
- break;
-
- case AWD_FIELD_FLOAT64:
- elem_len = 8;
- read_func = this.readF64;
- break;
-
- case AWD_FIELD_VECTOR2x1:
- case AWD_FIELD_VECTOR3x1:
- case AWD_FIELD_VECTOR4x1:
- case AWD_FIELD_MTX3x2:
- case AWD_FIELD_MTX3x3:
- case AWD_FIELD_MTX4x3:
- case AWD_FIELD_MTX4x4:
- elem_len = 8;
- read_func = this.readF64;
- break;
-
- }
-
- if ( elem_len < len ) {
-
- var list;
- var num_read;
- var num_elems;
-
- list = [];
- num_read = 0;
- num_elems = len / elem_len;
-
- while ( num_read < num_elems ) {
-
- list.push( read_func.call( this ) );
- num_read ++;
-
- }
-
- return list;
-
- } else {
-
- return read_func.call( this );
-
- }
-
- },
-
- readU8: function () {
-
- return this._data.getUint8( this._ptr ++ );
-
- },
- readI8: function () {
-
- return this._data.getInt8( this._ptr ++ );
-
- },
- readU16: function () {
-
- var a = this._data.getUint16( this._ptr, littleEndian );
- this._ptr += 2;
- return a;
-
- },
- readI16: function () {
-
- var a = this._data.getInt16( this._ptr, littleEndian );
- this._ptr += 2;
- return a;
-
- },
- readU32: function () {
-
- var a = this._data.getUint32( this._ptr, littleEndian );
- this._ptr += 4;
- return a;
-
- },
- readI32: function () {
-
- var a = this._data.getInt32( this._ptr, littleEndian );
- this._ptr += 4;
- return a;
-
- },
- readF32: function () {
-
- var a = this._data.getFloat32( this._ptr, littleEndian );
- this._ptr += 4;
- return a;
-
- },
- readF64: function () {
-
- var a = this._data.getFloat64( this._ptr, littleEndian );
- this._ptr += 8;
- return a;
-
- },
-
- /**
- * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.
- * @param {Array.<number>} bytes UTF-8 byte array.
- * @return {string} 16-bit Unicode string.
- */
- readUTF: function () {
-
- var len = this.readU16();
- return this.readUTFBytes( len );
-
- },
-
- /**
- * Converts a UTF-8 byte array to JavaScript's 16-bit Unicode.
- * @param {Array.<number>} bytes UTF-8 byte array.
- * @return {string} 16-bit Unicode string.
- */
- readUTFBytes: function ( len ) {
-
- // TODO(user): Use native implementations if/when available
- var out = [], c = 0;
-
- while ( out.length < len ) {
-
- var c1 = this._data.getUint8( this._ptr ++, littleEndian );
- if ( c1 < 128 ) {
-
- out[ c ++ ] = String.fromCharCode( c1 );
-
- } else if ( c1 > 191 && c1 < 224 ) {
-
- var c2 = this._data.getUint8( this._ptr ++, littleEndian );
- out[ c ++ ] = String.fromCharCode( ( c1 & 31 ) << 6 | c2 & 63 );
-
- } else {
-
- var c2 = this._data.getUint8( this._ptr ++, littleEndian );
- var c3 = this._data.getUint8( this._ptr ++, littleEndian );
- out[ c ++ ] = String.fromCharCode( ( c1 & 15 ) << 12 | ( c2 & 63 ) << 6 | c3 & 63 );
-
- }
-
- }
- return out.join( '' );
-
- }
-
- } );
-
- return AWDLoader;
-
-} )();
-
-export { AWDLoader }; | true |
Other | mrdoob | three.js | aa05a29eeca32915d8e28565febe789194a04e1d.json | Remove animation loop | examples/webgl_loader_gcode.html | @@ -23,14 +23,14 @@
var camera, scene, renderer;
init();
- animate();
+ render();
function init() {
container = document.createElement( 'div' );
document.body.appendChild( container );
- camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 0.1, 10000 );
+ camera = new THREE.PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 1000 );
camera.position.set( 0, 0, 70 );
scene = new THREE.Scene();
@@ -41,6 +41,8 @@
object.position.set( - 100, - 20, 100 );
scene.add( object );
+ render();
+
} );
renderer = new THREE.WebGLRenderer();
@@ -49,6 +51,9 @@
container.appendChild( renderer.domElement );
var controls = new OrbitControls( camera, renderer.domElement );
+ controls.addEventListener( 'change', render ); // use if there is no animation loop
+ controls.minDistance = 10;
+ controls.maxDistance = 100;
window.addEventListener( 'resize', resize, false );
@@ -61,15 +66,16 @@
renderer.setSize( window.innerWidth, window.innerHeight );
+ render();
+
}
- function animate() {
+ function render() {
renderer.render( scene, camera );
- requestAnimationFrame( animate );
-
}
+
</script>
</body> | false |
Other | mrdoob | three.js | f5d10bc88cc029d695adb08828ccf2e6d2d87621.json | Upgrade dat.gui to 0.7.7. | examples/jsm/libs/dat.gui.module.js | @@ -285,7 +285,7 @@ var Common = {
},
isFunction: function isFunction( obj ) {
- return Object.prototype.toString.call( obj ) === '[object Function]';
+ return obj instanceof Function;
}
};
@@ -959,9 +959,10 @@ Object.defineProperty( Color.prototype, 'a', {
Object.defineProperty( Color.prototype, 'hex', {
get: function get$$1() {
- if ( ! this.__state.space !== 'HEX' ) {
+ if ( this.__state.space !== 'HEX' ) {
this.__state.hex = ColorMath.rgb_to_hex( this.r, this.g, this.b );
+ this.__state.space = 'HEX';
}
return this.__state.hex; | false |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/CameraNode.js | @@ -202,6 +202,8 @@ CameraNode.prototype.copy = function ( source ) {
}
+ return this;
+
};
CameraNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/ColorsNode.js | @@ -34,6 +34,8 @@ ColorsNode.prototype.copy = function ( source ) {
this.index = source.index;
+ return this;
+
};
ColorsNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/LightNode.js | @@ -40,6 +40,8 @@ LightNode.prototype.copy = function ( source ) {
this.scope = source.scope;
+ return this;
+
};
LightNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/NormalNode.js | @@ -84,6 +84,8 @@ NormalNode.prototype.copy = function ( source ) {
this.scope = source.scope;
+ return this;
+
};
NormalNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/PositionNode.js | @@ -114,6 +114,8 @@ PositionNode.prototype.copy = function ( source ) {
this.scope = source.scope;
+ return this;
+
};
PositionNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/ResolutionNode.js | @@ -43,6 +43,8 @@ ResolutionNode.prototype.copy = function ( source ) {
this.renderer = source.renderer;
+ return this;
+
};
ResolutionNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/ScreenUVNode.js | @@ -43,6 +43,8 @@ ScreenUVNode.prototype.copy = function ( source ) {
this.resolution = source.resolution;
+ return this;
+
};
ScreenUVNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/accessors/UVNode.js | @@ -36,6 +36,8 @@ UVNode.prototype.copy = function ( source ) {
this.index = source.index;
+ return this;
+
};
UVNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/bsdfs/BlinnExponentToRoughnessNode.js | @@ -29,6 +29,8 @@ BlinnExponentToRoughnessNode.prototype.copy = function ( source ) {
this.blinnExponent = source.blinnExponent;
+ return this;
+
};
BlinnExponentToRoughnessNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/bsdfs/RoughnessToBlinnExponentNode.js | @@ -71,6 +71,8 @@ RoughnessToBlinnExponentNode.prototype.copy = function ( source ) {
this.texture = source.texture;
+ return this;
+
};
RoughnessToBlinnExponentNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/AttributeNode.js | @@ -49,6 +49,8 @@ AttributeNode.prototype.copy = function ( source ) {
this.type = source.type;
+ return this;
+
};
AttributeNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/ConstNode.js | @@ -102,6 +102,8 @@ ConstNode.prototype.copy = function ( source ) {
this.parse( source.src, source.useDefine );
+ return this;
+
};
ConstNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/FunctionCallNode.js | @@ -70,6 +70,8 @@ FunctionCallNode.prototype.copy = function ( source ) {
this.value = source.value;
+ return this;
+
};
FunctionCallNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/FunctionNode.js | @@ -226,6 +226,8 @@ FunctionNode.prototype.copy = function ( source ) {
if ( source.type !== undefined ) this.type = source.type;
+ return this;
+
};
FunctionNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/InputNode.js | @@ -38,6 +38,8 @@ InputNode.prototype.copy = function ( source ) {
if ( source.readonly !== undefined ) this.readonly = source.readonly;
+ return this;
+
};
InputNode.prototype.createJSONNode = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/Node.js | @@ -147,6 +147,8 @@ Node.prototype = {
if ( source.userData !== undefined ) this.userData = JSON.parse( JSON.stringify( source.userData ) );
+ return this;
+
},
createJSONNode: function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/core/VarNode.js | @@ -43,6 +43,8 @@ VarNode.prototype.copy = function ( source ) {
this.type = source.type;
this.value = source.value;
+ return this;
+
};
VarNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/effects/BlurNode.js | @@ -142,6 +142,8 @@ BlurNode.prototype.copy = function ( source ) {
this.blurX = source.blurX;
this.blurY = source.blurY;
+ return this;
+
};
BlurNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/effects/ColorAdjustmentNode.js | @@ -113,6 +113,8 @@ ColorAdjustmentNode.prototype.copy = function ( source ) {
this.adjustment = source.adjustment;
this.method = source.method;
+ return this;
+
};
ColorAdjustmentNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/effects/LuminanceNode.js | @@ -52,6 +52,8 @@ LuminanceNode.prototype.copy = function ( source ) {
this.rgb = source.rgb;
+ return this;
+
};
LuminanceNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/BoolNode.js | @@ -28,6 +28,8 @@ BoolNode.prototype.copy = function ( source ) {
this.value = source.value;
+ return this;
+
};
BoolNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/ColorNode.js | @@ -33,6 +33,8 @@ ColorNode.prototype.copy = function ( source ) {
this.value.copy( source );
+ return this;
+
};
ColorNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/CubeTextureNode.js | @@ -84,6 +84,8 @@ CubeTextureNode.prototype.copy = function ( source ) {
if ( source.bias ) this.bias = source.bias;
+ return this;
+
};
CubeTextureNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/FloatNode.js | @@ -28,6 +28,8 @@ FloatNode.prototype.copy = function ( source ) {
this.value = source.value;
+ return this;
+
};
FloatNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/IntNode.js | @@ -28,6 +28,8 @@ IntNode.prototype.copy = function ( source ) {
this.value = source.value;
+ return this;
+
};
IntNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/Matrix3Node.js | @@ -51,6 +51,8 @@ Matrix3Node.prototype.copy = function ( source ) {
this.value.fromArray( source.elements );
+ return this;
+
};
Matrix3Node.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/Matrix4Node.js | @@ -50,6 +50,8 @@ Matrix4Node.prototype.copy = function ( source ) {
this.scope.value.fromArray( source.elements );
+ return this;
+
};
Matrix4Node.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/RTTNode.js | @@ -135,6 +135,8 @@ RTTNode.prototype.copy = function ( source ) {
this.saveTo = source.saveTo;
+ return this;
+
};
RTTNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/ReflectorNode.js | @@ -67,6 +67,8 @@ ReflectorNode.prototype.copy = function ( source ) {
this.scope.mirror = source.mirror;
+ return this;
+
};
ReflectorNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/TextureNode.js | @@ -89,6 +89,8 @@ TextureNode.prototype.copy = function ( source ) {
if ( source.bias ) this.bias = source.bias;
if ( source.project !== undefined ) this.project = source.project;
+ return this;
+
};
TextureNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/Vector2Node.js | @@ -33,6 +33,8 @@ Vector2Node.prototype.copy = function ( source ) {
this.value.copy( source );
+ return this;
+
};
Vector2Node.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/Vector3Node.js | @@ -33,6 +33,8 @@ Vector3Node.prototype.copy = function ( source ) {
this.value.copy( source );
+ return this;
+
};
Vector3Node.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/inputs/Vector4Node.js | @@ -33,6 +33,8 @@ Vector4Node.prototype.copy = function ( source ) {
this.value.copy( source );
+ return this;
+
};
Vector4Node.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/materials/NodeMaterial.js | @@ -144,6 +144,8 @@ NodeMaterial.prototype.copy = function ( source ) {
}
+ return this;
+
};
NodeMaterial.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/materials/nodes/PhongNode.js | @@ -372,6 +372,8 @@ PhongNode.prototype.copy = function ( source ) {
if ( source.environment ) this.environment = source.environment;
if ( source.environmentAlpha ) this.environmentAlpha = source.environmentAlpha;
+ return this;
+
};
PhongNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/materials/nodes/RawNode.js | @@ -41,6 +41,8 @@ RawNode.prototype.copy = function ( source ) {
this.value = source.value;
+ return this;
+
};
RawNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/materials/nodes/SpriteNode.js | @@ -202,6 +202,8 @@ SpriteNode.prototype.copy = function ( source ) {
if ( source.alpha ) this.alpha = source.alpha;
+ return this;
+
};
SpriteNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/materials/nodes/StandardNode.js | @@ -459,6 +459,8 @@ StandardNode.prototype.copy = function ( source ) {
if ( source.environment ) this.environment = source.environment;
+ return this;
+
};
StandardNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/math/CondNode.js | @@ -99,6 +99,8 @@ CondNode.prototype.copy = function ( source ) {
this.ifNode = source.ifNode;
this.elseNode = source.elseNode;
+ return this;
+
};
CondNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/math/MathNode.js | @@ -243,6 +243,8 @@ MathNode.prototype.copy = function ( source ) {
this.c = source.c;
this.method = source.method;
+ return this;
+
};
MathNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/math/OperatorNode.js | @@ -63,6 +63,8 @@ OperatorNode.prototype.copy = function ( source ) {
this.b = source.b;
this.op = source.op;
+ return this;
+
};
OperatorNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/misc/BumpMapNode.js | @@ -144,6 +144,8 @@ BumpMapNode.prototype.copy = function ( source ) {
this.value = source.value;
this.scale = source.scale;
+ return this;
+
};
BumpMapNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/misc/NormalMapNode.js | @@ -95,6 +95,8 @@ NormalMapNode.prototype.copy = function ( source ) {
this.value = source.value;
this.scale = source.scale;
+ return this;
+
};
NormalMapNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/postprocessing/NodePass.js | @@ -52,6 +52,8 @@ NodePass.prototype.copy = function ( source ) {
this.input = source.input;
+ return this;
+
};
NodePass.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/postprocessing/NodePostProcessing.js | @@ -97,6 +97,8 @@ NodePostProcessing.prototype = {
this.output = source.output;
+ return this;
+
},
toJSON: function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/procedural/CheckerNode.js | @@ -54,6 +54,8 @@ CheckerNode.prototype.copy = function ( source ) {
this.uv = source.uv;
+ return this;
+
};
CheckerNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/procedural/NoiseNode.js | @@ -48,6 +48,8 @@ NoiseNode.prototype.copy = function ( source ) {
this.uv = source.uv;
+ return this;
+
};
NoiseNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/utils/BypassNode.js | @@ -62,6 +62,8 @@ BypassNode.prototype.copy = function ( source ) {
this.code = source.code;
this.value = source.value;
+ return this;
+
};
BypassNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/utils/ColorSpaceNode.js | @@ -295,6 +295,8 @@ ColorSpaceNode.prototype.copy = function ( source ) {
this.input = source.input;
this.method = source.method;
+ return this;
+
};
ColorSpaceNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/utils/JoinNode.js | @@ -78,6 +78,8 @@ JoinNode.prototype.copy = function ( source ) {
}
+ return this;
+
};
JoinNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/utils/SwitchNode.js | @@ -80,6 +80,8 @@ SwitchNode.prototype.copy = function ( source ) {
this.node = source.node;
this.components = source.components;
+ return this;
+
};
SwitchNode.prototype.toJSON = function ( meta ) { | true |
Other | mrdoob | three.js | 451d16f6787156568b5df26365425f71ab9fdb09.json | Fix missing return statement in copy functions | examples/jsm/nodes/utils/TimerNode.js | @@ -75,6 +75,8 @@ TimerNode.prototype.copy = function ( source ) {
this.timeScale = source.timeScale;
+ return this;
+
};
TimerNode.prototype.toJSON = function ( meta ) { | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.