Skip to content

Commit

Permalink
cleanup from mrdoob#26429
Browse files Browse the repository at this point in the history
  • Loading branch information
sunag committed Jul 14, 2023
1 parent 6863177 commit 63081f7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/webgpu_multiple_rendertargets.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
// import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

import { NodeMaterial, MeshBasicNodeMaterial, mix, modelNormalMatrix, normalGeometry, normalize, outputStruct, step, texture, uniform, uv, varying, vec2, vec4 } from 'three/nodes';
import { NodeMaterial, mix, modelNormalMatrix, normalGeometry, normalize, outputStruct, step, texture, uniform, uv, varying, vec2, vec4 } from 'three/nodes';
import WebGPU from 'three/addons/capabilities/WebGPU.js';
import WebGPURenderer from 'three/addons/renderers/webgpu/WebGPURenderer.js';

Expand All @@ -56,13 +56,14 @@
*/

class WriteGBufferMaterial extends MeshBasicNodeMaterial {
class WriteGBufferMaterial extends NodeMaterial {

constructor( diffuseTexture ) {

super();

this.lights = false;
this.unlit = true;

this.diffuseTexture = diffuseTexture;

const vUv = varying( uv() );
Expand All @@ -87,13 +88,14 @@

super();

this.unlit = true;

const vUv = varying( uv() );

const diffuse = texture( tDiffuse, vUv );
const normal = texture( tNormal, vUv );

this.colorNode = mix( diffuse, normal, step( 0.5, vUv.x ) );
this.lights = false;
this.outputNode = mix( diffuse, normal, step( 0.5, vUv.x ) );

}

Expand All @@ -114,7 +116,6 @@
renderer = new WebGPURenderer();
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.useLegacyLights = false;
document.body.appendChild( renderer.domElement );

renderer.outputColorSpace = THREE.LinearSRGBColorSpace;
Expand Down

0 comments on commit 63081f7

Please sign in to comment.