-
-
Notifications
You must be signed in to change notification settings - Fork 70
loadImage(...) and createGraphics(..., P2D) have different y-coordinates #1134
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
Comments
Hi @clankill3r and tanks for reporting this! I haven't had time to investigate closely, but I wonder if it could be related to this issue (#891) about the y axis. We made a fix for it in 4.4.2 which had to be reverted in 4.4.4 as it caused some unexpected side effects. Is it possible you started work on your library using 4.4.2 or 4.4.3 and only recently updated to 4.4.4? |
Hi @SableRaf I checked out #891, thanks for pointing that out. It's seems to be not related. Right now (speculation: )I think that on the GPU the pixels are in reverse order but that it doesn't matter much (it actually does), because the vertexCoords are reversed in y axis as well countering the first error. (With DEFAULT I mean the not P2D, I don't think this is strictly JAVA2D so I just call it DEFAULT). Some findings so far, PApplet.arrayCopy(in.texcoords, 2 * i0,
polyTexCoords, 2 * firstPolyVertex, 2 * nvert); I checked the result against P2D and DEFAULT and they are similar. My next step will be to invest Also I think I might now a way to work around this bug, but it would still be nice to fix it for the cleanness of P5. |
Ok, I give up. It's such a intense layercake that I decided to go with this: static public void render(..., boolean flip_y_because_of_processing_issue_1134) { |
There is one more thing I would like to point out in case it helps someone. When using |
Uh oh!
There was an error while loading. Please reload this page.
Most appropriate sub-area of Processing 4?
OpenGL
Processing version
4.4.4
Operating system
MacOSX
Steps to reproduce this
Additional context
I'm working on a keystone library that is using a shader.
Because a image has different coordinates then a graphics created with P2D I need to know what the user is giving.
Not only that, it complicates the shader math way more then I would like.
To give an example:
The difference between those is P2D and default renderer (both in a sketch that is P2D).
Notice that the text is correct in both cases!!!
This does not just apply for PGraphics, using loadImage is different as well (cause also baked by a
BufferedImage
).Having a mix of both of them really complicate things.
Complaining is easy however. I will dig into seeing if I can find a solution.
Would you like to work on the issue?
Trying...
The text was updated successfully, but these errors were encountered: