Skip to content

fix(Lensflare): implement framebuffer texture for GPU storage #397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/objects/Lensflare.js
Original file line number Diff line number Diff line change
@@ -2,15 +2,13 @@ import {
AdditiveBlending,
Box2,
BufferGeometry,
ClampToEdgeWrapping,
Color,
DataTexture,
Texture,
NearestFilter,
InterleavedBuffer,
InterleavedBufferAttribute,
Mesh,
MeshBasicMaterial,
NearestFilter,
RGBAFormat,
RawShaderMaterial,
Vector2,
Vector3,
@@ -34,17 +32,19 @@ const Lensflare = /* @__PURE__ */ (() => {
const positionView = new Vector3()

// textures
const tempMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat)
tempMap.minFilter = NearestFilter
const tempMap = new Texture({ width: 16, height: 16 })
tempMap.isFramebufferTexture = true
tempMap.magFilter = NearestFilter
tempMap.wrapS = ClampToEdgeWrapping
tempMap.wrapT = ClampToEdgeWrapping
tempMap.minFilter = NearestFilter
tempMap.generateMipmaps = false
tempMap.needsUpdate = true

const occlusionMap = new DataTexture(new Uint8Array(16 * 16 * 3), 16, 16, RGBAFormat)
occlusionMap.minFilter = NearestFilter
const occlusionMap = new Texture({ width: 16, height: 16 })
occlusionMap.isFramebufferTexture = true
occlusionMap.magFilter = NearestFilter
occlusionMap.wrapS = ClampToEdgeWrapping
occlusionMap.wrapT = ClampToEdgeWrapping
occlusionMap.minFilter = NearestFilter
occlusionMap.generateMipmaps = false
occlusionMap.needsUpdate = true

// material