Open
Description
Most appropriate sub-area of p5.js?
- AccessibilityColorCore/Environment/RenderingDataDOMEventsImageIOMathTypographyUtilitiesWebGLBuild processUnit testingInternationalizationFriendly errorsOther (specify if possible)
p5.js version
1.11.1
Web browser and version
Arc 130.0.6723.117
Operating system
macOS 13.2.1
Steps to reproduce this
Steps:
- Here is an example: https://editor.p5js.org/a25811342/sketches/ctcrkd_71
gif.getCurrentFrame()
shows that it does apply assigned frame to the object.- However, when using
image()
to render the image, the one inWEBGL
environment is still, but the other one works fine with default renderer. (object be placed in another layer withoutWEBGL
usingcreateGraphics()
)
Snippet:
let gif;
let layer2d;
function preload() {
gif = loadImage('Rotating_earth_(large).gif');
}
function setup() {
createCanvas(400, 400, WEBGL);
layer2d = createGraphics(width, height);
}
function draw() {
background(220);
let gifFrame = frameCount % (gif.numFrames());
gif.setFrame(gifFrame);
print(gif.getCurrentFrame());
// setFrame() cannot apply to WEBGL environment.
image(gif, -200, -200, 200, 200);
// but work fine with default renderer.
layer2d.image(gif, 0, 0, 200, 200);
image(layer2d, 0, 0);
}
Activity
welcome commentedon Nov 9, 2024
Welcome! 👋 Thanks for opening your first issue here! And to ensure the community is able to respond to your issue, please make sure to fill out the inputs in the issue forms. Thank you!
rishabhs-rizz commentedon Nov 26, 2024
good issue, could you please assign this issue to me
davepagurek commentedon Dec 20, 2024
Hey @rishabhs-rizz, sorry I missed this, I'll assign it to you!
swastikCommits commentedon Mar 2, 2025
I m willing to work in this, since there has been inactivity.
davepagurek commentedon Mar 2, 2025
I'll assign it to you @swastikCommits, @rishabhs-rizz if you're still interested in working on this maybe you two can collaborate and help review code?
Another note: We are close to releasing p5 2.0. Its development is taking place on the
dev-2.0
branch. In addition to fixing this onmain
, it would also be beneficial to check if this problem exists in 2.0 (there's a CDN link for a beta build here: https://github.com/processing/p5.js/releases/tag/v2.0.0-beta.3) and making an additional PR intodev-2.0
if so.