Skip to content

Commit 7555435

Browse files
fix(Lensflare): implement framebuffer texture for GPU storage (#397)
1 parent e925563 commit 7555435

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/objects/Lensflare.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import {
22
AdditiveBlending,
33
Box2,
44
BufferGeometry,
5-
ClampToEdgeWrapping,
65
Color,
7-
DataTexture,
6+
Texture,
7+
NearestFilter,
88
InterleavedBuffer,
99
InterleavedBufferAttribute,
1010
Mesh,
1111
MeshBasicMaterial,
12-
NearestFilter,
13-
RGBAFormat,
1412
RawShaderMaterial,
1513
Vector2,
1614
Vector3,
@@ -34,17 +32,19 @@ const Lensflare = /* @__PURE__ */ (() => {
3432
const positionView = new Vector3()
3533

3634
// textures
37-
const tempMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat)
38-
tempMap.minFilter = NearestFilter
35+
const tempMap = new Texture({ width: 16, height: 16 })
36+
tempMap.isFramebufferTexture = true
3937
tempMap.magFilter = NearestFilter
40-
tempMap.wrapS = ClampToEdgeWrapping
41-
tempMap.wrapT = ClampToEdgeWrapping
38+
tempMap.minFilter = NearestFilter
39+
tempMap.generateMipmaps = false
40+
tempMap.needsUpdate = true
4241

43-
const occlusionMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat)
44-
occlusionMap.minFilter = NearestFilter
42+
const occlusionMap = new Texture({ width: 16, height: 16 })
43+
occlusionMap.isFramebufferTexture = true
4544
occlusionMap.magFilter = NearestFilter
46-
occlusionMap.wrapS = ClampToEdgeWrapping
47-
occlusionMap.wrapT = ClampToEdgeWrapping
45+
occlusionMap.minFilter = NearestFilter
46+
occlusionMap.generateMipmaps = false
47+
occlusionMap.needsUpdate = true
4848

4949
// material
5050

0 commit comments

Comments
 (0)