Skip to content

test: add regression tests for custom shader with framebuffer depth texture#8948

Open
vamshi567bh wants to merge 2 commits into
processing:mainfrom
vamshi567bh:fix/framebuffer-blur-regression-tests
Open

test: add regression tests for custom shader with framebuffer depth texture#8948
vamshi567bh wants to merge 2 commits into
processing:mainfrom
vamshi567bh:fix/framebuffer-blur-regression-tests

Conversation

@vamshi567bh

@vamshi567bh vamshi567bh commented Jun 21, 2026

Copy link
Copy Markdown

Closes #8947.

changes

Adds two regression tests covering the custom shader + framebuffer depth texture pattern used by the Framebuffer Blur example (see #8940). No library code changes are needed — the library already handles this correctly

  1. custom shader sampling only color texture — verifies a custom vertex+fragment shader with uModelViewMatrix / uProjectionMatrix can sample fbo.color via setUniform and produce correct output
  2. custom shader sampling both color and depth textures — verifies a custom shader can sample fbo.color and fbo.depth simultaneously, using depth values to modulate the output color

The proposed matrix swap in PR #8947 was incorrect. All three multiply methods (#mult4x4, #multNxN, #mult3x3) consistently perform right-multiplication. The uModelViewMatrix is correctly computed as model × view at p5.Renderer3D.js:1437. The Framebuffer Blur example vertex shader (uProjectionMatrix * uModelViewMatrix * position) is mathematically equivalent to uProjectionMatrix * uViewMatrix * uModelMatrix * position.

The uSampler override bug that could affect custom shaders was already fixed by commits f75f227 and 355a04b (Jun 2-3, 2026).

PR Checklist

  • npm run lint passes
  • [Inline reference] is included / updated
  • [Unit tests] are included / updated

…exture

Adds two tests verifying that custom shaders can correctly sample
both color and depth framebuffer textures via setUniform(), which
is the pattern used by the Framebuffer Blur example.

- custom shader sampling only color texture
- custom shader sampling both color and depth textures

Both tests confirm the library sets uModelViewMatrix = model x view
correctly and that depth textures are readable via uniform sampler2D.

Refs: processing#8940
@vamshi567bh vamshi567bh force-pushed the fix/framebuffer-blur-regression-tests branch from a1277c0 to c353761 Compare June 21, 2026 08:39
@vamshi567bh

Copy link
Copy Markdown
Author

@davepagurek please review thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant