Handling Object Scaling in LCK Camera Rendering
Goal
You need to scale up the quality of an object ie: your player avatar’s, specifically for LCK camera rendering.Background
LCK cameras use command buffers for rendering, which execute asynchronously on the GPU. This means traditional pre/post render events won’t work reliably for immediate mesh modifications, as the GPU commands may execute at different times than your CPU-side scaling operations.Solutions
Recommended: Use Separate Render Layers
The simplest and most reliable approach is to create a duplicate object setup:- Create a second copy of your object with the scaled object
- Configure this copy to be visible only on a specific render layer
- Set your LCK cameras to render this layer
- Keep your original object on a different layer for normal gameplay
- No timing issues with GPU command buffers
- Clean separation between gameplay and capture rendering
- Works consistently across different rendering pipelines
Alternative: Command Buffers
If you need a more dynamic solution, you can use Command Buffers:Alternative: URP Render Features
If you’re using Unity’s Universal Render Pipeline (URP), consider implementing a custom Render Feature to handle the scaling at the rendering pipeline level.What Doesn’t Work
- Events before/after frame capture: These fire at the wrong time relative to GPU command buffer execution
- Direct pre/post render callbacks: LCK rendering happens asynchronously via command buffers
- Synchronous mesh modifications: GPU timing makes this unreliable