Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ class WebGLNodeBuilder extends NodeBuilder {

let snippet = '';

for ( let uniform of uniforms ) {
for ( const uniform of uniforms ) {

if ( uniform.type === 'texture' ) {

snippet += `uniform sampler2D ${uniform.name};`;

} else {

let vectorType = this.getVectorType( uniform.type );
const vectorType = this.getVectorType( uniform.type );

snippet += `uniform ${vectorType} ${uniform.name};`;

Expand Down Expand Up @@ -89,7 +89,7 @@ class WebGLNodeBuilder extends NodeBuilder {

const uniforms = this.uniforms[ 'fragment' ];

for ( let uniform of uniforms ) {
for ( const uniform of uniforms ) {

this.properties.uniforms[ uniform.name ] = uniform;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/renderers/webgl/nodes/WebGLNodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function addCodeAfterSnippet( source, snippet, code ) {

Material.prototype.onBuild = function ( parameters, renderer ) {

const nodeBuilder = new WebGLNodeBuilder( this, renderer, parameters ).build();
new WebGLNodeBuilder( this, renderer, parameters ).build();

let fragmentShader = parameters.fragmentShader;

Expand Down
36 changes: 15 additions & 21 deletions examples/webgl_materials_standard_nodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
import Vector3Node from './jsm/renderers/nodes/inputs/Vector3Node.js';
import OperatorNode from './jsm/renderers/nodes/math/OperatorNode.js';

const statsEnabled = true;

let container, stats;

let camera, scene, renderer, controls;
Expand Down Expand Up @@ -118,7 +116,7 @@

};

function loadEnvironment(name) {
function loadEnvironment( name ) {

if ( environments[ name ].texture !== undefined ) {

Expand All @@ -130,18 +128,18 @@

const filename = environments[ name ].filename;
new RGBELoader()
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( filename, function ( hdrEquirect ) {
.setDataType( THREE.UnsignedByteType )
.setPath( 'textures/equirectangular/' )
.load( filename, function ( hdrEquirect ) {

const hdrCubeRenderTarget = pmremGenerator.fromEquirectangular( hdrEquirect );
hdrEquirect.dispose();
const hdrCubeRenderTarget = pmremGenerator.fromEquirectangular( hdrEquirect );
hdrEquirect.dispose();

scene.background = hdrCubeRenderTarget.texture;
scene.environment = hdrCubeRenderTarget.texture;
environments[ name ].texture = hdrCubeRenderTarget.texture;
scene.background = hdrCubeRenderTarget.texture;
scene.environment = hdrCubeRenderTarget.texture;
environments[ name ].texture = hdrCubeRenderTarget.texture;

} );
} );

}

Expand All @@ -153,9 +151,9 @@
loadEnvironment( params.environment );

const gui = new GUI();
gui.add( params, 'environment', Object.keys( environments ) ).onChange( function( value ) {
gui.add( params, 'environment', Object.keys( environments ) ).onChange( function ( value ) {

loadEnvironment(value);
loadEnvironment( value );

} );
gui.open();
Expand All @@ -165,12 +163,8 @@

//

if ( statsEnabled ) {

stats = new Stats();
container.appendChild( stats.dom );

}
stats = new Stats();
container.appendChild( stats.dom );

window.addEventListener( 'resize', onWindowResize );

Expand All @@ -196,7 +190,7 @@
controls.update();
renderer.render( scene, camera );

if ( statsEnabled ) stats.update();
stats.update();

}

Expand Down