Skip to content

Commit 8384278

Browse files
authored
Examples: webgpu_shadowmap_opacity update shadow opacity (#30984)
* update shadow opacity * Update webgpu_shadowmap_opacity.html * Update webgpu_shadowmap_opacity.jpg
1 parent 6e56458 commit 8384278

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Loading

examples/webgpu_shadowmap_opacity.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<script type="module">
2727

2828
import * as THREE from 'three';
29-
import { Fn, vec4 } from 'three/tsl';
29+
import { Fn, mix } from 'three/tsl';
3030

3131
import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
3232
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -100,9 +100,10 @@
100100

101101
// shadow node
102102

103-
const customShadow = Fn( ( [ color, opacity = .8 ] ) => {
103+
const customShadow = Fn( ( [ color, opacity = 1 ] ) => {
104104

105-
return vec4( color, opacity );
105+
//return vec4( color, opacity ); // opacity by blending
106+
return mix( 1, color, opacity ); // opacity by color
106107

107108
} );
108109

0 commit comments

Comments
 (0)