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 | 666923ebb40cf9c32cdb806203ce90f8484d745f.json | Update ColorKeyframeTrack inheritance | src/animation/tracks/ColorKeyframeTrack.js | @@ -1,5 +1,4 @@
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
+import { KeyframeTrack } from '../KeyframeTrack.js';
/**
*
@@ -13,11 +12,11 @@ import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
function ColorKeyframeTrack( name, times, values, interpolation ) {
- KeyframeTrackConstructor.call( this, name, times, values, interpolation );
+ KeyframeTrack.call( this, name, times, values, interpolation );
}
-ColorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrackPrototype ), {
+ColorKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
constructor: ColorKeyframeTrack,
| false |
Other | mrdoob | three.js | 5bceba4cf6026194f3118962d484d348d3a5f75b.json | Update BooleanKeyframeTrack inheritance | src/animation/tracks/BooleanKeyframeTrack.js | @@ -1,6 +1,5 @@
import { InterpolateDiscrete } from '../../constants.js';
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
+import { KeyframeTrack } from '../KeyframeTrack.js';
/**
*
@@ -14,11 +13,11 @@ import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
function BooleanKeyframeTrack( name, times, values ) {
- KeyframeTrackConstructor.call( this, name, times, values );
+ KeyframeTrack.call( this, name, times, values );
}
-BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrackPrototype ), {
+BooleanKeyframeTrack.prototype = Object.assign( Object.create( KeyframeTrack.prototype ), {
constructor: BooleanKeyframeTrack,
| false |
Other | mrdoob | three.js | 2d2987ffd9b49433c8a756f37328cd4bc69ced58.json | Update error messages | src/animation/KeyframeTrack.js | @@ -26,13 +26,8 @@ import { AnimationUtils } from './AnimationUtils.js';
function KeyframeTrack( name, times, values, interpolation ) {
- if ( name === undefined ) throw new Error( 'track name is undefined' );
-
- if ( times === undefined || times.length === 0 ) {
-
- throw new Error( 'no keyframes in track named ' + name );
-
- }
+ if ( name === undefined ) throw new Error( 'THREE.KeyframeTrack: track name is undefined' );
+ if ( times === undefined || times.length === 0 ) throw new Error( 'THREE.KeyframeTrack: no keyframes in track named ' + name );
this.name = name;
@@ -57,7 +52,7 @@ Object.assign( KeyframeTrack, {
if ( json.type === undefined ) {
- throw new Error( 'track type undefined, can not parse' );
+ throw new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );
}
@@ -164,7 +159,7 @@ Object.assign( KeyframeTrack, {
}
- throw new Error( 'Unsupported typeName: ' + typeName );
+ throw new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );
}
@@ -244,7 +239,7 @@ Object.assign( KeyframeTrack.prototype, {
}
- console.warn( 'THREE.KeyframeTrackPrototype:', message );
+ console.warn( 'THREE.KeyframeTrack:', message );
return;
}
@@ -363,7 +358,7 @@ Object.assign( KeyframeTrack.prototype, {
var valueSize = this.getValueSize();
if ( valueSize - Math.floor( valueSize ) !== 0 ) {
- console.error( 'THREE.KeyframeTrackPrototype: Invalid value size in track.', this );
+ console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );
valid = false;
}
@@ -375,7 +370,7 @@ Object.assign( KeyframeTrack.prototype, {
if ( nKeys === 0 ) {
- console.error( 'THREE.KeyframeTrackPrototype: Track is empty.', this );
+ console.error( 'THREE.KeyframeTrack: Track is empty.', this );
valid = false;
}
@@ -388,15 +383,15 @@ Object.assign( KeyframeTrack.prototype, {
if ( typeof currTime === 'number' && isNaN( currTime ) ) {
- console.error( 'THREE.KeyframeTrackPrototype: Time is not a valid number.', this, i, currTime );
+ console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );
valid = false;
break;
}
if ( prevTime !== null && prevTime > currTime ) {
- console.error( 'THREE.KeyframeTrackPrototype: Out of order keys.', this, i, currTime, prevTime );
+ console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
valid = false;
break;
@@ -416,7 +411,7 @@ Object.assign( KeyframeTrack.prototype, {
if ( isNaN( value ) ) {
- console.error( 'THREE.KeyframeTrackPrototype: Value is not a valid number.', this, i, value );
+ console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );
valid = false;
break;
| false |
Other | mrdoob | three.js | 620126d96e572b997e15a8ac6259ef86a7ad5dac.json | Update CanvasRenderer documentation | docs/examples/renderers/CanvasRenderer.html | @@ -55,7 +55,13 @@ <h3>[name]([page:object parameters])</h3>
<div>parameters is an optional object with properties defining the renderer's behaviour. The constructor also accepts no parameters at all. In all cases, it will assume sane defaults when parameters are missing.</div>
<div>
- canvas — A [page:Canvas] where the renderer draws its output.
+ [page:DOMElement canvas] - A [link:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas canvas]
+ where the renderer draws its output.
+ This corresponds to the [page:CanvasRenderer.domElement domElement] property below.
+ If not passed in here, a new canvas element will be created.<br />
+
+ [page:Boolean alpha] - whether the canvas contains an alpha (transparency) buffer or not.
+ Default is *false*.
</div>
| false |
Other | mrdoob | three.js | e5464b9dff8495d2968bace065c2603bbe02e54a.json | Fix doc typo | docs/api/math/Box3.html | @@ -47,7 +47,7 @@ <h3>[property:Vector3 min]</h3>
<h3>[property:Vector3 max]</h3>
<div>
- [page:Vector3] representing the lower upper (x, y, z) boundary of the box.<br />
+ [page:Vector3] representing the upper (x, y, z) boundary of the box.<br />
Default is ( - Infinity, - Infinity, - Infinity ).
</div>
| false |
Other | mrdoob | three.js | 6f5c72e9ecf6507bff3dff43e9d50b2134fcebb5.json | Keep variable names for skinIndex and nodeIndex | examples/js/loaders/GLTFLoader.js | @@ -2242,13 +2242,13 @@ THREE.GLTFLoader = ( function () {
// Nothing in the node definition indicates whether it is a Bone or an
// Object3D. Use the skins' joint references to mark bones.
- for ( var i = 0; i < skins.length; i ++ ) {
+ for ( var skinIndex = 0; skinIndex < skins.length; skinIndex ++ ) {
- var joints = skins[ i ].joints;
+ var joints = skins[ skinIndex ].joints;
- for ( var j = 0; j < joints.length; ++ j ) {
+ for ( var i = 0; i < joints.length; ++ i ) {
- nodes[ joints[ j ] ].isBone = true;
+ nodes[ joints[ i ] ].isBone = true;
}
@@ -2259,9 +2259,9 @@ THREE.GLTFLoader = ( function () {
// references and rename instances below.
//
// Example: CesiumMilkTruck sample model reuses "Wheel" meshes.
- for ( var i = 0; i < nodes.length; i ++ ) {
+ for ( var nodeIndex = 0; nodeIndex < nodes.length; nodeIndex ++ ) {
- var nodeDef = nodes[ i ];
+ var nodeDef = nodes[ nodeIndex ];
if ( nodeDef.mesh !== undefined ) {
| false |
Other | mrdoob | three.js | 32955b5cc13cdd1aef074dbade9139e908136b6b.json | remove unused uniform | examples/js/objects/Water.js | @@ -75,7 +75,6 @@ THREE.Water = function ( width, height, options ) {
time: { value: 0.0 },
size: { value: 1.0 },
distortionScale: { value: 20.0 },
- noiseScale: { value: 1.0 },
textureMatrix: { value: new THREE.Matrix4() },
sunColor: { value: new THREE.Color( 0x7F7F7F ) },
sunDirection: { value: new THREE.Vector3( 0.70707, 0.70707, 0 ) }, | false |
Other | mrdoob | three.js | a58d17160946f360644788681819a899aeeebf83.json | Add FXAA 3.11 antialiasing | examples/js/shaders/FXAAShader.js | @@ -19,70 +19,1097 @@ THREE.FXAAShader = {
vertexShader: [
+ "varying vec2 vUv;",
+
"void main() {",
+ "vUv = uv;",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join( "\n" ),
fragmentShader: [
-
- "uniform sampler2D tDiffuse;",
- "uniform vec2 resolution;",
-
- "#define FXAA_REDUCE_MIN (1.0/128.0)",
- "#define FXAA_REDUCE_MUL (1.0/8.0)",
- "#define FXAA_SPAN_MAX 8.0",
-
- "void main() {",
-
- "vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;",
- "vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;",
- "vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;",
- "vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;",
- "vec4 rgbaM = texture2D( tDiffuse, gl_FragCoord.xy * resolution );",
- "vec3 rgbM = rgbaM.xyz;",
- "vec3 luma = vec3( 0.299, 0.587, 0.114 );",
-
- "float lumaNW = dot( rgbNW, luma );",
- "float lumaNE = dot( rgbNE, luma );",
- "float lumaSW = dot( rgbSW, luma );",
- "float lumaSE = dot( rgbSE, luma );",
- "float lumaM = dot( rgbM, luma );",
- "float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );",
- "float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );",
-
- "vec2 dir;",
- "dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));",
- "dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));",
-
- "float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );",
-
- "float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );",
- "dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),",
- "max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),",
- "dir * rcpDirMin)) * resolution;",
- "vec4 rgbA = (1.0/2.0) * (",
- "texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (1.0/3.0 - 0.5)) +",
- "texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (2.0/3.0 - 0.5)));",
- "vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (",
- "texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (0.0/3.0 - 0.5)) +",
- "texture2D(tDiffuse, gl_FragCoord.xy * resolution + dir * (3.0/3.0 - 0.5)));",
- "float lumaB = dot(rgbB, vec4(luma, 0.0));",
-
- "if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {",
-
- "gl_FragColor = rgbA;",
-
- "} else {",
- "gl_FragColor = rgbB;",
-
- "}",
-
- "}"
-
- ].join( "\n" )
+ "precision highp float;",
+ "",
+ "uniform sampler2D tDiffuse;",
+ "",
+ "uniform vec2 resolution;",
+ "",
+ "varying vec2 vUv;",
+ "",
+ "// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)",
+ "",
+ "//----------------------------------------------------------------------------------",
+ "// File: es3-kepler\FXAA\assets\shaders/FXAA_DefaultES.frag",
+ "// SDK Version: v3.00",
+ "// Email: gameworks@nvidia.com",
+ "// Site: http://developer.nvidia.com/",
+ "//",
+ "// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.",
+ "//",
+ "// Redistribution and use in source and binary forms, with or without",
+ "// modification, are permitted provided that the following conditions",
+ "// are met:",
+ "// * Redistributions of source code must retain the above copyright",
+ "// notice, this list of conditions and the following disclaimer.",
+ "// * Redistributions in binary form must reproduce the above copyright",
+ "// notice, this list of conditions and the following disclaimer in the",
+ "// documentation and/or other materials provided with the distribution.",
+ "// * Neither the name of NVIDIA CORPORATION nor the names of its",
+ "// contributors may be used to endorse or promote products derived",
+ "// from this software without specific prior written permission.",
+ "//",
+ "// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY",
+ "// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE",
+ "// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR",
+ "// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR",
+ "// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,",
+ "// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,",
+ "// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR",
+ "// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY",
+ "// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT",
+ "// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE",
+ "// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ "//",
+ "//----------------------------------------------------------------------------------",
+ "",
+ "#define FXAA_PC 1",
+ "#define FXAA_GLSL_100 1",
+ "#define FXAA_QUALITY_PRESET 12",
+ "",
+ "#define FXAA_GREEN_AS_LUMA 1",
+ "",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_PC_CONSOLE",
+ " //",
+ " // The console algorithm for PC is included",
+ " // for developers targeting really low spec machines.",
+ " // Likely better to just run FXAA_PC, and use a really low preset.",
+ " //",
+ " #define FXAA_PC_CONSOLE 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_GLSL_120",
+ " #define FXAA_GLSL_120 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_GLSL_130",
+ " #define FXAA_GLSL_130 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_HLSL_3",
+ " #define FXAA_HLSL_3 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_HLSL_4",
+ " #define FXAA_HLSL_4 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_HLSL_5",
+ " #define FXAA_HLSL_5 0",
+ "#endif",
+ "/*==========================================================================*/",
+ "#ifndef FXAA_GREEN_AS_LUMA",
+ " //",
+ " // For those using non-linear color,",
+ " // and either not able to get luma in alpha, or not wanting to,",
+ " // this enables FXAA to run using green as a proxy for luma.",
+ " // So with this enabled, no need to pack luma in alpha.",
+ " //",
+ " // This will turn off AA on anything which lacks some amount of green.",
+ " // Pure red and blue or combination of only R and B, will get no AA.",
+ " //",
+ " // Might want to lower the settings for both,",
+ " // fxaaConsoleEdgeThresholdMin",
+ " // fxaaQualityEdgeThresholdMin",
+ " // In order to insure AA does not get turned off on colors",
+ " // which contain a minor amount of green.",
+ " //",
+ " // 1 = On.",
+ " // 0 = Off.",
+ " //",
+ " #define FXAA_GREEN_AS_LUMA 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_EARLY_EXIT",
+ " //",
+ " // Controls algorithm's early exit path.",
+ " // On PS3 turning this ON adds 2 cycles to the shader.",
+ " // On 360 turning this OFF adds 10ths of a millisecond to the shader.",
+ " // Turning this off on console will result in a more blurry image.",
+ " // So this defaults to on.",
+ " //",
+ " // 1 = On.",
+ " // 0 = Off.",
+ " //",
+ " #define FXAA_EARLY_EXIT 1",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_DISCARD",
+ " //",
+ " // Only valid for PC OpenGL currently.",
+ " // Probably will not work when FXAA_GREEN_AS_LUMA = 1.",
+ " //",
+ " // 1 = Use discard on pixels which don't need AA.",
+ " // For APIs which enable concurrent TEX+ROP from same surface.",
+ " // 0 = Return unchanged color on pixels which don't need AA.",
+ " //",
+ " #define FXAA_DISCARD 0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_FAST_PIXEL_OFFSET",
+ " //",
+ " // Used for GLSL 120 only.",
+ " //",
+ " // 1 = GL API supports fast pixel offsets",
+ " // 0 = do not use fast pixel offsets",
+ " //",
+ " #ifdef GL_EXT_gpu_shader4",
+ " #define FXAA_FAST_PIXEL_OFFSET 1",
+ " #endif",
+ " #ifdef GL_NV_gpu_shader5",
+ " #define FXAA_FAST_PIXEL_OFFSET 1",
+ " #endif",
+ " #ifdef GL_ARB_gpu_shader5",
+ " #define FXAA_FAST_PIXEL_OFFSET 1",
+ " #endif",
+ " #ifndef FXAA_FAST_PIXEL_OFFSET",
+ " #define FXAA_FAST_PIXEL_OFFSET 0",
+ " #endif",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#ifndef FXAA_GATHER4_ALPHA",
+ " //",
+ " // 1 = API supports gather4 on alpha channel.",
+ " // 0 = API does not support gather4 on alpha channel.",
+ " //",
+ " #if (FXAA_HLSL_5 == 1)",
+ " #define FXAA_GATHER4_ALPHA 1",
+ " #endif",
+ " #ifdef GL_ARB_gpu_shader5",
+ " #define FXAA_GATHER4_ALPHA 1",
+ " #endif",
+ " #ifdef GL_NV_gpu_shader5",
+ " #define FXAA_GATHER4_ALPHA 1",
+ " #endif",
+ " #ifndef FXAA_GATHER4_ALPHA",
+ " #define FXAA_GATHER4_ALPHA 0",
+ " #endif",
+ "#endif",
+ "",
+ "",
+ "/*============================================================================",
+ " FXAA QUALITY - TUNING KNOBS",
+ "------------------------------------------------------------------------------",
+ "NOTE the other tuning knobs are now in the shader function inputs!",
+ "============================================================================*/",
+ "#ifndef FXAA_QUALITY_PRESET",
+ " //",
+ " // Choose the quality preset.",
+ " // This needs to be compiled into the shader as it effects code.",
+ " // Best option to include multiple presets is to",
+ " // in each shader define the preset, then include this file.",
+ " //",
+ " // OPTIONS",
+ " // -----------------------------------------------------------------------",
+ " // 10 to 15 - default medium dither (10=fastest, 15=highest quality)",
+ " // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)",
+ " // 39 - no dither, very expensive",
+ " //",
+ " // NOTES",
+ " // -----------------------------------------------------------------------",
+ " // 12 = slightly faster then FXAA 3.9 and higher edge quality (default)",
+ " // 13 = about same speed as FXAA 3.9 and better than 12",
+ " // 23 = closest to FXAA 3.9 visually and performance wise",
+ " // _ = the lowest digit is directly related to performance",
+ " // _ = the highest digit is directly related to style",
+ " //",
+ " #define FXAA_QUALITY_PRESET 12",
+ "#endif",
+ "",
+ "",
+ "/*============================================================================",
+ "",
+ " FXAA QUALITY - PRESETS",
+ "",
+ "============================================================================*/",
+ "",
+ "/*============================================================================",
+ " FXAA QUALITY - MEDIUM DITHER PRESETS",
+ "============================================================================*/",
+ "#if (FXAA_QUALITY_PRESET == 10)",
+ " #define FXAA_QUALITY_PS 3",
+ " #define FXAA_QUALITY_P0 1.5",
+ " #define FXAA_QUALITY_P1 3.0",
+ " #define FXAA_QUALITY_P2 12.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 11)",
+ " #define FXAA_QUALITY_PS 4",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 3.0",
+ " #define FXAA_QUALITY_P3 12.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 12)",
+ " #define FXAA_QUALITY_PS 5",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 4.0",
+ " #define FXAA_QUALITY_P4 12.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 13)",
+ " #define FXAA_QUALITY_PS 6",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 4.0",
+ " #define FXAA_QUALITY_P5 12.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 14)",
+ " #define FXAA_QUALITY_PS 7",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 4.0",
+ " #define FXAA_QUALITY_P6 12.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 15)",
+ " #define FXAA_QUALITY_PS 8",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 4.0",
+ " #define FXAA_QUALITY_P7 12.0",
+ "#endif",
+ "",
+ "/*============================================================================",
+ " FXAA QUALITY - LOW DITHER PRESETS",
+ "============================================================================*/",
+ "#if (FXAA_QUALITY_PRESET == 20)",
+ " #define FXAA_QUALITY_PS 3",
+ " #define FXAA_QUALITY_P0 1.5",
+ " #define FXAA_QUALITY_P1 2.0",
+ " #define FXAA_QUALITY_P2 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 21)",
+ " #define FXAA_QUALITY_PS 4",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 22)",
+ " #define FXAA_QUALITY_PS 5",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 23)",
+ " #define FXAA_QUALITY_PS 6",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 24)",
+ " #define FXAA_QUALITY_PS 7",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 3.0",
+ " #define FXAA_QUALITY_P6 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 25)",
+ " #define FXAA_QUALITY_PS 8",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 4.0",
+ " #define FXAA_QUALITY_P7 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 26)",
+ " #define FXAA_QUALITY_PS 9",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 2.0",
+ " #define FXAA_QUALITY_P7 4.0",
+ " #define FXAA_QUALITY_P8 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 27)",
+ " #define FXAA_QUALITY_PS 10",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 2.0",
+ " #define FXAA_QUALITY_P7 2.0",
+ " #define FXAA_QUALITY_P8 4.0",
+ " #define FXAA_QUALITY_P9 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 28)",
+ " #define FXAA_QUALITY_PS 11",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 2.0",
+ " #define FXAA_QUALITY_P7 2.0",
+ " #define FXAA_QUALITY_P8 2.0",
+ " #define FXAA_QUALITY_P9 4.0",
+ " #define FXAA_QUALITY_P10 8.0",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_QUALITY_PRESET == 29)",
+ " #define FXAA_QUALITY_PS 12",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.5",
+ " #define FXAA_QUALITY_P2 2.0",
+ " #define FXAA_QUALITY_P3 2.0",
+ " #define FXAA_QUALITY_P4 2.0",
+ " #define FXAA_QUALITY_P5 2.0",
+ " #define FXAA_QUALITY_P6 2.0",
+ " #define FXAA_QUALITY_P7 2.0",
+ " #define FXAA_QUALITY_P8 2.0",
+ " #define FXAA_QUALITY_P9 2.0",
+ " #define FXAA_QUALITY_P10 4.0",
+ " #define FXAA_QUALITY_P11 8.0",
+ "#endif",
+ "",
+ "/*============================================================================",
+ " FXAA QUALITY - EXTREME QUALITY",
+ "============================================================================*/",
+ "#if (FXAA_QUALITY_PRESET == 39)",
+ " #define FXAA_QUALITY_PS 12",
+ " #define FXAA_QUALITY_P0 1.0",
+ " #define FXAA_QUALITY_P1 1.0",
+ " #define FXAA_QUALITY_P2 1.0",
+ " #define FXAA_QUALITY_P3 1.0",
+ " #define FXAA_QUALITY_P4 1.0",
+ " #define FXAA_QUALITY_P5 1.5",
+ " #define FXAA_QUALITY_P6 2.0",
+ " #define FXAA_QUALITY_P7 2.0",
+ " #define FXAA_QUALITY_P8 2.0",
+ " #define FXAA_QUALITY_P9 2.0",
+ " #define FXAA_QUALITY_P10 4.0",
+ " #define FXAA_QUALITY_P11 8.0",
+ "#endif",
+ "",
+ "",
+ "",
+ "/*============================================================================",
+ "",
+ " API PORTING",
+ "",
+ "============================================================================*/",
+ "#if (FXAA_GLSL_100 == 1) || (FXAA_GLSL_120 == 1) || (FXAA_GLSL_130 == 1)",
+ " #define FxaaBool bool",
+ " #define FxaaDiscard discard",
+ " #define FxaaFloat float",
+ " #define FxaaFloat2 vec2",
+ " #define FxaaFloat3 vec3",
+ " #define FxaaFloat4 vec4",
+ " #define FxaaHalf float",
+ " #define FxaaHalf2 vec2",
+ " #define FxaaHalf3 vec3",
+ " #define FxaaHalf4 vec4",
+ " #define FxaaInt2 ivec2",
+ " #define FxaaSat(x) clamp(x, 0.0, 1.0)",
+ " #define FxaaTex sampler2D",
+ "#else",
+ " #define FxaaBool bool",
+ " #define FxaaDiscard clip(-1)",
+ " #define FxaaFloat float",
+ " #define FxaaFloat2 float2",
+ " #define FxaaFloat3 float3",
+ " #define FxaaFloat4 float4",
+ " #define FxaaHalf half",
+ " #define FxaaHalf2 half2",
+ " #define FxaaHalf3 half3",
+ " #define FxaaHalf4 half4",
+ " #define FxaaSat(x) saturate(x)",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_GLSL_100 == 1)",
+ " #define FxaaTexTop(t, p) texture2D(t, p, 0.0)",
+ " #define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), 0.0)",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_GLSL_120 == 1)",
+ " // Requires,",
+ " // #version 120",
+ " // And at least,",
+ " // #extension GL_EXT_gpu_shader4 : enable",
+ " // (or set FXAA_FAST_PIXEL_OFFSET 1 to work like DX9)",
+ " #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)",
+ " #if (FXAA_FAST_PIXEL_OFFSET == 1)",
+ " #define FxaaTexOff(t, p, o, r) texture2DLodOffset(t, p, 0.0, o)",
+ " #else",
+ " #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)",
+ " #endif",
+ " #if (FXAA_GATHER4_ALPHA == 1)",
+ " // use #extension GL_ARB_gpu_shader5 : enable",
+ " #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)",
+ " #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)",
+ " #define FxaaTexGreen4(t, p) textureGather(t, p, 1)",
+ " #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)",
+ " #endif",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_GLSL_130 == 1)",
+ " // Requires \"#version 130\" or better",
+ " #define FxaaTexTop(t, p) textureLod(t, p, 0.0)",
+ " #define FxaaTexOff(t, p, o, r) textureLodOffset(t, p, 0.0, o)",
+ " #if (FXAA_GATHER4_ALPHA == 1)",
+ " // use #extension GL_ARB_gpu_shader5 : enable",
+ " #define FxaaTexAlpha4(t, p) textureGather(t, p, 3)",
+ " #define FxaaTexOffAlpha4(t, p, o) textureGatherOffset(t, p, o, 3)",
+ " #define FxaaTexGreen4(t, p) textureGather(t, p, 1)",
+ " #define FxaaTexOffGreen4(t, p, o) textureGatherOffset(t, p, o, 1)",
+ " #endif",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_HLSL_3 == 1)",
+ " #define FxaaInt2 float2",
+ " #define FxaaTex sampler2D",
+ " #define FxaaTexTop(t, p) tex2Dlod(t, float4(p, 0.0, 0.0))",
+ " #define FxaaTexOff(t, p, o, r) tex2Dlod(t, float4(p + (o * r), 0, 0))",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_HLSL_4 == 1)",
+ " #define FxaaInt2 int2",
+ " struct FxaaTex { SamplerState smpl; Texture2D tex; };",
+ " #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)",
+ " #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)",
+ "#endif",
+ "/*--------------------------------------------------------------------------*/",
+ "#if (FXAA_HLSL_5 == 1)",
+ " #define FxaaInt2 int2",
+ " struct FxaaTex { SamplerState smpl; Texture2D tex; };",
+ " #define FxaaTexTop(t, p) t.tex.SampleLevel(t.smpl, p, 0.0)",
+ " #define FxaaTexOff(t, p, o, r) t.tex.SampleLevel(t.smpl, p, 0.0, o)",
+ " #define FxaaTexAlpha4(t, p) t.tex.GatherAlpha(t.smpl, p)",
+ " #define FxaaTexOffAlpha4(t, p, o) t.tex.GatherAlpha(t.smpl, p, o)",
+ " #define FxaaTexGreen4(t, p) t.tex.GatherGreen(t.smpl, p)",
+ " #define FxaaTexOffGreen4(t, p, o) t.tex.GatherGreen(t.smpl, p, o)",
+ "#endif",
+ "",
+ "",
+ "/*============================================================================",
+ " GREEN AS LUMA OPTION SUPPORT FUNCTION",
+ "============================================================================*/",
+ "#if (FXAA_GREEN_AS_LUMA == 0)",
+ " FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.w; }",
+ "#else",
+ " FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }",
+ "#endif",
+ "",
+ "",
+ "",
+ "",
+ "/*============================================================================",
+ "",
+ " FXAA3 QUALITY - PC",
+ "",
+ "============================================================================*/",
+ "#if (FXAA_PC == 1)",
+ "/*--------------------------------------------------------------------------*/",
+ "FxaaFloat4 FxaaPixelShader(",
+ " //",
+ " // Use noperspective interpolation here (turn off perspective interpolation).",
+ " // {xy} = center of pixel",
+ " FxaaFloat2 pos,",
+ " //",
+ " // Used only for FXAA Console, and not used on the 360 version.",
+ " // Use noperspective interpolation here (turn off perspective interpolation).",
+ " // {xy_} = upper left of pixel",
+ " // {_zw} = lower right of pixel",
+ " FxaaFloat4 fxaaConsolePosPos,",
+ " //",
+ " // Input color texture.",
+ " // {rgb_} = color in linear or perceptual color space",
+ " // if (FXAA_GREEN_AS_LUMA == 0)",
+ " // {__a} = luma in perceptual color space (not linear)",
+ " FxaaTex tex,",
+ " //",
+ " // Only used on the optimized 360 version of FXAA Console.",
+ " // For everything but 360, just use the same input here as for \"tex\".",
+ " // For 360, same texture, just alias with a 2nd sampler.",
+ " // This sampler needs to have an exponent bias of -1.",
+ " FxaaTex fxaaConsole360TexExpBiasNegOne,",
+ " //",
+ " // Only used on the optimized 360 version of FXAA Console.",
+ " // For everything but 360, just use the same input here as for \"tex\".",
+ " // For 360, same texture, just alias with a 3nd sampler.",
+ " // This sampler needs to have an exponent bias of -2.",
+ " FxaaTex fxaaConsole360TexExpBiasNegTwo,",
+ " //",
+ " // Only used on FXAA Quality.",
+ " // This must be from a constant/uniform.",
+ " // {x_} = 1.0/screenWidthInPixels",
+ " // {_y} = 1.0/screenHeightInPixels",
+ " FxaaFloat2 fxaaQualityRcpFrame,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // This must be from a constant/uniform.",
+ " // This effects sub-pixel AA quality and inversely sharpness.",
+ " // Where N ranges between,",
+ " // N = 0.50 (default)",
+ " // N = 0.33 (sharper)",
+ " // {x__} = -N/screenWidthInPixels",
+ " // {_y_} = -N/screenHeightInPixels",
+ " // {_z_} = N/screenWidthInPixels",
+ " // {__w} = N/screenHeightInPixels",
+ " FxaaFloat4 fxaaConsoleRcpFrameOpt,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // Not used on 360, but used on PS3 and PC.",
+ " // This must be from a constant/uniform.",
+ " // {x__} = -2.0/screenWidthInPixels",
+ " // {_y_} = -2.0/screenHeightInPixels",
+ " // {_z_} = 2.0/screenWidthInPixels",
+ " // {__w} = 2.0/screenHeightInPixels",
+ " FxaaFloat4 fxaaConsoleRcpFrameOpt2,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // Only used on 360 in place of fxaaConsoleRcpFrameOpt2.",
+ " // This must be from a constant/uniform.",
+ " // {x__} = 8.0/screenWidthInPixels",
+ " // {_y_} = 8.0/screenHeightInPixels",
+ " // {_z_} = -4.0/screenWidthInPixels",
+ " // {__w} = -4.0/screenHeightInPixels",
+ " FxaaFloat4 fxaaConsole360RcpFrameOpt2,",
+ " //",
+ " // Only used on FXAA Quality.",
+ " // This used to be the FXAA_QUALITY_SUBPIX define.",
+ " // It is here now to allow easier tuning.",
+ " // Choose the amount of sub-pixel aliasing removal.",
+ " // This can effect sharpness.",
+ " // 1.00 - upper limit (softer)",
+ " // 0.75 - default amount of filtering",
+ " // 0.50 - lower limit (sharper, less sub-pixel aliasing removal)",
+ " // 0.25 - almost off",
+ " // 0.00 - completely off",
+ " FxaaFloat fxaaQualitySubpix,",
+ " //",
+ " // Only used on FXAA Quality.",
+ " // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.",
+ " // It is here now to allow easier tuning.",
+ " // The minimum amount of local contrast required to apply algorithm.",
+ " // 0.333 - too little (faster)",
+ " // 0.250 - low quality",
+ " // 0.166 - default",
+ " // 0.125 - high quality",
+ " // 0.063 - overkill (slower)",
+ " FxaaFloat fxaaQualityEdgeThreshold,",
+ " //",
+ " // Only used on FXAA Quality.",
+ " // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.",
+ " // It is here now to allow easier tuning.",
+ " // Trims the algorithm from processing darks.",
+ " // 0.0833 - upper limit (default, the start of visible unfiltered edges)",
+ " // 0.0625 - high quality (faster)",
+ " // 0.0312 - visible limit (slower)",
+ " // Special notes when using FXAA_GREEN_AS_LUMA,",
+ " // Likely want to set this to zero.",
+ " // As colors that are mostly not-green",
+ " // will appear very dark in the green channel!",
+ " // Tune by looking at mostly non-green content,",
+ " // then start at zero and increase until aliasing is a problem.",
+ " FxaaFloat fxaaQualityEdgeThresholdMin,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // This used to be the FXAA_CONSOLE_EDGE_SHARPNESS define.",
+ " // It is here now to allow easier tuning.",
+ " // This does not effect PS3, as this needs to be compiled in.",
+ " // Use FXAA_CONSOLE_PS3_EDGE_SHARPNESS for PS3.",
+ " // Due to the PS3 being ALU bound,",
+ " // there are only three safe values here: 2 and 4 and 8.",
+ " // These options use the shaders ability to a free *|/ by 2|4|8.",
+ " // For all other platforms can be a non-power of two.",
+ " // 8.0 is sharper (default!!!)",
+ " // 4.0 is softer",
+ " // 2.0 is really soft (good only for vector graphics inputs)",
+ " FxaaFloat fxaaConsoleEdgeSharpness,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD define.",
+ " // It is here now to allow easier tuning.",
+ " // This does not effect PS3, as this needs to be compiled in.",
+ " // Use FXAA_CONSOLE_PS3_EDGE_THRESHOLD for PS3.",
+ " // Due to the PS3 being ALU bound,",
+ " // there are only two safe values here: 1/4 and 1/8.",
+ " // These options use the shaders ability to a free *|/ by 2|4|8.",
+ " // The console setting has a different mapping than the quality setting.",
+ " // Other platforms can use other values.",
+ " // 0.125 leaves less aliasing, but is softer (default!!!)",
+ " // 0.25 leaves more aliasing, and is sharper",
+ " FxaaFloat fxaaConsoleEdgeThreshold,",
+ " //",
+ " // Only used on FXAA Console.",
+ " // This used to be the FXAA_CONSOLE_EDGE_THRESHOLD_MIN define.",
+ " // It is here now to allow easier tuning.",
+ " // Trims the algorithm from processing darks.",
+ " // The console setting has a different mapping than the quality setting.",
+ " // This only applies when FXAA_EARLY_EXIT is 1.",
+ " // This does not apply to PS3,",
+ " // PS3 was simplified to avoid more shader instructions.",
+ " // 0.06 - faster but more aliasing in darks",
+ " // 0.05 - default",
+ " // 0.04 - slower and less aliasing in darks",
+ " // Special notes when using FXAA_GREEN_AS_LUMA,",
+ " // Likely want to set this to zero.",
+ " // As colors that are mostly not-green",
+ " // will appear very dark in the green channel!",
+ " // Tune by looking at mostly non-green content,",
+ " // then start at zero and increase until aliasing is a problem.",
+ " FxaaFloat fxaaConsoleEdgeThresholdMin,",
+ " //",
+ " // Extra constants for 360 FXAA Console only.",
+ " // Use zeros or anything else for other platforms.",
+ " // These must be in physical constant registers and NOT immedates.",
+ " // Immedates will result in compiler un-optimizing.",
+ " // {xyzw} = float4(1.0, -1.0, 0.25, -0.25)",
+ " FxaaFloat4 fxaaConsole360ConstDir",
+ ") {",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat2 posM;",
+ " posM.x = pos.x;",
+ " posM.y = pos.y;",
+ " #if (FXAA_GATHER4_ALPHA == 1)",
+ " #if (FXAA_DISCARD == 0)",
+ " FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);",
+ " #if (FXAA_GREEN_AS_LUMA == 0)",
+ " #define lumaM rgbyM.w",
+ " #else",
+ " #define lumaM rgbyM.y",
+ " #endif",
+ " #endif",
+ " #if (FXAA_GREEN_AS_LUMA == 0)",
+ " FxaaFloat4 luma4A = FxaaTexAlpha4(tex, posM);",
+ " FxaaFloat4 luma4B = FxaaTexOffAlpha4(tex, posM, FxaaInt2(-1, -1));",
+ " #else",
+ " FxaaFloat4 luma4A = FxaaTexGreen4(tex, posM);",
+ " FxaaFloat4 luma4B = FxaaTexOffGreen4(tex, posM, FxaaInt2(-1, -1));",
+ " #endif",
+ " #if (FXAA_DISCARD == 1)",
+ " #define lumaM luma4A.w",
+ " #endif",
+ " #define lumaE luma4A.z",
+ " #define lumaS luma4A.x",
+ " #define lumaSE luma4A.y",
+ " #define lumaNW luma4B.w",
+ " #define lumaN luma4B.z",
+ " #define lumaW luma4B.x",
+ " #else",
+ " FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);",
+ " #if (FXAA_GREEN_AS_LUMA == 0)",
+ " #define lumaM rgbyM.w",
+ " #else",
+ " #define lumaM rgbyM.y",
+ " #endif",
+ " #if (FXAA_GLSL_100 == 1)",
+ " FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0, 1.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 0.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 0.0,-1.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 0.0), fxaaQualityRcpFrame.xy));",
+ " #else",
+ " FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));",
+ " #endif",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat maxSM = max(lumaS, lumaM);",
+ " FxaaFloat minSM = min(lumaS, lumaM);",
+ " FxaaFloat maxESM = max(lumaE, maxSM);",
+ " FxaaFloat minESM = min(lumaE, minSM);",
+ " FxaaFloat maxWN = max(lumaN, lumaW);",
+ " FxaaFloat minWN = min(lumaN, lumaW);",
+ " FxaaFloat rangeMax = max(maxWN, maxESM);",
+ " FxaaFloat rangeMin = min(minWN, minESM);",
+ " FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;",
+ " FxaaFloat range = rangeMax - rangeMin;",
+ " FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);",
+ " FxaaBool earlyExit = range < rangeMaxClamped;",
+ "/*--------------------------------------------------------------------------*/",
+ " if(earlyExit)",
+ " #if (FXAA_DISCARD == 1)",
+ " FxaaDiscard;",
+ " #else",
+ " return rgbyM;",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_GATHER4_ALPHA == 0)",
+ " #if (FXAA_GLSL_100 == 1)",
+ " FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0,-1.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0, 1.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2( 1.0,-1.0), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaFloat2(-1.0, 1.0), fxaaQualityRcpFrame.xy));",
+ " #else",
+ " FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));",
+ " #endif",
+ " #else",
+ " FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(1, -1), fxaaQualityRcpFrame.xy));",
+ " FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat lumaNS = lumaN + lumaS;",
+ " FxaaFloat lumaWE = lumaW + lumaE;",
+ " FxaaFloat subpixRcpRange = 1.0/range;",
+ " FxaaFloat subpixNSWE = lumaNS + lumaWE;",
+ " FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;",
+ " FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat lumaNESE = lumaNE + lumaSE;",
+ " FxaaFloat lumaNWNE = lumaNW + lumaNE;",
+ " FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;",
+ " FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat lumaNWSW = lumaNW + lumaSW;",
+ " FxaaFloat lumaSWSE = lumaSW + lumaSE;",
+ " FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);",
+ " FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);",
+ " FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;",
+ " FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;",
+ " FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;",
+ " FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;",
+ " FxaaFloat lengthSign = fxaaQualityRcpFrame.x;",
+ " FxaaBool horzSpan = edgeHorz >= edgeVert;",
+ " FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;",
+ "/*--------------------------------------------------------------------------*/",
+ " if(!horzSpan) lumaN = lumaW;",
+ " if(!horzSpan) lumaS = lumaE;",
+ " if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;",
+ " FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat gradientN = lumaN - lumaM;",
+ " FxaaFloat gradientS = lumaS - lumaM;",
+ " FxaaFloat lumaNN = lumaN + lumaM;",
+ " FxaaFloat lumaSS = lumaS + lumaM;",
+ " FxaaBool pairN = abs(gradientN) >= abs(gradientS);",
+ " FxaaFloat gradient = max(abs(gradientN), abs(gradientS));",
+ " if(pairN) lengthSign = -lengthSign;",
+ " FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat2 posB;",
+ " posB.x = posM.x;",
+ " posB.y = posM.y;",
+ " FxaaFloat2 offNP;",
+ " offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;",
+ " offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;",
+ " if(!horzSpan) posB.x += lengthSign * 0.5;",
+ " if( horzSpan) posB.y += lengthSign * 0.5;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat2 posN;",
+ " posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;",
+ " posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;",
+ " FxaaFloat2 posP;",
+ " posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;",
+ " posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;",
+ " FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;",
+ " FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));",
+ " FxaaFloat subpixE = subpixC * subpixC;",
+ " FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));",
+ "/*--------------------------------------------------------------------------*/",
+ " if(!pairN) lumaNN = lumaSS;",
+ " FxaaFloat gradientScaled = gradient * 1.0/4.0;",
+ " FxaaFloat lumaMM = lumaM - lumaNN * 0.5;",
+ " FxaaFloat subpixF = subpixD * subpixE;",
+ " FxaaBool lumaMLTZero = lumaMM < 0.0;",
+ "/*--------------------------------------------------------------------------*/",
+ " lumaEndN -= lumaNN * 0.5;",
+ " lumaEndP -= lumaNN * 0.5;",
+ " FxaaBool doneN = abs(lumaEndN) >= gradientScaled;",
+ " FxaaBool doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;",
+ " FxaaBool doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;",
+ "/*--------------------------------------------------------------------------*/",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 3)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 4)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 5)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 6)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 7)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 8)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 9)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 10)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 11)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;",
+ "/*--------------------------------------------------------------------------*/",
+ " #if (FXAA_QUALITY_PS > 12)",
+ " if(doneNP) {",
+ " if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));",
+ " if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));",
+ " if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;",
+ " if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;",
+ " doneN = abs(lumaEndN) >= gradientScaled;",
+ " doneP = abs(lumaEndP) >= gradientScaled;",
+ " if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;",
+ " if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;",
+ " doneNP = (!doneN) || (!doneP);",
+ " if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;",
+ " if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ " #endif",
+ "/*--------------------------------------------------------------------------*/",
+ " }",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat dstN = posM.x - posN.x;",
+ " FxaaFloat dstP = posP.x - posM.x;",
+ " if(!horzSpan) dstN = posM.y - posN.y;",
+ " if(!horzSpan) dstP = posP.y - posM.y;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;",
+ " FxaaFloat spanLength = (dstP + dstN);",
+ " FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;",
+ " FxaaFloat spanLengthRcp = 1.0/spanLength;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaBool directionN = dstN < dstP;",
+ " FxaaFloat dst = min(dstN, dstP);",
+ " FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;",
+ " FxaaFloat subpixG = subpixF * subpixF;",
+ " FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;",
+ " FxaaFloat subpixH = subpixG * fxaaQualitySubpix;",
+ "/*--------------------------------------------------------------------------*/",
+ " FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;",
+ " FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);",
+ " if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;",
+ " if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;",
+ " #if (FXAA_DISCARD == 1)",
+ " return FxaaTexTop(tex, posM);",
+ " #else",
+ " return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);",
+ " #endif",
+ "}",
+ "/*==========================================================================*/",
+ "#endif",
+ "",
+ "void main() {",
+ " gl_FragColor = FxaaPixelShader(",
+ " vUv,",
+ " vec4(0.0),",
+ " tDiffuse,",
+ " tDiffuse,",
+ " tDiffuse,",
+ " resolution,",
+ " vec4(0.0),",
+ " vec4(0.0),",
+ " vec4(0.0),",
+ " 0.75,",
+ " 0.166,",
+ " 0.0833,",
+ " 0.0,",
+ " 0.0,",
+ " 0.0,",
+ " vec4(0.0)",
+ " );",
+ "",
+ " // TODO avoid querying texture twice for same texel",
+ " gl_FragColor.a = texture2D(tDiffuse, vUv).a;",
+ "}"
+ ].join("\n")
}; | false |
Other | mrdoob | three.js | 1b4a6e76cac28743bd3d766f12bc9d594edf5f31.json | Consider opacity when alpha testing | src/renderers/webgl/WebGLSpriteRenderer.js | @@ -315,10 +315,10 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
'vec4 texture = texture2D( map, vUV );',
- 'if ( texture.a < alphaTest ) discard;',
-
'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
+ 'if ( gl_FragColor.a < alphaTest ) discard;',
+
'if ( fogType > 0 ) {',
'float fogFactor = 0.0;', | false |
Other | mrdoob | three.js | 98b2c3db94c5a648791b9a16b58bbaff55780201.json | Use actual depth in fog formula | src/renderers/webgl/WebGLSpriteRenderer.js | @@ -69,6 +69,7 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
fogNear: gl.getUniformLocation( program, 'fogNear' ),
fogFar: gl.getUniformLocation( program, 'fogFar' ),
fogColor: gl.getUniformLocation( program, 'fogColor' ),
+ fogDepth: gl.getUniformLocation( program, 'fogDepth' ),
alphaTest: gl.getUniformLocation( program, 'alphaTest' )
};
@@ -265,6 +266,7 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
'attribute vec2 uv;',
'varying vec2 vUV;',
+ 'varying float fogDepth;',
'void main() {',
@@ -276,13 +278,14 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
- 'vec4 finalPosition;',
+ 'vec4 mvPosition;',
- 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
- 'finalPosition.xy += rotatedPosition;',
- 'finalPosition = projectionMatrix * finalPosition;',
+ 'mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
+ 'mvPosition.xy += rotatedPosition;',
- 'gl_Position = finalPosition;',
+ 'gl_Position = projectionMatrix * mvPosition;',
+
+ 'fogDepth = - mvPosition.z;',
'}'
@@ -306,6 +309,7 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
'uniform float alphaTest;',
'varying vec2 vUV;',
+ 'varying float fogDepth;',
'void main() {',
@@ -317,22 +321,21 @@ function WebGLSpriteRenderer( renderer, gl, state, textures, capabilities ) {
'if ( fogType > 0 ) {',
- 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
'float fogFactor = 0.0;',
'if ( fogType == 1 ) {',
- 'fogFactor = smoothstep( fogNear, fogFar, depth );',
+ 'fogFactor = smoothstep( fogNear, fogFar, fogDepth );',
'} else {',
'const float LOG2 = 1.442695;',
- 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
+ 'fogFactor = exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 );',
'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
'}',
- 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
+ 'gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );',
'}',
| false |
Other | mrdoob | three.js | 8a7b34d332be351320bf7b63cae62ed7635f8da8.json | fix more indentation | examples/js/loaders/FBXLoader.js | @@ -1412,7 +1412,7 @@
}
-// create the main THREE.Group() to be returned by the loader
+ // create the main THREE.Group() to be returned by the loader
function parseScene( FBXTree, connections, deformers, geometryMap, materialMap ) {
var sceneGraph = new THREE.Group();
@@ -1462,7 +1462,7 @@
}
- // parse nodes in FBXTree.Objects.subNodes.Model
+ // parse nodes in FBXTree.Objects.subNodes.Model
function parseModels( FBXTree, deformers, geometryMap, materialMap, connections ) {
var modelMap = new Map();
@@ -1489,8 +1489,8 @@
model = new THREE.Bone();
deformer.bones[ subDeformer.index ] = model;
- // seems like we need this not to make non-connected bone, maybe?
- // TODO: confirm
+ // seems like we need this not to make non-connected bone, maybe?
+ // TODO: confirm
if ( model2 !== null ) model.add( model2 );
}
@@ -1534,7 +1534,7 @@
}
- // create a THREE.PerspectiveCamera or THREE.OrthographicCamera
+ // create a THREE.PerspectiveCamera or THREE.OrthographicCamera
function createCamera( FBXTree, conns ) {
var model;
@@ -1624,7 +1624,7 @@
}
- // Create a THREE.DirectionalLight, THREE.PointLight or THREE.SpotLight
+ // Create a THREE.DirectionalLight, THREE.PointLight or THREE.SpotLight
function createLight( FBXTree, conns ) {
var model;
@@ -1652,7 +1652,7 @@
var type;
- // LightType can be undefined for Point lights
+ // LightType can be undefined for Point lights
if ( lightAttribute.LightType === undefined ) {
type = 0;
@@ -1673,7 +1673,7 @@
var intensity = ( lightAttribute.Intensity === undefined ) ? 1 : lightAttribute.Intensity.value / 100;
- // light disabled
+ // light disabled
if ( lightAttribute.CastLightOnObject !== undefined && lightAttribute.CastLightOnObject.value === 0 ) {
intensity = 0;
@@ -1695,7 +1695,7 @@
}
- // TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?
+ // TODO: could this be calculated linearly from FarAttenuationStart to FarAttenuationEnd?
var decay = 1;
switch ( type ) {
@@ -1720,9 +1720,9 @@
var penumbra = 0;
if ( lightAttribute.OuterAngle !== undefined ) {
- // TODO: this is not correct - FBX calculates outer and inner angle in degrees
- // with OuterAngle > InnerAngle && OuterAngle <= Math.PI
- // while three.js uses a penumbra between (0, 1) to attenuate the inner angle
+ // TODO: this is not correct - FBX calculates outer and inner angle in degrees
+ // with OuterAngle > InnerAngle && OuterAngle <= Math.PI
+ // while three.js uses a penumbra between (0, 1) to attenuate the inner angle
penumbra = THREE.Math.degToRad( lightAttribute.OuterAngle.value );
penumbra = Math.max( penumbra, 1 );
@@ -2051,7 +2051,9 @@
// to attach animations to, since FBX treats animations as animations for the entire scene,
// not just for individual objects.
sceneGraph.skeleton = {
+
bones: Array.from( modelMap.values() ),
+
};
} | false |
Other | mrdoob | three.js | a8991900b5c9045c54e5fbd4ad10480af18abc8c.json | fix comment indentation | examples/js/loaders/FBXLoader.js | @@ -1804,6 +1804,7 @@
materials[ materialsIndex ].skinning = true;
}
+
model = new THREE.SkinnedMesh( geometry, material );
} else {
@@ -1832,13 +1833,13 @@
}
- // FBX does not list materials for Nurbs lines, so we'll just put our own in here.
+ // FBX does not list materials for Nurbs lines, so we'll just put our own in here.
var material = new THREE.LineBasicMaterial( { color: 0x3300ff, linewidth: 1 } );
return new THREE.Line( geometry, material );
}
- // Parse ambient color in FBXTree.GlobalSettings.properties - if it's not set to black (default), create an ambient light
+ // Parse ambient color in FBXTree.GlobalSettings.properties - if it's not set to black (default), create an ambient light
function createAmbientLight( FBXTree, sceneGraph ) {
if ( 'GlobalSettings' in FBXTree && 'AmbientColor' in FBXTree.GlobalSettings.properties ) {
@@ -1859,7 +1860,7 @@
}
- // parse the model node for transform details and apply them to the model
+ // parse the model node for transform details and apply them to the model
function setModelTransforms( FBXTree, model, modelNode, connections, sceneGraph ) {
if ( 'Lcl_Translation' in modelNode.properties ) {
@@ -1896,7 +1897,7 @@
}
- // allow transformed pivots - see https://github.com/mrdoob/three.js/issues/11895
+ // allow transformed pivots - see https://github.com/mrdoob/three.js/issues/11895
if ( 'GeometricTranslation' in modelNode.properties ) {
var array = modelNode.properties.GeometricTranslation.value;
@@ -1929,7 +1930,7 @@
var pos = lookAtTarget.properties.Lcl_Translation.value;
- // DirectionalLight, SpotLight
+ // DirectionalLight, SpotLight
if ( model.target !== undefined ) {
model.target.position.set( pos[ 0 ], pos[ 1 ], pos[ 2 ] );
@@ -1954,12 +1955,12 @@
function bindSkeleton( FBXTree, deformers, geometryMap, modelMap, connections, sceneGraph ) {
- // Now with the bones created, we can update the skeletons and bind them to the skinned meshes.
+ // Now with the bones created, we can update the skeletons and bind them to the skinned meshes.
sceneGraph.updateMatrixWorld( true );
var worldMatrices = new Map();
- // Put skeleton into bind pose.
+ // Put skeleton into bind pose.
if ( 'Pose' in FBXTree.Objects.subNodes ) {
var BindPoseNode = FBXTree.Objects.subNodes.Pose;
@@ -2009,7 +2010,7 @@
}
- // Now that skeleton is in bind pose, bind to model.
+ // Now that skeleton is in bind pose, bind to model.
deformer.skeleton = new THREE.Skeleton( deformer.bones );
var conns = connections.get( deformer.FBX_ID );
@@ -2043,12 +2044,12 @@
}
- //Skeleton is now bound, return objects to starting world positions.
+ //Skeleton is now bound, return objects to starting world positions.
sceneGraph.updateMatrixWorld( true );
- // Silly hack with the animation parsing. We're gonna pretend the scene graph has a skeleton
- // to attach animations to, since FBX treats animations as animations for the entire scene,
- // not just for individual objects.
+ // Silly hack with the animation parsing. We're gonna pretend the scene graph has a skeleton
+ // to attach animations to, since FBX treats animations as animations for the entire scene,
+ // not just for individual objects.
sceneGraph.skeleton = {
bones: Array.from( modelMap.values() ),
}; | false |
Other | mrdoob | three.js | f35e905ba8ebe453053614c0790f8c742f36497d.json | Fix typo and comma splice | docs/examples/loaders/OBJLoader.html | @@ -13,7 +13,7 @@ <h1>[name]</h1>
<div class="desc">A loader for loading a <em>.obj</em> resource.<br />
The <a href="https://en.wikipedia.org/wiki/Wavefront_.obj_file">OBJ file format</a> is a simple data-format
- that represents 3D geometry in a human redeable format as, the position of each vertex, the UV position of
+ that represents 3D geometry in a human readable format as the position of each vertex, the UV position of
each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of
vertices, and texture vertices.
</div> | false |
Other | mrdoob | three.js | 862d444dbe8dbad342bf4bef5eddb1be9fbe6577.json | use consistent language: hex => color | docs/api/scenes/FogExp2.html | @@ -16,9 +16,9 @@ <h1>[name]</h1>
<h2>Constructor</h2>
- <h3>[name]( [page:Integer hex], [page:Float density] )</h3>
+ <h3>[name]( [page:Integer color], [page:Float density] )</h3>
- <div>The hex parameter is passed to the [page:Color] constructor to set the color property. Hex can be a hexadecimal integer or a CSS-style string.</div>
+ <div>The color parameter is passed to the [page:Color] constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.</div>
<h2>Properties</h2>
<h3>[property:String name]</h3> | false |
Other | mrdoob | three.js | 1336b57712a7636b55366f508403e41b00a80089.json | use consistent language: hex => color | docs/api/scenes/Fog.html | @@ -1,50 +1,50 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
+<!DOCTYPE html>
+<html lang="en">
+ <head>
<meta charset="utf-8" />
- <base href="../../" />
- <script src="list.js"></script>
- <script src="page.js"></script>
- <link type="text/css" rel="stylesheet" href="page.css" />
- </head>
- <body>
- <h1>[name]</h1>
-
- <div class="desc">This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.</div>
-
-
- <h2>Constructor</h2>
-
-
- <h3>[name]( [page:Integer hex], [page:Float near], [page:Float far] )</h3>
- <div>The hex parameter is passed to the [page:Color] constructor to set the color property. Hex can be a hexadecimal integer or a CSS-style string.</div>
-
- <h2>Properties</h2>
-
- <h3>[property:String name]</h3>
- <div>Optional name of the object (doesn't need to be unique). Default is an empty string.</div>
-
- <h3>[property:Color color]</h3>
- <div>Fog color. Example: If set to black, far away objects will be rendered black.</div>
-
- <h3>[property:Float near]</h3>
- <div>The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.</div>
- <div>Default is 1.</div>
-
- <h3>[property:Float far]</h3>
- <div>The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.</div>
- <div>Default is 1000.</div>
-
- <h2>Methods</h2>
-
- <h3>[method:Fog clone]()</h3>
- <div>Returns a new fog instance with the same parameters as this one.</div>
-
- <h3>[method:Fog toJSON]()</h3>
- <div>Return fog data in JSON format.</div>
-
- <h2>Source</h2>
-
- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
- </body>
-</html>
+ <base href="../../" />
+ <script src="list.js"></script>
+ <script src="page.js"></script>
+ <link type="text/css" rel="stylesheet" href="page.css" />
+ </head>
+ <body>
+ <h1>[name]</h1>
+
+ <div class="desc">This class contains the parameters that define linear fog, i.e., that grows linearly denser with the distance.</div>
+
+
+ <h2>Constructor</h2>
+
+
+ <h3>[name]( [page:Integer color], [page:Float near], [page:Float far] )</h3>
+ <div>The color parameter is passed to the [page:Color] constructor to set the color property. Color can be a hexadecimal integer or a CSS-style string.</div>
+
+ <h2>Properties</h2>
+
+ <h3>[property:String name]</h3>
+ <div>Optional name of the object (doesn't need to be unique). Default is an empty string.</div>
+
+ <h3>[property:Color color]</h3>
+ <div>Fog color. Example: If set to black, far away objects will be rendered black.</div>
+
+ <h3>[property:Float near]</h3>
+ <div>The minimum distance to start applying fog. Objects that are less than 'near' units from the active camera won't be affected by fog.</div>
+ <div>Default is 1.</div>
+
+ <h3>[property:Float far]</h3>
+ <div>The maximum distance at which fog stops being calculated and applied. Objects that are more than 'far' units away from the active camera won't be affected by fog.</div>
+ <div>Default is 1000.</div>
+
+ <h2>Methods</h2>
+
+ <h3>[method:Fog clone]()</h3>
+ <div>Returns a new fog instance with the same parameters as this one.</div>
+
+ <h3>[method:Fog toJSON]()</h3>
+ <div>Return fog data in JSON format.</div>
+
+ <h2>Source</h2>
+
+ [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
+ </body>
+</html>
| false |
Other | mrdoob | three.js | 8d6fe7198c65d675ec37341e1c37950a1e320eb3.json | remove duplicate text: domElement | docs/api/renderers/WebGLRenderer.html | @@ -129,7 +129,7 @@ <h3>[property:Array clippingPlanes]</h3>
<h3>[property:WebGLRenderingContext context]</h3>
<div>
The renderer obtains a [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext RenderingContext] context
- from its [page:WebGLRenderer.domElement domElement][page:WebGLRenderer.domElement domElement] by default, using
+ from its [page:WebGLRenderer.domElement domElement] by default, using
[link:https://developer.mozilla.org/en/docs/Web/API/HTMLCanvasElement/getContext HTMLCanvasElement.getContext]().<br /><br />
You can create this manually, however it must correspond to the | false |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | docs/api/geometries/BoxBufferGeometry.html | @@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
@@ -44,9 +44,9 @@ <h2>Constructor</h2>
<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
<div>
- width — Width of the sides on the X axis.<br />
- height — Height of the sides on the Y axis.<br />
- depth — Depth of the sides on the Z axis.<br />
+ width — Width of the sides on the X axis. Default is 1.<br />
+ height — Height of the sides on the Y axis. Default is 1.<br />
+ depth — Depth of the sides on the Z axis. Default is 1.<br />
widthSegments — Optional. Number of segmented faces along the width of the sides. Default is 1.<br />
heightSegments — Optional. Number of segmented faces along the height of the sides. Default is 1.<br />
depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1. | true |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | docs/api/geometries/BoxGeometry.html | @@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
@@ -44,9 +44,9 @@ <h2>Constructor</h2>
<h3>[name]([page:Float width], [page:Float height], [page:Float depth], [page:Integer widthSegments], [page:Integer heightSegments], [page:Integer depthSegments])</h3>
<div>
- width — Width of the sides on the X axis.<br />
- height — Height of the sides on the Y axis.<br />
- depth — Depth of the sides on the Z axis.<br />
+ width — Width of the sides on the X axis. Default is 1.<br />
+ height — Height of the sides on the Y axis. Default is 1.<br />
+ depth — Depth of the sides on the Z axis. Default is 1.<br />
widthSegments — Optional. Number of segmented faces along the width of the sides. Default is 1.<br />
heightSegments — Optional. Number of segmented faces along the height of the sides. Default is 1.<br />
depthSegments — Optional. Number of segmented faces along the depth of the sides. Default is 1. | true |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | docs/api/geometries/PlaneBufferGeometry.html | @@ -1,7 +1,7 @@
<!DOCTYPE html>
<html lang="en">
<head>
- <meta charset="utf-8" />
+ <meta charset="utf-8" />
<base href="../../" />
<script src="list.js"></script>
<script src="page.js"></script>
@@ -44,8 +44,8 @@ <h2>Constructor</h2>
<h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments], [page:Integer heightSegments])</h3>
<div>
- width — Width along the X axis.<br />
- height — Height along the Y axis.<br />
+ width — Width along the X axis. Default is 1.<br />
+ height — Height along the Y axis. Default is 1.<br />
widthSegments — Optional. Default is 1. <br />
heightSegments — Optional. Default is 1.
</div> | true |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | docs/api/geometries/PlaneGeometry.html | @@ -15,22 +15,22 @@ <h1>[name]</h1>
<div class="desc">A class for generating plane geometries</div>
<iframe id="scene" src="scenes/geometry-browser.html#PlaneGeometry"></iframe>
-
- <script>
-
- // iOS iframe auto-resize workaround
-
- if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
-
- var scene = document.getElementById( 'scene' );
-
- scene.style.width = getComputedStyle( scene ).width;
- scene.style.height = getComputedStyle( scene ).height;
- scene.setAttribute( 'scrolling', 'no' );
-
- }
-
- </script>
+
+ <script>
+
+ // iOS iframe auto-resize workaround
+
+ if ( /(iPad|iPhone|iPod)/g.test( navigator.userAgent ) ) {
+
+ var scene = document.getElementById( 'scene' );
+
+ scene.style.width = getComputedStyle( scene ).width;
+ scene.style.height = getComputedStyle( scene ).height;
+ scene.setAttribute( 'scrolling', 'no' );
+
+ }
+
+ </script>
<h2>Example</h2>
@@ -44,8 +44,8 @@ <h2>Constructor</h2>
<h3>[name]([page:Float width], [page:Float height], [page:Integer widthSegments], [page:Integer heightSegments])</h3>
<div>
- width — Width along the X axis.<br />
- height — Height along the Y axis.<br />
+ width — Width along the X axis. Default is 1.<br />
+ height — Height along the Y axis. Default is 1.<br />
widthSegments — Optional. Default is 1. <br />
heightSegments — Optional. Default is 1.
</div>
| true |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | src/geometries/BoxGeometry.js | @@ -52,6 +52,10 @@ function BoxBufferGeometry( width, height, depth, widthSegments, heightSegments,
var scope = this;
+ width = width || 1;
+ height = height || 1;
+ depth = depth || 1;
+
// segments
widthSegments = Math.floor( widthSegments ) || 1; | true |
Other | mrdoob | three.js | ea7e9a787878483ded7ba499edee7344e3a00b16.json | Specify default values | src/geometries/PlaneGeometry.js | @@ -45,6 +45,9 @@ function PlaneBufferGeometry( width, height, widthSegments, heightSegments ) {
heightSegments: heightSegments
};
+ width = width || 1;
+ height = height || 1;
+
var width_half = width / 2;
var height_half = height / 2;
| true |
Other | mrdoob | three.js | a8decb519e678ee216709d97845ae8364f53ab0f.json | Add missing words | docs/api/core/Geometry.html | @@ -300,19 +300,19 @@ <h3>[method:null normalize]()</h3>
<h3>[method:Geometry rotateX] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the X axis. This is typically done as a one time operation but not during the render loop.<br>
- [page:Object3D.rotation] for typical real-time mesh rotation.
+ Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:Geometry rotateY] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Y axis. This is typically done as a one time operation but not during the render loop.<br>
- [page:Object3D.rotation] for typical real-time mesh rotation.
+ Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:Geometry rotateZ] ( [page:Float radians] )</h3>
<div>
Rotate the geometry about the Z axis. This is typically done as a one time operation but not during the render loop.<br>
- Use [page:Object3D.rotation] for typical real-time mesh rotation.
+ Use [page:Object3D.rotation] for typical real-time mesh rotation.
</div>
<h3>[method:null sortFacesByMaterialIndex] ( )</h3>
@@ -333,7 +333,7 @@ <h3>[method:JSON toJSON] ( )</h3>
<h3>[method:Geometry translate] ( [page:Float x], [page:Float y], [page:Float z] )</h3>
<div>
Translate the geometry. This is typically done as a one time operation but not during the render loop.<br>
- [page:Object3D.position] for typical real-time mesh translation.
+ Use [page:Object3D.position] for typical real-time mesh translation.
</div>
| false |
Other | mrdoob | three.js | 4e2ead55f8699af5f9bf72f89312af01194dc79e.json | Add missing geometries to ObjectLoader | src/loaders/ObjectLoader.js | @@ -254,9 +254,13 @@ Object.assign( ObjectLoader.prototype, {
break;
case 'DodecahedronGeometry':
+ case 'DodecahedronBufferGeometry':
case 'IcosahedronGeometry':
+ case 'IcosahedronBufferGeometry':
case 'OctahedronGeometry':
+ case 'OctahedronBufferGeometry':
case 'TetrahedronGeometry':
+ case 'TetrahedronBufferGeometry':
geometry = new Geometries[ data.type ](
data.radius,
@@ -318,6 +322,18 @@ Object.assign( ObjectLoader.prototype, {
break;
+ case 'PolyhedronGeometry':
+ case 'PolyhedronBufferGeometry':
+
+ geometry = new Geometries[ data.type ](
+ data.vertices,
+ data.indices,
+ data.radius,
+ data.details
+ );
+
+ break;
+
case 'BufferGeometry':
geometry = bufferGeometryLoader.parse( data ); | false |
Other | mrdoob | three.js | ba5f094e64af26fe547db2e41c478f96b5cc4ca1.json | Remove renderer from GLTFExporter example | examples/misc_exporter_gltf.html | @@ -39,7 +39,7 @@
function exportGLTF( input ) {
- var gltfExporter = new THREE.GLTFExporter( renderer );
+ var gltfExporter = new THREE.GLTFExporter();
gltfExporter.parse( input, function( result ) {
| false |
Other | mrdoob | three.js | 95114947175b47a843d6072c3dc149bcc4eceae6.json | Fix THREE_TO_WEBGL conversion | examples/js/exporters/GLTFExporter.js | @@ -7,12 +7,12 @@
//------------------------------------------------------------------------------
var WEBGL_CONSTANTS = {
POINTS: 0x0000,
- LINES: 0x0001,
- LINE_LOOP: 0x0002,
- LINE_STRIP: 0x0003,
- TRIANGLES: 0x0004,
- TRIANGLE_STRIP: 0x0005,
- TRIANGLE_FAN: 0x0006,
+ LINES: 0x0001,
+ LINE_LOOP: 0x0002,
+ LINE_STRIP: 0x0003,
+ TRIANGLES: 0x0004,
+ TRIANGLE_STRIP: 0x0005,
+ TRIANGLE_FAN: 0x0006,
UNSIGNED_BYTE: 0x1401,
UNSIGNED_SHORT: 0x1403,
@@ -22,21 +22,21 @@ var WEBGL_CONSTANTS = {
ELEMENT_ARRAY_BUFFER: 0x8893,
NEAREST: 0x2600,
- LINEAR: 0x2601,
- NEAREST_MIPMAP_NEAREST: 0x2700,
- LINEAR_MIPMAP_NEAREST: 0x2701,
- NEAREST_MIPMAP_LINEAR: 0x2702,
- LINEAR_MIPMAP_LINEAR: 0x2703
+ LINEAR: 0x2601,
+ NEAREST_MIPMAP_NEAREST: 0x2700,
+ LINEAR_MIPMAP_NEAREST: 0x2701,
+ NEAREST_MIPMAP_LINEAR: 0x2702,
+ LINEAR_MIPMAP_LINEAR: 0x2703
};
var THREE_TO_WEBGL = {
// @TODO Replace with computed property name [THREE.*] when available on es6
- 0x2600: THREE.NearestFilter,
- 0x2601: THREE.LinearFilter,
- 0x2700: THREE.NearestMipMapNearestFilter,
- 0x2701: THREE.LinearMipMapNearestFilter,
- 0x2702: THREE.NearestMipMapLinearFilter,
- 0x2703: THREE.LinearMipMapLinearFilter
+ 1003: WEBGL_CONSTANTS.NEAREST,
+ 1004: WEBGL_CONSTANTS.LINEAR,
+ 1005: WEBGL_CONSTANTS.NEAREST_MIPMAP_NEAREST,
+ 1006: WEBGL_CONSTANTS.LINEAR_MIPMAP_NEAREST,
+ 1007: WEBGL_CONSTANTS.NEAREST_MIPMAP_LINEAR,
+ 1008: WEBGL_CONSTANTS.LINEAR_MIPMAP_LINEAR
};
//------------------------------------------------------------------------------ | false |
Other | mrdoob | three.js | 6bf789c618fa7fc67b34419496135ff2d14718e4.json | Check asset existence to detect glTF version | examples/js/loaders/GLTF2Loader.js | @@ -79,7 +79,7 @@ THREE.GLTF2Loader = ( function () {
var json = JSON.parse( content );
- if ( json.asset.version[0] < 2 ) {
+ if ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {
onError( new Error( 'THREE.GLTF2Loader: Legacy glTF detected. Use THREE.GLTFLoader instead.' ) );
return; | false |
Other | mrdoob | three.js | ee06d68b7b6b5f6b3af01f654bd4aa4a205c23cb.json | Modify export options in example | examples/js/exporters/GLTFExporter.js | @@ -805,55 +805,49 @@ THREE.GLTFExporter.prototype = {
function processObjects ( objects ) {
var scene = new THREE.Scene();
+ scene.name = 'AuxScene';
for ( var i = 0; i < objects.length; i++ ) {
- scene.add( objects[ i ] );
+ // We push directly to children instead of calling `add` to prevent
+ // modify the .parent and break its original scene and hierarchy
+ scene.children.push( objects[ i ] );
}
processScene( scene );
}
+ function processInput( input ) {
- if ( input instanceof Array ) {
+ input = input instanceof Array ? input : [ input ];
- var allScenes = false;
+ var objectsWithoutScene = [];
for ( i = 0; i < input.length; i++ ) {
- allScenes &= input instanceof THREE.Scene;
-
- }
-
- if ( allScenes ) {
-
- for ( i = 0; i < input.length; i++ ) {
+ if ( input[ i ] instanceof THREE.Scene ) {
processScene( input[ i ] );
- }
+ } else {
- } else {
+ objectsWithoutScene.push( input[ i ] );
- processObjects( input );
+ }
}
- } else {
-
- if ( input instanceof THREE.Scene ) {
+ if ( objectsWithoutScene.length > 0 ) {
- processScene( input );
-
- } else {
-
- processObjects( [ input ] );
+ processObjects( objectsWithoutScene );
}
}
+ processInput( input );
+
// Generate buffer
// Create a new blob with all the dataviews from the buffers
var blob = new Blob( dataViews, { type: 'application/octet-binary' } ); | true |
Other | mrdoob | three.js | ee06d68b7b6b5f6b3af01f654bd4aa4a205c23cb.json | Modify export options in example | examples/webgl_exporter_gltf2.html | @@ -12,6 +12,7 @@
overflow: hidden;
}
#info {
+ color: #ccc;
text-align: center;
position: absolute;
top: 0px; width: 100%;
@@ -21,7 +22,12 @@
</head>
<body>
<div id="info">
- <button id="export">Export scene to .GLTF</button>
+ GLTF2 Exporter<br/>
+ <button id="export_scene">Export Scene1</button>
+ <button id="export_scenes">Export Scene1 and Scene 2</button>
+ <button id="export_object">Export Sphere</button>
+ <button id="export_objects">Export Sphere and Grid</button>
+ <button id="export_scene_object">Export Scene1 and Sphere</button>
</div>
<script src="../build/three.js"></script>
@@ -31,20 +37,51 @@
<script>
- document.getElementById( 'export' ).addEventListener( 'click', function () {
+ function exportGLTF( input ) {
var gltfExporter = new THREE.GLTFExporter( renderer );
- gltfExporter.parse( [ scene1 ], function( result ) {
+ gltfExporter.parse( input, function( result ) {
var output = JSON.stringify( result, null, 2 );
console.log( output );
saveString( output, 'scene.gltf' );
} );
+ }
+
+ document.getElementById( 'export_scene' ).addEventListener( 'click', function () {
+
+ exportGLTF( scene1 );
+
+ } );
+
+ document.getElementById( 'export_scenes' ).addEventListener( 'click', function () {
+
+ exportGLTF( [ scene1, scene2 ] );
+
+ } );
+
+ document.getElementById( 'export_object' ).addEventListener( 'click', function () {
+
+ exportGLTF( sphere );
+
} );
+ document.getElementById( 'export_objects' ).addEventListener( 'click', function () {
+
+ exportGLTF( [ sphere, gridHelper ] );
+
+ } );
+
+ document.getElementById( 'export_scene_object' ).addEventListener( 'click', function () {
+
+ exportGLTF( [ scene1, gridHelper ] );
+
+ } );
+
+
var link = document.createElement( 'a' );
link.style.display = 'none';
document.body.appendChild( link ); // Firefox workaround, see #6594
@@ -69,13 +106,13 @@
var container;
- var camera, scene1, renderer;
+ var camera, scene1, scene2, renderer;
+ var gridHelper, sphere;
init();
animate();
function init() {
- var object;
container = document.createElement( 'div' );
document.body.appendChild( container );
@@ -107,7 +144,7 @@
// ---------------------------------------------------------------------
// Grid
// ---------------------------------------------------------------------
- var gridHelper = new THREE.GridHelper( 2000, 20 );
+ gridHelper = new THREE.GridHelper( 2000, 20 );
gridHelper.position.y = -50;
gridHelper.name = "Grid";
scene1.add( gridHelper );
@@ -167,10 +204,10 @@
roughness: 1.0,
flatShading: true
} );
- object = new THREE.Mesh( new THREE.SphereBufferGeometry( 70, 10, 10 ), material );
- object.position.set( 0, 0, 0 );
- object.name = "Sphere";
- scene1.add( object );
+ sphere = new THREE.Mesh( new THREE.SphereBufferGeometry( 70, 10, 10 ), material );
+ sphere.position.set( 0, 0, 0 );
+ sphere.name = "Sphere";
+ scene1.add( sphere );
// Cylinder
material = new THREE.MeshStandardMaterial( {
@@ -362,7 +399,7 @@
// ---------------------------------------------------------------------
// 2nd Scene
// ---------------------------------------------------------------------
- var scene2 = new THREE.Scene();
+ scene2 = new THREE.Scene();
object = new THREE.Mesh( new THREE.BoxBufferGeometry( 100, 100, 100 ), material );
object.position.set( 0, 0, 0 );
object.name = "Cube2ndScene"; | true |
Other | mrdoob | three.js | 4071a40c39f31bbf24f19ea6dfd1f9e1b27c5ddd.json | Reduce ambient light. Add export button | examples/gltf_exporter.html | @@ -11,46 +11,63 @@
margin: 0px;
overflow: hidden;
}
+ #info {
+ text-align: center;
+ position: absolute;
+ top: 0px; width: 100%;
+ padding: 5px;
+ }
</style>
</head>
<body>
+ <div id="info">
+ <button id="export">Export scene to .GLTF</button>
+ </div>
<script src="../build/three.js"></script>
<script src="js/Detector.js"></script>
- <script src="js/libs/stats.min.js"></script>
<script src="js/exporters/GLTFExporter.js"></script>
<script>
- var link = document.createElement( 'a' );
- link.style.display = 'none';
- document.body.appendChild( link ); // Firefox workaround, see #6594
+ document.getElementById( 'export' ).addEventListener( 'click', function () {
- function save( blob, filename ) {
+ var gltfExporter = new THREE.GLTFExporter( renderer );
- link.href = URL.createObjectURL( blob );
- link.download = filename || 'data.json';
- link.click();
+ gltfExporter.parse( [ scene1 ], function( result ) {
- // URL.revokeObjectURL( url ); breaks Firefox...
+ var output = JSON.stringify( result, null, 2 );
+ console.log( output );
+ saveString( output, 'scene.gltf' );
- }
+ } );
- function saveString( text, filename ) {
+ } );
- save( new Blob( [ text ], { type: 'text/plain' } ), filename );
+ var link = document.createElement( 'a' );
+ link.style.display = 'none';
+ document.body.appendChild( link ); // Firefox workaround, see #6594
- }
+ function save( blob, filename ) {
+ link.href = URL.createObjectURL( blob );
+ link.download = filename || 'data.json';
+ link.click();
+ // URL.revokeObjectURL( url ); breaks Firefox...
+ }
+
+ function saveString( text, filename ) {
+ save( new Blob( [ text ], { type: 'text/plain' } ), filename );
+ }
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
- var container, stats;
+ var container;
var camera, scene1, renderer;
@@ -78,12 +95,12 @@
// ---------------------------------------------------------------------
// Ambient light
// ---------------------------------------------------------------------
- scene1.add( new THREE.AmbientLight( 0xffffff ) );
+ scene1.add( new THREE.AmbientLight( 0xffffff, 0.2 ) );
// ---------------------------------------------------------------------
// DirectLight
// ---------------------------------------------------------------------
- var light = new THREE.DirectionalLight( 0xffffff );
+ var light = new THREE.DirectionalLight( 0xffffff, 1 );
light.position.set( 1, 1, 0 );
scene1.add( light );
@@ -235,7 +252,7 @@
geometry.addAttribute( 'position', new THREE.BufferAttribute( positions, 3 ) );
geometry.addAttribute( 'color', new THREE.BufferAttribute( colors, 3 ) );
- object = new THREE.Mesh( geometry, new THREE.MeshStandardMaterial( { side: THREE.DoubleSide, vertexColors: THREE.VertexColors } ) );
+ object = new THREE.Mesh( geometry, new THREE.MeshBasicMaterial( { side: THREE.DoubleSide, vertexColors: THREE.VertexColors } ) );
object.position.set( 140, -40, -250);
object.setDrawMode( THREE.TriangleStripDrawMode );
object.name = 'Custom buffered';
@@ -311,10 +328,8 @@
scene1.add( cameraOrtho );
cameraOrtho.name = 'OrthographicCamera';
- material = new THREE.MeshStandardMaterial( {
+ material = new THREE.MeshLambertMaterial( {
color: 0xffff00,
- metalness: 0.5,
- roughness: 1.0,
side: THREE.DoubleSide
} );
@@ -362,17 +377,10 @@
container.appendChild( renderer.domElement );
- stats = new Stats();
- container.appendChild( stats.dom );
-
//
window.addEventListener( 'resize', onWindowResize, false );
- var gltfExporter = new THREE.GLTFExporter( renderer );
- gltfExporter.parse( [ scene1 ], function( result ) {
- console.log( JSON.stringify( result, null, 2 ) );
- } );
}
function onWindowResize() {
@@ -391,7 +399,6 @@
requestAnimationFrame( animate );
render();
- stats.update();
}
| false |
Other | mrdoob | three.js | b788d8d73a2891aac08d52a27cd4d54abcaef837.json | pass vector to LookAt function | examples/js/loaders/FBXLoader.js | @@ -1780,7 +1780,7 @@
} else { // Cameras and other Object3Ds
- model.lookAt( pos[ 0 ], pos[ 1 ], pos[ 2 ] );
+ model.lookAt( new THREE.Vector3( pos[ 0 ], pos[ 1 ], pos[ 2 ] ) );
}
| false |
Other | mrdoob | three.js | 5b8bc69b1f858fa409f0be3312d641b5a3f3e4ec.json | Fix broken tags in docs | docs/api/math/Frustum.html | @@ -98,7 +98,7 @@ <h3>[method:Frustum setFromMatrix]( [page:Matrix4 matrix] )</h3>
<div>
[page:Matrix4 matrix] - [page:Matrix4] used to set the [page:.planes planes]<br /><br />
- This is used by the [page:WebGLRenderer] to set up the Frustum from a [page:Camera Camera's]
+ This is used by the [page:WebGLRenderer] to set up the Frustum from a [page:Camera Camera]'s
[page:Camera.projectionMatrix projectionMatrix] and [page:Camera.matrixWorldInverse matrixWorldInverse].
</div>
| true |
Other | mrdoob | three.js | 5b8bc69b1f858fa409f0be3312d641b5a3f3e4ec.json | Fix broken tags in docs | docs/api/math/Vector4.html | @@ -231,13 +231,13 @@ <h3>[method:Vector4 normalize]()</h3>
<h3>[method:Vector4 max]( [page:Vector4 v] )</h3>
<div>
- If this vector's x, y, z or w value is less than [page:Vector4 v's] x, y, z or w value, replace
+ If this vector's x, y, z or w value is less than [page:Vector4 v]'s x, y, z or w value, replace
that value with the corresponding max value.
</div>
<h3>[method:Vector4 min]( [page:Vector4 v] )</h3>
<div>
- If this vector's x, y, z or w value is greater than [page:Vector4 v's] x, y, z or w value, replace
+ If this vector's x, y, z or w value is greater than [page:Vector4 v]'s x, y, z or w value, replace
that value with the corresponding min value.
</div>
| true |
Other | mrdoob | three.js | 751b7b10dbb329fc9dfe8b8cfcfc141d7fe41d78.json | Restore previous light position | examples/webgl_animation_cloth.html | @@ -109,7 +109,7 @@
scene.add( new THREE.AmbientLight( 0x666666 ) );
light = new THREE.DirectionalLight( 0xdfebff, 1 );
- light.position.set( -50, 200, -100 );
+ light.position.set( 50, 200, 100 );
light.position.multiplyScalar( 1.3 );
light.castShadow = true; | false |
Other | mrdoob | three.js | 7cd6aa37612f71340bf70fd16d7c1a53c33d81d2.json | Fix typo in Box3.html
"x, y and z" not "x and y" | docs/api/math/Box3.html | @@ -244,7 +244,7 @@ <h3>[method:Box3 setFromBufferAttribute]( [page:BufferAttribute attribute] ) [pa
<h3>[method:Box3 setFromCenterAndSize]( [page:Vector3 center], [page:Vector3 size] )</h3>
<div>
[page:Vector3 center] - Desired center position of the box ([page:Vector3]). <br>
- [page:Vector3 size] - Desired x and y dimensions of the box ([page:Vector3]).<br /><br />
+ [page:Vector3 size] - Desired x, y and z dimensions of the box ([page:Vector3]).<br /><br />
Centers this box on [page:Vector3 center] and sets this box's width and height to the values specified
in [page:Vector3 size]. | false |
Other | mrdoob | three.js | 134c6db6977a9218c1ff96d634412ece7529d5e2.json | fix previous commit | examples/js/loaders/FBXLoader.js | @@ -2046,9 +2046,7 @@
var poseNode = BindPoseNode[ nodeID ].subNodes.PoseNode;
var rawMatWrd = new THREE.Matrix4().fromArray( poseNode.subNodes.Matrix.properties.a );
- worldMatrices.set( parseInt( poseNode.properties.Node ), rawMatWrd )
-
-
+ worldMatrices.set( parseInt( poseNode.properties.Node ), rawMatWrd );
}
| false |
Other | mrdoob | three.js | ec2a091f937a9b95c1812ca81187b9dc41e2a766.json | Simplify animation system | examples/js/loaders/FBXLoader.js | @@ -2144,68 +2144,90 @@
}
- // Parses animation information from nodes in
- // FBXTree.Objects.subNodes.AnimationCurve: child of an AnimationCurveNode, holds the raw animation data (e.g. x axis rotation )
- // FBXTree.Objects.subNodes.AnimationCurveNode: child of an AnimationLayer and connected to whichever node is being animated
- // FBXTree.Objects.subNodes.AnimationLayer: child of an AnimationStack
- // FBXTree.Objects.subNodes.AnimationStack
- // Multiple animation takes are stored in AnimationLayer and AnimationStack
- // Note: There is also FBXTree.Takes, however this seems to be left over from an older version of the
- // format and is no longer used
- function parseAnimations( FBXTree, connections, modelsArray ) {
-
- var rawCurves = FBXTree.Objects.subNodes.AnimationCurve;
- var rawCurveNodes = FBXTree.Objects.subNodes.AnimationCurveNode;
- var rawLayers = FBXTree.Objects.subNodes.AnimationLayer;
- var rawStacks = FBXTree.Objects.subNodes.AnimationStack;
+ function parseAnimations( FBXTree, connections ) {
// since the actual transformation data is stored in FBXTree.Objects.subNodes.AnimationCurve,
// if this is undefined we can safely assume there are no animations
if ( FBXTree.Objects.subNodes.AnimationCurve === undefined ) return undefined;
- var animations = {
+ var curveNodesMap = parseAnimationCurveNodes( FBXTree );
- takes: {},
- fps: getFrameRate( FBXTree ),
+ parseAnimationCurves( FBXTree, connections, curveNodesMap );
- };
+ var layersMap = parseAnimationLayers( FBXTree, connections, curveNodesMap );
+ var rawClips = parseAnimStacks( FBXTree, connections, layersMap );
+
+ return rawClips;
+
+ }
+
+ // parse nodes in FBXTree.Objects.subNodes.AnimationCurveNode
+ // each AnimationCurveNode holds data for an animation transform for a model (e.g. left arm rotation )
+ // and is referenced by an AnimationLayer
+ function parseAnimationCurveNodes( FBXTree ) {
+
+ var rawCurveNodes = FBXTree.Objects.subNodes.AnimationCurveNode;
var curveNodesMap = new Map();
for ( var nodeID in rawCurveNodes ) {
- var animationNode = parseAnimationCurveNode( FBXTree, rawCurveNodes[ nodeID ], connections, modelsArray );
+ var rawCurveNode = rawCurveNodes[ nodeID ];
+
+ if ( rawCurveNode.attrName.match( /S|R|T/ ) !== null ) {
+
+ var curveNode = {
- if ( animationNode !== null ) {
+ id: rawCurveNode.id,
+ attr: rawCurveNode.attrName,
+ curves: {},
- curveNodesMap.set( animationNode.id, animationNode );
+ };
}
+ curveNodesMap.set( curveNode.id, curveNode );
+
}
- for ( nodeID in rawCurves ) {
+ return curveNodesMap;
+
+ }
+
+ // parse nodes in FBXTree.Objects.subNodes.AnimationCurve and connect them up to
+ // previously parsed AnimationCurveNodes. Each AnimationCurve holds data for a single animated
+ // axis ( e.g. times and values of x rotation)
+ function parseAnimationCurves( FBXTree, connections, curveNodesMap ) {
+
+ var rawCurves = FBXTree.Objects.subNodes.AnimationCurve;
+
+ for ( var nodeID in rawCurves ) {
- var animationCurve = parseAnimationCurve( rawCurves[ nodeID ] );
+ var animationCurve = {
+
+ id: rawCurves[ nodeID ].id,
+ times: rawCurves[ nodeID ].subNodes.KeyTime.properties.a.map( convertFBXTimeToSeconds ),
+ values: rawCurves[ nodeID ].subNodes.KeyValueFloat.properties.a,
+
+ };
var conns = connections.get( animationCurve.id );
if ( conns !== undefined ) {
- var firstParentConn = conns.parents[ 0 ];
- var firstParentID = firstParentConn.ID;
- var firstParentRelationship = firstParentConn.relationship;
+ var animationCurveID = conns.parents[ 0 ].ID;
+ var animationCurveRelationship = conns.parents[ 0 ].relationship;
var axis = '';
- if ( firstParentRelationship.match( /X/ ) ) {
+ if ( animationCurveRelationship.match( /X/ ) ) {
axis = 'x';
- } else if ( firstParentRelationship.match( /Y/ ) ) {
+ } else if ( animationCurveRelationship.match( /Y/ ) ) {
axis = 'y';
- } else if ( firstParentRelationship.match( /Z/ ) ) {
+ } else if ( animationCurveRelationship.match( /Z/ ) ) {
axis = 'z';
@@ -2215,515 +2237,317 @@
}
- curveNodesMap.get( firstParentID ).curves[ axis ] = animationCurve;
+ curveNodesMap.get( animationCurveID ).curves[ axis ] = animationCurve;
}
}
- var emptyCurve = {
-
- times: [ 0.0 ],
- values: [ 0.0 ]
-
- };
-
- // loop over rotation values, convert to radians and add any pre rotation
- curveNodesMap.forEach( function ( curveNode ) {
-
- if ( curveNode.attr === 'R' ) {
-
- var curves = curveNode.curves;
-
- if ( curves.x === null ) curves.x = emptyCurve;
- if ( curves.y === null ) curves.y = emptyCurve;
- if ( curves.z === null ) curves.z = emptyCurve;
-
- curves.x.values = curves.x.values.map( THREE.Math.degToRad );
- curves.y.values = curves.y.values.map( THREE.Math.degToRad );
- curves.z.values = curves.z.values.map( THREE.Math.degToRad );
-
- if ( curveNode.preRotations !== null ) {
-
- var preRotations = curveNode.preRotations.map( THREE.Math.degToRad );
- preRotations.push( 'ZYX' );
- preRotations = new THREE.Euler().fromArray( preRotations );
- preRotations = new THREE.Quaternion().setFromEuler( preRotations );
-
- var frameRotation = new THREE.Euler();
- var frameRotationQuaternion = new THREE.Quaternion();
-
- for ( var frame = 0; frame < curves.x.times.length; ++ frame ) {
-
- frameRotation.set( curves.x.values[ frame ], curves.y.values[ frame ], curves.z.values[ frame ], 'ZYX' );
- frameRotationQuaternion.setFromEuler( frameRotation ).premultiply( preRotations );
- frameRotation.setFromQuaternion( frameRotationQuaternion, 'ZYX' );
- curves.x.values[ frame ] = frameRotation.x;
- curves.y.values[ frame ] = frameRotation.y;
- curves.z.values[ frame ] = frameRotation.z;
-
- }
-
- }
+ }
- }
+ // parse nodes in FBXTree.Objects.subNodes.AnimationLayer. Each layers holds references
+ // to various AnimationCurveNodes and is referenced by an AnimationStack node
+ // note: theoretically a stack can multiple layers, however in practice there always seems to be one per stack
+ function parseAnimationLayers( FBXTree, connections, curveNodesMap ) {
- } );
+ var rawLayers = FBXTree.Objects.subNodes.AnimationLayer;
var layersMap = new Map();
for ( var nodeID in rawLayers ) {
- var layer = [];
+ var layerCurveNodes = [];
var connection = connections.get( parseInt( nodeID ) );
if ( connection !== undefined ) {
+ // all the animationCurveNodes used in the layer
var children = connection.children;
- for ( var childIndex = 0; childIndex < children.length; childIndex ++ ) {
-
- // Skip lockInfluenceWeights
- if ( curveNodesMap.has( children[ childIndex ].ID ) ) {
-
- var curveNode = curveNodesMap.get( children[ childIndex ].ID );
- var modelIndex = curveNode.modelIndex;
-
- if ( layer[ modelIndex ] === undefined ) {
-
- layer[ modelIndex ] = {
- T: null,
- R: null,
- S: null
- };
-
- }
-
- layer[ modelIndex ][ curveNode.attr ] = curveNode;
-
- }
+ children.forEach( function ( child, i ) {
- }
+ if ( curveNodesMap.has( child.ID ) ) {
- layersMap.set( parseInt( nodeID ), layer );
+ var curveNode = curveNodesMap.get( child.ID );
- }
+ if ( layerCurveNodes[ i ] === undefined ) {
- }
+ var modelID = connections.get( child.ID ).parents[ 1 ].ID;
- for ( var nodeID in rawStacks ) {
+ var rawModel = FBXTree.Objects.subNodes.Model[ modelID.toString() ];
- var layers = [];
- var children = connections.get( parseInt( nodeID ) ).children;
- var timestamps = { max: 0, min: Number.MAX_VALUE };
+ var node = {
- for ( var childIndex = 0; childIndex < children.length; ++ childIndex ) {
+ modelName: THREE.PropertyBinding.sanitizeNodeName( rawModel.attrName ),
+ initialPosition: [ 0, 0, 0 ],
+ initialRotation: [ 0, 0, 0 ],
+ initialScale: [ 1, 1, 1 ],
- var currentLayer = layersMap.get( children[ childIndex ].ID );
-
- if ( currentLayer !== undefined ) {
+ };
- layers.push( currentLayer );
+ if ( 'Lcl_Translation' in rawModel.properties ) node.initialPosition = rawModel.properties.Lcl_Translation.value;
- for ( var currentLayerIndex = 0, currentLayerLength = currentLayer.length; currentLayerIndex < currentLayerLength; ++ currentLayerIndex ) {
+ if ( 'Lcl_Rotation' in rawModel.properties ) node.initialRotation = rawModel.properties.Lcl_Rotation.value;
- var layer = currentLayer[ currentLayerIndex ];
+ if ( 'Lcl_Scaling' in rawModel.properties ) node.initialScale = rawModel.properties.Lcl_Scaling.value;
- if ( layer ) {
+ // if the animated model is pre rotated, we'll have to apply the pre rotations to every
+ // animation value as well
+ if ( 'PreRotation' in rawModel.properties ) node.preRotations = rawModel.properties.PreRotation.value;
- getCurveNodeMaxMinTimeStamps( layer, timestamps );
+ layerCurveNodes[ i ] = node;
}
- }
-
- }
-
- }
-
- // Do we have an animation clip with actual length?
- if ( timestamps.max > timestamps.min ) {
+ layerCurveNodes[ i ][ curveNode.attr ] = curveNode;
- animations.takes[ nodeID ] = {
+ }
- name: rawStacks[ nodeID ].attrName,
- layers: layers,
- length: timestamps.max - timestamps.min,
- frames: ( timestamps.max - timestamps.min ) * animations.fps
+ } );
- };
+ layersMap.set( parseInt( nodeID ), layerCurveNodes );
}
}
- return animations;
+ return layersMap;
}
- // parse a node in FBXTree.Objects.subNodes.AnimationCurveNode
- function parseAnimationCurveNode( FBXTree, animationCurveNode, connections, modelsArray ) {
-
- var rawModels = FBXTree.Objects.subNodes.Model;
-
- var returnObject = {
-
- id: animationCurveNode.id,
- attr: animationCurveNode.attrName,
- modelIndex: - 1,
- curves: {
- x: null,
- y: null,
- z: null
- },
- preRotations: null,
-
- };
-
- if ( returnObject.attr.match( /S|R|T/ ) === null ) return null;
-
- // get a list of parents - one of these will be the model being animated by this curve
- var parents = connections.get( returnObject.id ).parents;
+ // parse nodes in FBXTree.Objects.subNodes.AnimationStack. These are the top level node in the animation
+ // hierarchy. Each Stack node will be used to create a THREE.AnimationClip
+ function parseAnimStacks( FBXTree, connections, layersMap ) {
- for ( var i = parents.length - 1; i >= 0; -- i ) {
-
- // the index of the model in the modelsArray
- var modelIndex = findIndex( modelsArray, function ( model ) {
+ var rawStacks = FBXTree.Objects.subNodes.AnimationStack;
- return model.FBX_ID === parents[ i ].ID;
+ // connect the stacks (clips) up to the layers
+ var rawClips = {};
- } );
+ for ( var nodeID in rawStacks ) {
- if ( modelIndex > - 1 ) {
+ var children = connections.get( parseInt( nodeID ) ).children;
- returnObject.modelIndex = modelIndex;
+ if ( children.length > 1 ) {
- var model = rawModels[ parents[ i ].ID.toString() ];
+ // it seems like stacks will always be associated with a single layer. But just in case there are files
+ // where there are multiple layers per stack, we'll display a warning
+ console.warn( 'THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.' );
- //if the animated model is pre rotated, we'll have to apply the pre rotations to every
- // animation value as well
- if ( 'PreRotation' in model.properties ) {
+ }
- returnObject.preRotations = model.properties.PreRotation.value;
+ var layer = layersMap.get( children[ 0 ].ID );
- }
+ rawClips[ nodeID ] = {
- break;
+ name: rawStacks[ nodeID ].attrName,
+ layer: layer,
- }
+ };
}
- return returnObject;
+ return rawClips;
}
- // parse single node in FBXTree.Objects.subNodes.AnimationCurve
- function parseAnimationCurve( animationCurve ) {
+ // take raw animation data from parseAnimations and connect it up to the loaded models
+ function addAnimations( FBXTree, connections, sceneGraph ) {
- return {
+ sceneGraph.animations = [];
- id: animationCurve.id,
- times: animationCurve.subNodes.KeyTime.properties.a.map( convertFBXTimeToSeconds ),
- values: animationCurve.subNodes.KeyValueFloat.properties.a,
+ var rawClips = parseAnimations( FBXTree, connections );
- };
+ if ( rawClips === undefined ) return;
- }
+ for ( var key in rawClips ) {
- function getFrameRate( FBXTree ) {
-
- var fps = 30; // default framerate
-
- if ( 'GlobalSettings' in FBXTree && 'TimeMode' in FBXTree.GlobalSettings.properties ) {
-
- /* Autodesk time mode documentation can be found here:
- * http://docs.autodesk.com/FBX/2014/ENU/FBX-SDK-Documentation/index.html?url=cpp_ref/class_fbx_time.html,topicNumber=cpp_ref_class_fbx_time_html
- */
- var timeModeEnum = [
- 30, // 0: eDefaultMode
- 120, // 1: eFrames120
- 100, // 2: eFrames100
- 60, // 3: eFrames60
- 50, // 4: eFrames50
- 48, // 5: eFrames48
- 30, // 6: eFrames30 (black and white NTSC )
- 30, // 7: eFrames30Drop
- 29.97, // 8: eNTSCDropFrame
- 29.97, // 90: eNTSCFullFrame
- 25, // 10: ePal ( PAL/SECAM )
- 24, // 11: eFrames24 (Film/Cinema)
- 1, // 12: eFrames1000 (use for date time))
- 23.976, // 13: eFilmFullFrame
- 30, // 14: eCustom: use GlobalSettings.properties.CustomFrameRate.value
- 96, // 15: eFrames96
- 72, // 16: eFrames72
- 59.94, // 17: eFrames59dot94
- ];
+ var rawClip = rawClips[ key ];
- var eMode = FBXTree.GlobalSettings.properties.TimeMode.value;
+ var clip = addClip( rawClip );
- if ( eMode === 14 ) {
-
- if ( 'CustomFrameRate' in FBXTree.GlobalSettings.properties ) {
+ sceneGraph.animations.push( clip );
- fps = FBXTree.GlobalSettings.properties.CustomFrameRate.value;
+ }
- fps = ( fps === - 1 ) ? 30 : fps;
+ }
- }
+ function addClip( rawClip ) {
- } else if ( eMode <= 17 ) { // for future proofing - if more eModes get added, they will default to 30fps
+ var tracks = [];
- fps = timeModeEnum[ eMode ];
+ rawClip.layer.forEach( function ( rawTracks ) {
- }
+ tracks = tracks.concat( generateTracks( rawTracks ) );
- }
+ } );
- return fps;
+ return new THREE.AnimationClip( rawClip.name, - 1, tracks );
}
- // Sets the maxTimeStamp and minTimeStamp variables if it has timeStamps that are either larger or smaller
- // than the max or min respectively.
- function getCurveNodeMaxMinTimeStamps( layer, timestamps ) {
+ function generateTracks( rawTracks ) {
- if ( layer.R ) {
+ var tracks = [];
- getCurveMaxMinTimeStamp( layer.R.curves, timestamps );
+ if ( rawTracks.T !== undefined ) {
- }
- if ( layer.S ) {
-
- getCurveMaxMinTimeStamp( layer.S.curves, timestamps );
+ var positionTrack = generateVectorTrack( rawTracks.modelName, rawTracks.T.curves, rawTracks.initialPosition, 'position' );
+ if ( positionTrack !== undefined ) tracks.push( positionTrack );
}
- if ( layer.T ) {
-
- getCurveMaxMinTimeStamp( layer.T.curves, timestamps );
-
- }
-
- }
-
- // Sets the maxTimeStamp and minTimeStamp if one of the curve's time stamps
- // exceeds the maximum or minimum.
- function getCurveMaxMinTimeStamp( curve, timestamps ) {
- if ( curve.x ) {
+ if ( rawTracks.R !== undefined ) {
- getCurveAxisMaxMinTimeStamps( curve.x, timestamps );
+ var rotationTrack = generateRotationTrack( rawTracks.modelName, rawTracks.R.curves, rawTracks.initialRotation, rawTracks.preRotations );
+ if ( rotationTrack !== undefined ) tracks.push( rotationTrack );
}
- if ( curve.y ) {
- getCurveAxisMaxMinTimeStamps( curve.y, timestamps );
+ if ( rawTracks.S !== undefined ) {
- }
- if ( curve.z ) {
-
- getCurveAxisMaxMinTimeStamps( curve.z, timestamps );
+ var scaleTrack = generateVectorTrack( rawTracks.modelName, rawTracks.S.curves, rawTracks.initialScale, 'scale' );
+ if ( scaleTrack !== undefined ) tracks.push( scaleTrack );
}
- }
-
- // Sets the maxTimeStamp and minTimeStamp if one of its timestamps exceeds the maximum or minimum.
- function getCurveAxisMaxMinTimeStamps( axis, timestamps ) {
-
- timestamps.max = axis.times[ axis.times.length - 1 ] > timestamps.max ? axis.times[ axis.times.length - 1 ] : timestamps.max;
- timestamps.min = axis.times[ 0 ] < timestamps.min ? axis.times[ 0 ] : timestamps.min;
+ return tracks;
}
- function addAnimations( FBXTree, connections, sceneGraph, modelMap ) {
+ function generateVectorTrack( modelName, curves, initialValue, type ) {
- // create a flattened array of all models and bones in the scene
- var modelsArray = Array.from( modelMap.values() );
+ var times = getTimesForAllAxes( curves );
+ var values = getKeyframeTrackValues( times, curves, initialValue );
- sceneGraph.animations = [];
+ return new THREE.VectorKeyframeTrack( modelName + '.' + type, times, values );
- var animations = parseAnimations( FBXTree, connections, modelsArray );
-
- if ( animations === undefined ) return;
+ }
- // Silly hack with the animation parsing. We're gonna pretend the scene graph has a skeleton
- // to attach animations to, since FBX treats animations as animations for the entire scene,
- // not just for individual objects.
- sceneGraph.skeleton = {
+ function generateRotationTrack( modelName, curves, initialValue, preRotations ) {
- bones: modelsArray,
+ if ( curves.x !== undefined ) curves.x.values = curves.x.values.map( THREE.Math.degToRad );
+ if ( curves.y !== undefined ) curves.y.values = curves.y.values.map( THREE.Math.degToRad );
+ if ( curves.z !== undefined ) curves.z.values = curves.z.values.map( THREE.Math.degToRad );
- };
+ var times = getTimesForAllAxes( curves );
+ var values = getKeyframeTrackValues( times, curves, initialValue );
- for ( var key in animations.takes ) {
+ if ( preRotations !== undefined ) {
- var take = animations.takes[ key ];
+ preRotations = preRotations.map( THREE.Math.degToRad );
+ preRotations.push( 'ZYX' );
- var clip = addTake( take, animations.fps, modelsArray );
-
- sceneGraph.animations.push( clip );
+ preRotations = new THREE.Euler().fromArray( preRotations );
+ preRotations = new THREE.Quaternion().setFromEuler( preRotations );
}
- }
-
- function addTake( take, fps, modelsArray ) {
+ var quaternion = new THREE.Quaternion();
+ var euler = new THREE.Euler();
- var animationData = {
- name: take.name,
- fps: fps,
- length: take.length,
- hierarchy: []
- };
+ var quaternionValues = [];
- animationData.hierarchy = modelsArray.map( ( model, i ) => {
+ for ( var i = 0; i < values.length; i += 3 ) {
- var keys = [];
+ euler.set( values[ i ], values[ i + 1 ], values[ i + 2 ], 'ZYX' );
- // note: assumes that the animation has been baked at one keyframe per frame
- for ( var frame = 0; frame <= take.frames; frame ++ ) {
+ quaternion.setFromEuler( euler );
- var animationNode = take.layers[ 0 ][ i ];
- keys.push( generateKey( fps, animationNode, model, frame ) );
+ if ( preRotations !== undefined )quaternion.premultiply( preRotations );
- }
+ quaternion.toArray( quaternionValues, ( i / 3 ) * 4 );
- return { name: model.name, keys: keys };
-
- } );
+ }
- return THREE.AnimationClip.parseAnimation( animationData, modelsArray );
+ return new THREE.QuaternionKeyframeTrack( modelName + '.quaternion', times, quaternionValues );
}
- var euler = new THREE.Euler();
- var quaternion = new THREE.Quaternion();
-
- function generateKey( fps, animationNode, model, frame ) {
-
- var key = {
+ function getKeyframeTrackValues( times, curves, initialValue ) {
- time: frame / fps,
- pos: model.position.toArray(),
- rot: model.quaternion.toArray(),
- scl: model.scale.toArray(),
+ var prevValue = initialValue;
- };
-
- if ( animationNode === undefined ) return key;
-
- euler.setFromQuaternion( model.quaternion, 'ZYX', false );
-
- if ( hasCurve( animationNode, 'T' ) && hasKeyOnFrame( animationNode.T, frame ) ) {
-
- if ( animationNode.T.curves.x.values[ frame ] ) {
-
- key.pos[ 0 ] = animationNode.T.curves.x.values[ frame ];
-
- }
-
- if ( animationNode.T.curves.y.values[ frame ] ) {
-
- key.pos[ 1 ] = animationNode.T.curves.y.values[ frame ];
-
- }
-
- if ( animationNode.T.curves.z.values[ frame ] ) {
-
- key.pos[ 2 ] = animationNode.T.curves.z.values[ frame ];
+ var values = [];
- }
-
- }
+ var xIndex = - 1;
+ var yIndex = - 1;
+ var zIndex = - 1;
- if ( hasCurve( animationNode, 'R' ) && hasKeyOnFrame( animationNode.R, frame ) ) {
+ times.forEach( function ( time ) {
- // Only update the euler's values if rotation is defined for the axis on this frame
- if ( animationNode.R.curves.x.values[ frame ] ) {
+ if ( curves.x ) xIndex = curves.x.times.indexOf( time );
+ if ( curves.y ) yIndex = curves.y.times.indexOf( time );
+ if ( curves.z ) zIndex = curves.z.times.indexOf( time );
- euler.x = animationNode.R.curves.x.values[ frame ];
+ // if there is an x value defined for this frame, use that
+ if ( xIndex !== - 1 ) {
- }
-
- if ( animationNode.R.curves.y.values[ frame ] ) {
-
- euler.y = animationNode.R.curves.y.values[ frame ];
-
- }
+ var xValue = curves.x.values[ xIndex ];
+ values.push( xValue );
+ prevValue[ 0 ] = xValue;
- if ( animationNode.R.curves.z.values[ frame ] ) {
+ } else {
- euler.z = animationNode.R.curves.z.values[ frame ];
+ // otherwise use the x value from the previous frame
+ values.push( prevValue[ 0 ] );
}
- quaternion.setFromEuler( euler );
- key.rot = quaternion.toArray();
-
- }
+ if ( yIndex !== - 1 ) {
- if ( hasCurve( animationNode, 'S' ) && hasKeyOnFrame( animationNode.S, frame ) ) {
+ var yValue = curves.y.values[ yIndex ];
+ values.push( yValue );
+ prevValue[ 1 ] = yValue;
- if ( animationNode.T.curves.x.values[ frame ] ) {
+ } else {
- key.scl[ 0 ] = animationNode.S.curves.x.values[ frame ];
+ values.push( prevValue[ 1 ] );
}
- if ( animationNode.T.curves.y.values[ frame ] ) {
+ if ( zIndex !== - 1 ) {
- key.scl[ 1 ] = animationNode.S.curves.y.values[ frame ];
+ var zValue = curves.z.values[ zIndex ];
+ values.push( zValue );
+ prevValue[ 2 ] = zValue;
- }
-
- if ( animationNode.T.curves.z.values[ frame ] ) {
+ } else {
- key.scl[ 2 ] = animationNode.S.curves.z.values[ frame ];
+ values.push( prevValue[ 2 ] );
}
- }
+ } );
- return key;
+ return values;
}
- var AXES = [ 'x', 'y', 'z' ];
-
- function hasCurve( animationNode, attribute ) {
+ // For all animated objects, times are defined separately for each axis
+ // Here we'll combine the times into one sorted array without duplicates
+ function getTimesForAllAxes( curves ) {
- if ( animationNode === undefined ) {
+ var times = [];
- return false;
+ // first join together the times for each axis, if defined
+ if ( curves.x !== undefined ) times = times.concat( curves.x.times );
+ if ( curves.y !== undefined ) times = times.concat( curves.y.times );
+ if ( curves.z !== undefined ) times = times.concat( curves.z.times );
- }
-
- var attributeNode = animationNode[ attribute ];
-
- if ( ! attributeNode ) {
+ // then sort them and remove duplicates
+ times = times.sort( function ( a, b ) {
- return false;
+ return a - b;
- }
-
- return AXES.every( function ( key ) {
+ } ).filter( function ( elem, index, array ) {
- return attributeNode.curves[ key ] !== null;
+ return array.indexOf( elem ) == index;
} );
- }
-
- function hasKeyOnFrame( attributeNode, frame ) {
-
- return AXES.every( function ( key ) {
-
- return attributeNode.curves[ key ].values[ frame ] !== undefined;
-
- } );
+ return times;
}
| false |
Other | mrdoob | three.js | 280b37729d3ed57050ff330944cc2b9501018af0.json | Apply negative scale to geometry instead of mesh | examples/canvas_geometry_panorama.html | @@ -81,8 +81,10 @@
];
- mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), materials );
- mesh.scale.x = - 1;
+ var geometry = new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 );
+ geometry.scale( - 1, 1, 1 );
+
+ mesh = new THREE.Mesh( geometry, materials );
scene.add( mesh );
renderer = new THREE.CanvasRenderer(); | true |
Other | mrdoob | three.js | 280b37729d3ed57050ff330944cc2b9501018af0.json | Apply negative scale to geometry instead of mesh | examples/canvas_geometry_panorama_fisheye.html | @@ -81,8 +81,10 @@
];
- mesh = new THREE.Mesh( new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 ), materials );
- mesh.scale.x = - 1;
+ var geometry = new THREE.BoxGeometry( 300, 300, 300, 7, 7, 7 );
+ geometry.scale( - 1, 1, 1 );
+
+ mesh = new THREE.Mesh( geometry, materials );
scene.add( mesh );
for ( var i = 0, l = mesh.geometry.vertices.length; i < l; i ++ ) { | true |
Other | mrdoob | three.js | 280b37729d3ed57050ff330944cc2b9501018af0.json | Apply negative scale to geometry instead of mesh | examples/webgl_materials_cubemap_dynamic2.html | @@ -61,7 +61,7 @@
scene = new THREE.Scene();
var mesh = new THREE.Mesh( new THREE.SphereBufferGeometry( 500, 32, 16 ), new THREE.MeshBasicMaterial( { map: texture } ) );
- mesh.scale.x = -1;
+ mesh.geometry.scale( - 1, 1, 1 );
scene.add( mesh );
renderer = new THREE.WebGLRenderer( { antialias: true } ); | true |
Other | mrdoob | three.js | 106b374183e884e15c94a84c7617c668ce427d7c.json | Add missing isGroup property to Group | src/objects/Group.js | @@ -14,7 +14,9 @@ function Group() {
Group.prototype = Object.assign( Object.create( Object3D.prototype ), {
- constructor: Group
+ constructor: Group,
+
+ isGroup: true
} );
| false |
Other | mrdoob | three.js | feee8a9c023f645878c7a9ad01c6024a55b84b46.json | remove unused variable in AWDLoader | examples/js/loaders/AWDLoader.js | @@ -692,15 +692,12 @@
num_subs = this.readU16(),
geom,
subs_parsed = 0,
- props,
buffer,
skinW, skinI,
geometries = [];
-
- props = this.parseProperties( {
- 1: this._geoNrType,
- 2: this._geoNrType
- } );
+
+ // Ignore for now
+ this.parseProperties( { 1: this._geoNrType, 2: this._geoNrType } );
// Loop through sub meshes
while ( subs_parsed < num_subs ) { | false |
Other | mrdoob | three.js | 3d7b8cde3c70bbe871a9d1ce7bb0718db557e98f.json | fix a typo | docs/manual/buildTools/Testing-with-NPM.html | @@ -144,7 +144,7 @@ <h2>Add three.js</h2>
<li>
Mocha will look for tests in test/, so let's
<code>
- $ mkdir test.
+ $ mkdir test
</code>
</li>
| false |
Other | mrdoob | three.js | 0745c92187cecd9454043cf80ec2f484febef47f.json | fix a typo | docs/manual/buildTools/Testing-with-NPM.html | @@ -106,7 +106,7 @@ <h2>Add mocha</h2>
<li>
Rerun the test with
<code>
- $ npm test.
+ $ npm test
</code>
This should now succeed, reporting 0 passing (1ms) | false |
Other | mrdoob | three.js | 60d1be3ff0d14d233ba60f4fdbf2d95b663c18cd.json | fix a typo | docs/manual/introduction/Import-via-modules.html | @@ -65,7 +65,7 @@ <h2>Importing the module</h2>
<h2>Caveats</h2>
<div>
- Currently it's not possible to import the files within the "examples/js" directroy in this way.
+ Currently it's not possible to import the files within the "examples/js" directory in this way.
This is due to some of the files relying on global namespace pollution of THREE. For more information see <a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank">Transform `examples/js` to support modules #9562</a>.
</div>
</body> | false |
Other | mrdoob | three.js | 53072cb1e57f1b4f1ba6b5466e8ac45d30a2cca9.json | Add file extensions to legacy import paths | src/Three.Legacy.js | @@ -20,12 +20,12 @@ import {
} from './core/BufferAttribute.js';
import { BufferGeometry } from './core/BufferGeometry.js';
import { Face3 } from './core/Face3.js';
-import { Geometry } from './core/Geometry';
+import { Geometry } from './core/Geometry.js';
import { Object3D } from './core/Object3D.js';
-import { Uniform } from './core/Uniform';
+import { Uniform } from './core/Uniform.js';
import { Curve } from './extras/core/Curve.js';
import { CatmullRomCurve3 } from './extras/curves/CatmullRomCurve3.js';
-import { BoxHelper } from './helpers/BoxHelper';
+import { BoxHelper } from './helpers/BoxHelper.js';
import { GridHelper } from './helpers/GridHelper.js';
import { SkeletonHelper } from './helpers/SkeletonHelper.js';
import { BoxGeometry } from './geometries/BoxGeometry.js'; | false |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/AnimationAction.js | @@ -1,4 +1,4 @@
-import { WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, LoopPingPong, LoopOnce, LoopRepeat } from '../constants';
+import { WrapAroundEnding, ZeroCurvatureEnding, ZeroSlopeEnding, LoopPingPong, LoopOnce, LoopRepeat } from '../constants.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/AnimationClip.js | @@ -1,9 +1,9 @@
-import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack';
-import { QuaternionKeyframeTrack } from './tracks/QuaternionKeyframeTrack';
-import { NumberKeyframeTrack } from './tracks/NumberKeyframeTrack';
-import { AnimationUtils } from './AnimationUtils';
-import { KeyframeTrack } from './KeyframeTrack';
-import { _Math } from '../math/Math';
+import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack.js';
+import { QuaternionKeyframeTrack } from './tracks/QuaternionKeyframeTrack.js';
+import { NumberKeyframeTrack } from './tracks/NumberKeyframeTrack.js';
+import { AnimationUtils } from './AnimationUtils.js';
+import { KeyframeTrack } from './KeyframeTrack.js';
+import { _Math } from '../math/Math.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/AnimationMixer.js | @@ -1,9 +1,9 @@
-import { AnimationAction } from './AnimationAction';
-import { EventDispatcher } from '../core/EventDispatcher';
-import { LinearInterpolant } from '../math/interpolants/LinearInterpolant';
-import { PropertyBinding } from './PropertyBinding';
-import { PropertyMixer } from './PropertyMixer';
-import { AnimationClip } from './AnimationClip';
+import { AnimationAction } from './AnimationAction.js';
+import { EventDispatcher } from '../core/EventDispatcher.js';
+import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
+import { PropertyBinding } from './PropertyBinding.js';
+import { PropertyMixer } from './PropertyMixer.js';
+import { AnimationClip } from './AnimationClip.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/AnimationObjectGroup.js | @@ -1,5 +1,5 @@
-import { PropertyBinding } from './PropertyBinding';
-import { _Math } from '../math/Math';
+import { PropertyBinding } from './PropertyBinding.js';
+import { _Math } from '../math/Math.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/KeyframeTrack.js | @@ -1,12 +1,12 @@
-import { KeyframeTrackPrototype } from './KeyframeTrackPrototype';
-import { StringKeyframeTrack } from './tracks/StringKeyframeTrack';
-import { BooleanKeyframeTrack } from './tracks/BooleanKeyframeTrack';
-import { QuaternionKeyframeTrack } from './tracks/QuaternionKeyframeTrack';
-import { ColorKeyframeTrack } from './tracks/ColorKeyframeTrack';
-import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack';
-import { NumberKeyframeTrack } from './tracks/NumberKeyframeTrack';
-import { AnimationUtils } from './AnimationUtils';
-import { KeyframeTrackConstructor } from './KeyframeTrackConstructor';
+import { KeyframeTrackPrototype } from './KeyframeTrackPrototype.js';
+import { StringKeyframeTrack } from './tracks/StringKeyframeTrack.js';
+import { BooleanKeyframeTrack } from './tracks/BooleanKeyframeTrack.js';
+import { QuaternionKeyframeTrack } from './tracks/QuaternionKeyframeTrack.js';
+import { ColorKeyframeTrack } from './tracks/ColorKeyframeTrack.js';
+import { VectorKeyframeTrack } from './tracks/VectorKeyframeTrack.js';
+import { NumberKeyframeTrack } from './tracks/NumberKeyframeTrack.js';
+import { AnimationUtils } from './AnimationUtils.js';
+import { KeyframeTrackConstructor } from './KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/KeyframeTrackConstructor.js | @@ -1,4 +1,4 @@
-import { AnimationUtils } from './AnimationUtils';
+import { AnimationUtils } from './AnimationUtils.js';
function KeyframeTrackConstructor( name, times, values, interpolation ) {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/KeyframeTrackPrototype.js | @@ -1,9 +1,9 @@
-import { InterpolateLinear } from '../constants';
-import { AnimationUtils } from './AnimationUtils';
-import { InterpolateSmooth, InterpolateDiscrete } from '../constants';
-import { CubicInterpolant } from '../math/interpolants/CubicInterpolant';
-import { LinearInterpolant } from '../math/interpolants/LinearInterpolant';
-import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant';
+import { InterpolateLinear } from '../constants.js';
+import { AnimationUtils } from './AnimationUtils.js';
+import { InterpolateSmooth, InterpolateDiscrete } from '../constants.js';
+import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js';
+import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
+import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js';
var KeyframeTrackPrototype;
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/PropertyMixer.js | @@ -1,4 +1,4 @@
-import { Quaternion } from '../math/Quaternion';
+import { Quaternion } from '../math/Quaternion.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/BooleanKeyframeTrack.js | @@ -1,6 +1,6 @@
-import { InterpolateDiscrete } from '../../constants';
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { InterpolateDiscrete } from '../../constants.js';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/ColorKeyframeTrack.js | @@ -1,5 +1,5 @@
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/NumberKeyframeTrack.js | @@ -1,5 +1,5 @@
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/QuaternionKeyframeTrack.js | @@ -1,7 +1,7 @@
-import { InterpolateLinear } from '../../constants';
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { InterpolateLinear } from '../../constants.js';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { QuaternionLinearInterpolant } from '../../math/interpolants/QuaternionLinearInterpolant.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/StringKeyframeTrack.js | @@ -1,6 +1,6 @@
-import { InterpolateDiscrete } from '../../constants';
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { InterpolateDiscrete } from '../../constants.js';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/animation/tracks/VectorKeyframeTrack.js | @@ -1,5 +1,5 @@
-import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype';
-import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor';
+import { KeyframeTrackPrototype } from '../KeyframeTrackPrototype.js';
+import { KeyframeTrackConstructor } from '../KeyframeTrackConstructor.js';
/**
* | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/audio/Audio.js | @@ -3,7 +3,7 @@
* @author Reece Aaron Lecrivain / http://reecenotes.com/
*/
-import { Object3D } from '../core/Object3D';
+import { Object3D } from '../core/Object3D.js';
function Audio( listener ) {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/audio/AudioListener.js | @@ -2,10 +2,10 @@
* @author mrdoob / http://mrdoob.com/
*/
-import { Vector3 } from '../math/Vector3';
-import { Quaternion } from '../math/Quaternion';
-import { Object3D } from '../core/Object3D';
-import { AudioContext } from './AudioContext';
+import { Vector3 } from '../math/Vector3.js';
+import { Quaternion } from '../math/Quaternion.js';
+import { Object3D } from '../core/Object3D.js';
+import { AudioContext } from './AudioContext.js';
function AudioListener() {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/audio/PositionalAudio.js | @@ -2,9 +2,9 @@
* @author mrdoob / http://mrdoob.com/
*/
-import { Vector3 } from '../math/Vector3';
-import { Audio } from './Audio';
-import { Object3D } from '../core/Object3D';
+import { Vector3 } from '../math/Vector3.js';
+import { Audio } from './Audio.js';
+import { Object3D } from '../core/Object3D.js';
function PositionalAudio( listener ) {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/ArrayCamera.js | @@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
-import { PerspectiveCamera } from './PerspectiveCamera';
+import { PerspectiveCamera } from './PerspectiveCamera.js';
function ArrayCamera( array ) {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/Camera.js | @@ -4,10 +4,10 @@
* @author WestLangley / http://github.com/WestLangley
*/
-import { Matrix4 } from '../math/Matrix4';
-import { Quaternion } from '../math/Quaternion';
-import { Object3D } from '../core/Object3D';
-import { Vector3 } from '../math/Vector3';
+import { Matrix4 } from '../math/Matrix4.js';
+import { Quaternion } from '../math/Quaternion.js';
+import { Object3D } from '../core/Object3D.js';
+import { Vector3 } from '../math/Vector3.js';
function Camera() {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/CubeCamera.js | @@ -1,8 +1,8 @@
-import { Object3D } from '../core/Object3D';
-import { WebGLRenderTargetCube } from '../renderers/WebGLRenderTargetCube';
-import { LinearFilter, RGBFormat } from '../constants';
-import { Vector3 } from '../math/Vector3';
-import { PerspectiveCamera } from './PerspectiveCamera';
+import { Object3D } from '../core/Object3D.js';
+import { WebGLRenderTargetCube } from '../renderers/WebGLRenderTargetCube.js';
+import { LinearFilter, RGBFormat } from '../constants.js';
+import { Vector3 } from '../math/Vector3.js';
+import { PerspectiveCamera } from './PerspectiveCamera.js';
/**
* Camera for rendering cube maps | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/OrthographicCamera.js | @@ -1,5 +1,5 @@
-import { Camera } from './Camera';
-import { Object3D } from '../core/Object3D';
+import { Camera } from './Camera.js';
+import { Object3D } from '../core/Object3D.js';
/**
* @author alteredq / http://alteredqualia.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/PerspectiveCamera.js | @@ -1,6 +1,6 @@
-import { Camera } from './Camera';
-import { Object3D } from '../core/Object3D';
-import { _Math } from '../math/Math';
+import { Camera } from './Camera.js';
+import { Object3D } from '../core/Object3D.js';
+import { _Math } from '../math/Math.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/cameras/StereoCamera.js | @@ -1,6 +1,6 @@
-import { Matrix4 } from '../math/Matrix4';
-import { _Math } from '../math/Math';
-import { PerspectiveCamera } from './PerspectiveCamera';
+import { Matrix4 } from '../math/Matrix4.js';
+import { _Math } from '../math/Math.js';
+import { PerspectiveCamera } from './PerspectiveCamera.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/BufferAttribute.js | @@ -1,8 +1,8 @@
-import { Vector4 } from '../math/Vector4';
-import { Vector3 } from '../math/Vector3';
-import { Vector2 } from '../math/Vector2';
-import { Color } from '../math/Color';
-import { _Math } from '../math/Math';
+import { Vector4 } from '../math/Vector4.js';
+import { Vector3 } from '../math/Vector3.js';
+import { Vector2 } from '../math/Vector2.js';
+import { Color } from '../math/Color.js';
+import { _Math } from '../math/Math.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/BufferGeometry.js | @@ -1,15 +1,15 @@
-import { Vector3 } from '../math/Vector3';
-import { Box3 } from '../math/Box3';
-import { EventDispatcher } from './EventDispatcher';
-import { BufferAttribute, Float32BufferAttribute, Uint16BufferAttribute, Uint32BufferAttribute } from './BufferAttribute';
-import { Sphere } from '../math/Sphere';
-import { DirectGeometry } from './DirectGeometry';
-import { Object3D } from './Object3D';
-import { Matrix4 } from '../math/Matrix4';
-import { Matrix3 } from '../math/Matrix3';
-import { _Math } from '../math/Math';
-import { arrayMax } from '../utils';
-import { GeometryIdCount } from './Geometry';
+import { Vector3 } from '../math/Vector3.js';
+import { Box3 } from '../math/Box3.js';
+import { EventDispatcher } from './EventDispatcher.js';
+import { BufferAttribute, Float32BufferAttribute, Uint16BufferAttribute, Uint32BufferAttribute } from './BufferAttribute.js';
+import { Sphere } from '../math/Sphere.js';
+import { DirectGeometry } from './DirectGeometry.js';
+import { Object3D } from './Object3D.js';
+import { Matrix4 } from '../math/Matrix4.js';
+import { Matrix3 } from '../math/Matrix3.js';
+import { _Math } from '../math/Math.js';
+import { arrayMax } from '../utils.js';
+import { GeometryIdCount } from './Geometry.js';
/**
* @author alteredq / http://alteredqualia.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/DirectGeometry.js | @@ -2,7 +2,7 @@
* @author mrdoob / http://mrdoob.com/
*/
-import { Vector2 } from '../math/Vector2';
+import { Vector2 } from '../math/Vector2.js';
function DirectGeometry() {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/Face3.js | @@ -1,5 +1,5 @@
-import { Color } from '../math/Color';
-import { Vector3 } from '../math/Vector3';
+import { Color } from '../math/Color.js';
+import { Vector3 } from '../math/Vector3.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/Geometry.js | @@ -1,14 +1,14 @@
-import { EventDispatcher } from './EventDispatcher';
-import { Face3 } from './Face3';
-import { Matrix3 } from '../math/Matrix3';
-import { Sphere } from '../math/Sphere';
-import { Box3 } from '../math/Box3';
-import { Vector3 } from '../math/Vector3';
-import { Matrix4 } from '../math/Matrix4';
-import { Vector2 } from '../math/Vector2';
-import { Color } from '../math/Color';
-import { Object3D } from './Object3D';
-import { _Math } from '../math/Math';
+import { EventDispatcher } from './EventDispatcher.js';
+import { Face3 } from './Face3.js';
+import { Matrix3 } from '../math/Matrix3.js';
+import { Sphere } from '../math/Sphere.js';
+import { Box3 } from '../math/Box3.js';
+import { Vector3 } from '../math/Vector3.js';
+import { Matrix4 } from '../math/Matrix4.js';
+import { Vector2 } from '../math/Vector2.js';
+import { Color } from '../math/Color.js';
+import { Object3D } from './Object3D.js';
+import { _Math } from '../math/Math.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/InstancedBufferAttribute.js | @@ -1,4 +1,4 @@
-import { BufferAttribute } from './BufferAttribute';
+import { BufferAttribute } from './BufferAttribute.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/InstancedBufferGeometry.js | @@ -1,4 +1,4 @@
-import { BufferGeometry } from './BufferGeometry';
+import { BufferGeometry } from './BufferGeometry.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/InstancedInterleavedBuffer.js | @@ -1,4 +1,4 @@
-import { InterleavedBuffer } from './InterleavedBuffer';
+import { InterleavedBuffer } from './InterleavedBuffer.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/InterleavedBuffer.js | @@ -1,4 +1,4 @@
-import { _Math } from '../math/Math';
+import { _Math } from '../math/Math.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/InterleavedBufferAttribute.js | @@ -1,4 +1,4 @@
-import { _Math } from '../math/Math';
+import { _Math } from '../math/Math.js';
/**
* @author benaadams / https://twitter.com/ben_a_adams | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/Object3D.js | @@ -1,11 +1,11 @@
-import { Quaternion } from '../math/Quaternion';
-import { Vector3 } from '../math/Vector3';
-import { Matrix4 } from '../math/Matrix4';
-import { EventDispatcher } from './EventDispatcher';
-import { Euler } from '../math/Euler';
-import { Layers } from './Layers';
-import { Matrix3 } from '../math/Matrix3';
-import { _Math } from '../math/Math';
+import { Quaternion } from '../math/Quaternion.js';
+import { Vector3 } from '../math/Vector3.js';
+import { Matrix4 } from '../math/Matrix4.js';
+import { EventDispatcher } from './EventDispatcher.js';
+import { Euler } from '../math/Euler.js';
+import { Layers } from './Layers.js';
+import { Matrix3 } from '../math/Matrix3.js';
+import { _Math } from '../math/Math.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/core/Raycaster.js | @@ -1,4 +1,4 @@
-import { Ray } from '../math/Ray';
+import { Ray } from '../math/Ray.js';
/**
* @author mrdoob / http://mrdoob.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/SceneUtils.js | @@ -1,6 +1,6 @@
-import { Matrix4 } from '../math/Matrix4';
-import { Mesh } from '../objects/Mesh';
-import { Group } from '../objects/Group';
+import { Matrix4 } from '../math/Matrix4.js';
+import { Mesh } from '../objects/Mesh.js';
+import { Group } from '../objects/Group.js';
/**
* @author alteredq / http://alteredqualia.com/ | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/Curve.js | @@ -1,6 +1,6 @@
-import { _Math } from '../../math/Math';
-import { Vector3 } from '../../math/Vector3';
-import { Matrix4 } from '../../math/Matrix4';
+import { _Math } from '../../math/Math.js';
+import { Vector3 } from '../../math/Vector3.js';
+import { Matrix4 } from '../../math/Matrix4.js';
/**
* @author zz85 / http://www.lab4games.net/zz85/blog | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/CurvePath.js | @@ -1,7 +1,7 @@
-import { Curve } from './Curve';
-import { Vector3 } from '../../math/Vector3';
-import { Geometry } from '../../core/Geometry';
-import { LineCurve } from '../curves/LineCurve';
+import { Curve } from './Curve.js';
+import { Vector3 } from '../../math/Vector3.js';
+import { Geometry } from '../../core/Geometry.js';
+import { LineCurve } from '../curves/LineCurve.js';
/**
* @author zz85 / http://www.lab4games.net/zz85/blog | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/Font.js | @@ -3,8 +3,8 @@
* @author mrdoob / http://mrdoob.com/
*/
-import { QuadraticBezier, CubicBezier } from './Interpolations';
-import { ShapePath } from './ShapePath';
+import { QuadraticBezier, CubicBezier } from './Interpolations.js';
+import { ShapePath } from './ShapePath.js';
function Font( data ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/Path.js | @@ -3,9 +3,9 @@
* Creates free form 2d path using series of points, lines or curves.
**/
-import { PathPrototype } from './PathPrototype';
-import { Vector2 } from '../../math/Vector2';
-import { CurvePath } from './CurvePath';
+import { PathPrototype } from './PathPrototype.js';
+import { Vector2 } from '../../math/Vector2.js';
+import { CurvePath } from './CurvePath.js';
function Path( points ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/PathPrototype.js | @@ -1,10 +1,10 @@
-import { CurvePath } from './CurvePath';
-import { EllipseCurve } from '../curves/EllipseCurve';
-import { SplineCurve } from '../curves/SplineCurve';
-import { Vector2 } from '../../math/Vector2';
-import { CubicBezierCurve } from '../curves/CubicBezierCurve';
-import { QuadraticBezierCurve } from '../curves/QuadraticBezierCurve';
-import { LineCurve } from '../curves/LineCurve';
+import { CurvePath } from './CurvePath.js';
+import { EllipseCurve } from '../curves/EllipseCurve.js';
+import { SplineCurve } from '../curves/SplineCurve.js';
+import { Vector2 } from '../../math/Vector2.js';
+import { CubicBezierCurve } from '../curves/CubicBezierCurve.js';
+import { QuadraticBezierCurve } from '../curves/QuadraticBezierCurve.js';
+import { LineCurve } from '../curves/LineCurve.js';
var PathPrototype = Object.assign( Object.create( CurvePath.prototype ), {
| true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/Shape.js | @@ -1,5 +1,5 @@
-import { PathPrototype } from './PathPrototype';
-import { Path } from './Path';
+import { PathPrototype } from './PathPrototype.js';
+import { Path } from './Path.js';
/**
* @author zz85 / http://www.lab4games.net/zz85/blog | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/core/ShapePath.js | @@ -1,6 +1,6 @@
-import { Path } from './Path';
-import { Shape } from './Shape';
-import { ShapeUtils } from '../ShapeUtils';
+import { Path } from './Path.js';
+import { Shape } from './Shape.js';
+import { ShapeUtils } from '../ShapeUtils.js';
/**
* @author zz85 / http://www.lab4games.net/zz85/blog | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/ArcCurve.js | @@ -1,4 +1,4 @@
-import { EllipseCurve } from './EllipseCurve';
+import { EllipseCurve } from './EllipseCurve.js';
function ArcCurve( aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/CatmullRomCurve3.js | @@ -1,5 +1,5 @@
-import { Vector3 } from '../../math/Vector3';
-import { Curve } from '../core/Curve';
+import { Vector3 } from '../../math/Vector3.js';
+import { Curve } from '../core/Curve.js';
/**
* @author zz85 https://github.com/zz85 | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/CubicBezierCurve.js | @@ -1,6 +1,6 @@
-import { Curve } from '../core/Curve';
-import { CubicBezier } from '../core/Interpolations';
-import { Vector2 } from '../../math/Vector2';
+import { Curve } from '../core/Curve.js';
+import { CubicBezier } from '../core/Interpolations.js';
+import { Vector2 } from '../../math/Vector2.js';
function CubicBezierCurve( v0, v1, v2, v3 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/CubicBezierCurve3.js | @@ -1,6 +1,6 @@
-import { Curve } from '../core/Curve';
-import { CubicBezier } from '../core/Interpolations';
-import { Vector3 } from '../../math/Vector3';
+import { Curve } from '../core/Curve.js';
+import { CubicBezier } from '../core/Interpolations.js';
+import { Vector3 } from '../../math/Vector3.js';
function CubicBezierCurve3( v0, v1, v2, v3 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/EllipseCurve.js | @@ -1,5 +1,5 @@
-import { Curve } from '../core/Curve';
-import { Vector2 } from '../../math/Vector2';
+import { Curve } from '../core/Curve.js';
+import { Vector2 } from '../../math/Vector2.js';
function EllipseCurve( aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/LineCurve.js | @@ -1,4 +1,4 @@
-import { Curve } from '../core/Curve';
+import { Curve } from '../core/Curve.js';
function LineCurve( v1, v2 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/LineCurve3.js | @@ -1,5 +1,5 @@
-import { Vector3 } from '../../math/Vector3';
-import { Curve } from '../core/Curve';
+import { Vector3 } from '../../math/Vector3.js';
+import { Curve } from '../core/Curve.js';
function LineCurve3( v1, v2 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/QuadraticBezierCurve.js | @@ -1,6 +1,6 @@
-import { Curve } from '../core/Curve';
-import { QuadraticBezier } from '../core/Interpolations';
-import { Vector2 } from '../../math/Vector2';
+import { Curve } from '../core/Curve.js';
+import { QuadraticBezier } from '../core/Interpolations.js';
+import { Vector2 } from '../../math/Vector2.js';
function QuadraticBezierCurve( v0, v1, v2 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/QuadraticBezierCurve3.js | @@ -1,6 +1,6 @@
-import { Curve } from '../core/Curve';
-import { QuadraticBezier } from '../core/Interpolations';
-import { Vector3 } from '../../math/Vector3';
+import { Curve } from '../core/Curve.js';
+import { QuadraticBezier } from '../core/Interpolations.js';
+import { Vector3 } from '../../math/Vector3.js';
function QuadraticBezierCurve3( v0, v1, v2 ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/curves/SplineCurve.js | @@ -1,6 +1,6 @@
-import { Curve } from '../core/Curve';
-import { CatmullRom } from '../core/Interpolations';
-import { Vector2 } from '../../math/Vector2';
+import { Curve } from '../core/Curve.js';
+import { CatmullRom } from '../core/Interpolations.js';
+import { Vector2 } from '../../math/Vector2.js';
function SplineCurve( points /* array of Vector2 */ ) { | true |
Other | mrdoob | three.js | 680f499d6b227eae8764dcd7504ffa8d59a30173.json | Add file extension to import paths | src/extras/objects/ImmediateRenderObject.js | @@ -1,4 +1,4 @@
-import { Object3D } from '../../core/Object3D';
+import { Object3D } from '../../core/Object3D.js';
/**
* @author alteredq / http://alteredqualia.com/ | true |