X Tutup
Skip to content

fix: WEBGL rendering and Light2d blendmode#1248

Merged
obiot merged 4 commits intomelonjs:masterfrom
Vareniel:melonEditorDev/WebGL-rendering-fix
Jul 1, 2025
Merged

fix: WEBGL rendering and Light2d blendmode#1248
obiot merged 4 commits intomelonjs:masterfrom
Vareniel:melonEditorDev/WebGL-rendering-fix

Conversation

@Vareniel
Copy link
Contributor

Description of change
  • Updated the way the Quad Compositor renders when updating textures repeatedly.
  • Fixed color blending issue in CanvasRenderer when using multiple Light2D objects at the same position. Previously, when multiple Light2D objects were placed at the same position using the CanvasRenderer, the colors didn't blend correctly. This issue has now been resolved, and Light2D objects properly blend colors in the CanvasRenderer. Explanation: In the CanvasRenderer context, the first Light2D object will set the blend mode to this.blendMode. However, subsequent Light2D objects do not reset the blend mode after calling ctx.save() and ctx.restore(). This was causing the incorrect color blending behavior. If ctx.save() and ctx.restore() were not used, the blend mode would only need to be set once, and the blending would work as expected.
Merge Checklist
  • [ x ] Build process passed (npm run build)
  • [ x ] Lint process passed (npm run lint)
  • [ x ] Tests passed (npm run test)

Vareniel added 4 commits June 27, 2025 17:04
- Updated how quad compositor render works when updating textures repeatedly
- Previously if using canvas renderer, when using multiple Light2D objects at the same position, the colors didn’t blend correctly. This issue is now fixed, and Light2D objects properly blend colors when using the canvas renderer.
@Noodles006

This comment was marked as spam.

@Vareniel Vareniel changed the title Melon editor dev/web gl rendering fix fix: WEBGL rendering and Light2d blendmode Jun 27, 2025
@obiot
Copy link
Member

obiot commented Jul 1, 2025

sweet !

@obiot obiot merged commit 77e9ddd into melonjs:master Jul 1, 2025
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.

3 participants

X Tutup