Skip to content

Conversation

@slimbuck
Copy link
Member

@slimbuck slimbuck commented Oct 8, 2025

Followup to #8030.

Description

Instead of using expensive exp call per pixel when rendering gaussians, generate an exp table and sample that instead. Also fold in the normalization factor.

@slimbuck slimbuck requested review from a team and Copilot October 8, 2025 14:21
@slimbuck slimbuck self-assigned this Oct 8, 2025
@slimbuck slimbuck added bug Something isn't working area: graphics Graphics related issue labels Oct 8, 2025
@slimbuck slimbuck changed the title Use exp table for gs exp Use exp table rendering gs Oct 8, 2025
@slimbuck slimbuck changed the title Use exp table rendering gs Use exp table for gs Oct 8, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes Gaussian splat rendering performance by replacing expensive per-pixel exponential function calls with a precomputed lookup table. The optimization precomputes the exponential values and normalization factors into a texture that can be sampled efficiently during rendering.

  • Replaces costly exp(-A * 4.0) computations with texture lookups in both GLSL and WGSL shader fragments
  • Creates a precomputed exponential lookup table texture with normalization factors baked in
  • Integrates the lookup table into the renderer's uniform system for automatic binding

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/scene/shader-lib/wgsl/chunks/gsplat/frag/gsplat.js Replaces exponential calculation with texture sampling using expTable
src/scene/shader-lib/glsl/chunks/gsplat/frag/gsplat.js Replaces exponential calculation with texture sampling using expTable
src/scene/renderer/renderer.js Adds exponential lookup table creation and management infrastructure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@slimbuck slimbuck merged commit f604dcc into playcanvas:main Oct 8, 2025
6 of 7 checks passed
@slimbuck slimbuck deleted the gs-update branch October 8, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Graphics related issue bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants