UNPKG

playcanvas

Version:

Open-source WebGL/WebGPU 3D engine for the web

26 lines (23 loc) 778 B
import { FramePass } from '../../platform/graphics/frame-pass.js'; class FramePassGSplatComputeLocal extends FramePass { frameUpdate() { const renderer = this.renderer; const camera = renderer.cameraNode.camera; const rt = camera.renderTarget; const rtWidth = rt ? rt.width : this.device.width; const rtHeight = rt ? rt.height : this.device.height; const rect = camera.rect; const width = Math.floor(rtWidth * rect.z); const height = Math.floor(rtHeight * rect.w); renderer.resizeOutputTexture(width, height); } execute() { this.renderer.dispatch(); } constructor(renderer){ super(renderer.device); this.renderer = renderer; this.name = 'FramePassGSplatComputeLocal'; } } export { FramePassGSplatComputeLocal };