Skip to content

Commit

Permalink
Pixel size modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
cmhhelgeson committed Jul 4, 2024
1 parent 360f5d3 commit 6f87fc3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/webgpu_postprocessing_pixel.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
document.body.appendChild( renderer.domElement );

const effectController = {
pixelSize: uniform(14),
pixelSize: 14,
normalEdgeStrength: uniform(0.3),
depthEdgeStrength: uniform(0.4)
}

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (98% of all statements in
the enclosing function
have an explicit semicolon).
Expand All @@ -142,8 +142,8 @@
const scenePassColor = scenePass.getTextureNode();
const scenePassDepth = scenePass.getTextureDepthNode();
const scenePassNormal = scenePass.getTextureNormalNode();
composer.outputNode = scenePassColor.pixelation( scenePassDepth, scenePassNormal, 14, effectController.normalEdgeStrength, effectController.depthEdgeStrength);

const pixelationPass = scenePassColor.pixelation( scenePassDepth, scenePassNormal, 4, effectController.normalEdgeStrength, effectController.depthEdgeStrength);
composer.outputNode = pixelationPass;
window.addEventListener( 'resize', onWindowResize );

const controls = new OrbitControls( camera, renderer.domElement );
Expand All @@ -152,6 +152,7 @@
// gui

gui = new GUI();
gui.add( pixelationPass.pixelSizeNode, 'value', 0, 14, 1).name( 'Pixel Size' );
gui.add( effectController.normalEdgeStrength, 'value', 0, 2, 0.05 ).name( 'Normal Edge Strength' );
gui.add( effectController.depthEdgeStrength, 'value', 0, 1, 0.05 ).name( 'Depth Edge Strength' );

Expand Down

0 comments on commit 6f87fc3

Please sign in to comment.