Renaud Rohlinger 1 vuosi sitten
vanhempi
commit
5d37af1470

+ 14 - 2
examples/jsm/nodes/display/AfterImageNode.js

@@ -8,6 +8,9 @@ import { uniform } from '../core/UniformNode.js';
 import { RenderTarget } from 'three';
 import { sign, max } from '../math/MathNode.js';
 import QuadMesh from '../../objects/QuadMesh.js';
+import { NoToneMapping, Vector2 } from 'three';
+
+const _size = new Vector2();
 
 const quadMeshComp = new QuadMesh();
 
@@ -58,12 +61,21 @@ class AfterImageNode extends TempNode {
 		this._compRT.texture.type = textureType;
 		this._oldRT.texture.type = textureType;
 
+		renderer.getDrawingBufferSize( _size );
+
+		this.setSize( _size.x, _size.y );
+
+
+		const currentToneMapping = renderer.toneMapping;
+		const currentToneMappingNode = renderer.toneMappingNode;
 		const currentRenderTarget = renderer.getRenderTarget();
 		const currentTexture = textureNode.value;
 
 		this.textureNodeOld.value = this._oldRT.texture;
 
 		// comp
+		renderer.toneMapping = NoToneMapping;
+		renderer.toneMappingNode = null;
 		renderer.setRenderTarget( this._compRT );
 		quadMeshComp.render( renderer );
 
@@ -72,9 +84,9 @@ class AfterImageNode extends TempNode {
 		this._oldRT = this._compRT;
 		this._compRT = temp;
 
-		// set size before swapping fails
-		this.setSize( map.image.width, map.image.height );
 
+		renderer.toneMapping = currentToneMapping;
+		renderer.toneMappingNode = currentToneMappingNode;
 		renderer.setRenderTarget( currentRenderTarget );
 		textureNode.value = currentTexture;
 

+ 1 - 1
examples/jsm/nodes/functions/ToonLightingModel.js

@@ -10,7 +10,7 @@ const getGradientIrradiance = tslFn( ( { normal, lightDirection, builder } ) =>
 
 	// dotNL will be from -1.0 to 1.0
 	const dotNL = normal.dot( lightDirection );
-	const coord = vec2( dotNL.mul( 0.5 ).add(  0.5 ), 0.0 );
+	const coord = vec2( dotNL.mul( 0.5 ).add( 0.5 ), 0.0 );
 
 	if ( builder.material.gradientMap ) {
 

+ 1 - 1
examples/jsm/nodes/materials/Line2NodeMaterial.js

@@ -147,7 +147,7 @@ class Line2NodeMaterial extends NodeMaterial {
 
 				const worldPos = varyingProperty( 'vec4', 'worldPos' );
 
-				worldPos.assign( positionGeometry.y.lessThan( 0.5 ).cond( start, end) );
+				worldPos.assign( positionGeometry.y.lessThan( 0.5 ).cond( start, end ) );
 
 				// height offset
 				const hw = materialLineWidth.mul( 0.5 );

+ 1 - 1
examples/webgpu_compute_particles_snow.html

@@ -17,7 +17,7 @@
 					"three": "../build/three.module.js",
 					"three/addons/": "./jsm/",
 					"three/nodes": "./jsm/nodes/Nodes.js",
-					"stats-gl": "https://cdn.jsdelivr.net/npm/[email protected].6/dist/main.js"
+					"stats-gl": "https://cdn.jsdelivr.net/npm/[email protected].8/dist/main.js"
 				}
 			}
 		</script>