Fix front camera rotation mirroring in shader
Add uIsFrontCamera uniform to shader and adjust coordinate transformations for front camera's mirrored texture coordinates: - Position transform: (1-posY, 1-posX) instead of (posY, 1-posX) - Angle transform: -angle - 90° instead of +angle + 90° Applied to linearFocusDistance, radialFocusDistance, and blur direction calculations in sampleBlurred. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b16dd971f2
commit
0cd41e9814
3 changed files with 51 additions and 17 deletions
|
|
@ -126,7 +126,7 @@ class TiltShiftRenderer(
|
|||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
|
||||
|
||||
// Use shader and set parameters
|
||||
shader.use(cameraTextureId, blurParameters, surfaceWidth, surfaceHeight)
|
||||
shader.use(cameraTextureId, blurParameters, surfaceWidth, surfaceHeight, isFrontCamera)
|
||||
|
||||
// Set vertex positions
|
||||
GLES20.glEnableVertexAttribArray(shader.aPositionLocation)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue