Skip to content

Commit

Permalink
Fixes few issues and rebased
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandojsg committed Oct 18, 2017
1 parent dbcb964 commit 9f60f23
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 19 deletions.
8 changes: 4 additions & 4 deletions examples/js/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,10 @@ THREE.GLTFExporter.prototype = {

var gltfSampler = {

magFilter: THREE.WebGLUtils.toGL[ map.magFilter ],
minFilter: THREE.WebGLUtils.toGL[ map.minFilter ],
wrapS: THREE.WebGLUtils.toGL[ map.wrapS ],
wrapT: THREE.WebGLUtils.toGL[ map.wrapT ]
magFilter: THREE.WebGLUtils.toGL( map.magFilter ),
minFilter: THREE.WebGLUtils.toGL( map.minFilter ),
wrapS: THREE.WebGLUtils.toGL( map.wrapS ),
wrapT: THREE.WebGLUtils.toGL( map.wrapT)

};

Expand Down
16 changes: 8 additions & 8 deletions examples/js/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ THREE.GLTFLoader = ( function () {
return parser.getDependency( 'bufferView', accessor.bufferView ).then( function ( bufferView ) {

var itemSize = WEBGL_TYPE_SIZES[ accessor.type ];
var TypedArray = THREE.WEBGL_TO_THREE[ accessor.componentType ];
var TypedArray = THREE.WebGLUtils.fromGL[ accessor.componentType ];

// For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.
var elementBytes = TypedArray.BYTES_PER_ELEMENT;
Expand Down Expand Up @@ -1444,24 +1444,24 @@ THREE.GLTFLoader = ( function () {

if ( textureDef.name !== undefined ) texture.name = textureDef.name;

texture.format = textureDef.format !== undefined ? THREE.WEBGL_TO_THREE[ textureDef.format ] : THREE.RGBAFormat;
texture.format = textureDef.format !== undefined ? THREE.WebGLUtils.fromGL[ textureDef.format ] : THREE.RGBAFormat;

if ( textureDef.internalFormat !== undefined && texture.format !== THREE.WEBGL_TO_THREE[ textureDef.internalFormat ] ) {
if ( textureDef.internalFormat !== undefined && texture.format !== THREE.WebGLUtils.fromGL[ textureDef.internalFormat ] ) {

console.warn( 'THREE.GLTFLoader: Three.js does not support texture internalFormat which is different from texture format. ' +
'internalFormat will be forced to be the same value as format.' );

}

texture.type = textureDef.type !== undefined ? THREE.WEBGL_TO_THREE[ textureDef.type ] : THREE.UnsignedByteType;
texture.type = textureDef.type !== undefined ? THREE.WebGLUtils.fromGL[ textureDef.type ] : THREE.UnsignedByteType;

var samplers = json.samplers || {};
var sampler = samplers[ textureDef.sampler ] || {};

texture.magFilter = THREE.WEBGL_TO_THREE[ sampler.magFilter ] || THREE.LinearFilter;
texture.minFilter = THREE.WEBGL_TO_THREE[ sampler.minFilter ] || THREE.LinearMipMapLinearFilter;
texture.wrapS = THREE.WEBGL_TO_THREE[ sampler.wrapS ] || THREE.RepeatWrapping;
texture.wrapT = THREE.WEBGL_TO_THREE[ sampler.wrapT ] || THREE.RepeatWrapping;
texture.magFilter = THREE.WebGLUtils.fromGL[ sampler.magFilter ] || THREE.LinearFilter;
texture.minFilter = THREE.WebGLUtils.fromGL[ sampler.minFilter ] || THREE.LinearMipMapLinearFilter;
texture.wrapS = THREE.WebGLUtils.fromGL[ sampler.wrapS ] || THREE.RepeatWrapping;
texture.wrapT = THREE.WebGLUtils.fromGL[ sampler.wrapT ] || THREE.RepeatWrapping;

return texture;

Expand Down
8 changes: 1 addition & 7 deletions src/renderers/WebGLRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { Vector3 } from '../math/Vector3.js';
import { WebGLClipping } from './webgl/WebGLClipping.js';
import { Frustum } from '../math/Frustum.js';
import { Vector4 } from '../math/Vector4.js';
import { WebGLUtils } from './webgl/WebGLUtils';
import { WebGLUtils } from './webgl/WebGLUtils.js';

/**
* @author supereggbert / http://www.paulbrunt.co.uk/
Expand Down Expand Up @@ -258,12 +258,6 @@ function WebGLRenderer( parameters ) {
extensions.get( 'OES_element_index_uint' );
extensions.get( 'ANGLE_instanced_arrays' );

if ( extensions.get( 'OES_element_index_uint' ) ) {

BufferGeometry.MaxIndex = 4294967296;

}

capabilities = new WebGLCapabilities( _gl, extensions, parameters );

state = new WebGLState( _gl, extensions );
Expand Down

0 comments on commit 9f60f23

Please sign in to comment.