Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed no_tint issue while rendering #7695

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

NavyaNayer
Copy link

@NavyaNayer NavyaNayer commented Apr 2, 2025

Fix: Framebuffer Rendering Issue After noTint() Call

Resolves #7677

Summary of Changes

This PR fixes a bug where calling noTint() before rendering a framebuffer would cause an error and prevent correct rendering. The fix ensures that noTint() correctly updates shader uniforms without breaking the framebuffer rendering pipeline.

Key Fixes:

  • Fixed framebuffer rendering failure after noTint() by setting its default value to [255, 255, 255, 255] (white) instead of null.

Bug Description

When calling noTint() before rendering a framebuffer, the following error was thrown:
Uncaught TypeError: Cannot read properties of null (reading 'slice')

This happened due to how noTint() was modifying the tint uniform value, causing the shader pipeline to fail when rendering framebuffers.

Root Cause:

  1. noTint() was setting the tint value to null.
  2. The shader uniform system attempted to slice the null value, resulting in an error.
  3. This error prevented framebuffers from being rendered correctly.

Fix Implementation

The following changes were made to resolve the issue:

Updated noTint() Implementation

  • Instead of setting tint to null, it now defaults to [255, 255, 255, 255] (white).
  • This ensures valid uniform data is always provided to the shader.

Testing & Verification

Manual Testing

  • Verified that calling noTint() no longer causes framebuffer rendering to fail.
  • Confirmed that all tint-related operations function correctly.

Automated Testing

  • Updated unit tests to validate correct behavior when noTint() is applied before rendering framebuffers.

PR Checklist

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

Copy link

welcome bot commented Apr 2, 2025

🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. And be sure to add yourself to the list of contributors on the readme page!

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