Skip to content

Commit 65c13da

Browse files
authored
TSL: hashBlur - added default uv (#29614)
* `hashBlur` - added default `uv` * improve light intensity
1 parent 06e4cf1 commit 65c13da

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

examples/jsm/tsl/display/hashBlur.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
1-
import { float, Fn, vec2, sin, rand, degrees, cos, Loop, vec4 } from 'three/tsl';
1+
import { float, Fn, vec2, uv, sin, rand, degrees, cos, Loop, vec4 } from 'three/tsl';
22

33
// https://www.shadertoy.com/view/4lXXWn
44

55
export const hashBlur = /*#__PURE__*/ Fn( ( [ textureNode, bluramount = float( 0.1 ), repeats = float( 45 ) ] ) => {
66

77
const draw = ( uv ) => textureNode.uv( uv );
88

9-
const targetUV = textureNode.uvNode;
9+
const targetUV = textureNode.uvNode || uv();
1010
const blurred_image = vec4( 0. ).toVar();
1111

12-
//const map = textureNode.value;
13-
1412
Loop( { start: 0., end: repeats, type: 'float' }, ( { i } ) => {
1513

1614
const q = vec2( vec2( cos( degrees( i.div( repeats ).mul( 360. ) ) ), sin( degrees( i.div( repeats ).mul( 360. ) ) ) ).mul( rand( vec2( i, targetUV.x.add( targetUV.y ) ) ).add( bluramount ) ) );
14 Bytes
Loading

examples/webgpu_backdrop_area.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
clock = new THREE.Clock();
5252

53-
const ambient = new THREE.AmbientLight( 0xffffff, 2 );
53+
const ambient = new THREE.AmbientLight( 0xffffff, 2.5 );
5454
scene.add( ambient );
5555

5656
// model

0 commit comments

Comments
 (0)