| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hi @Stefterv, how are you? |
Sorry, something went wrong.
|
I'm not 100% sure about the other implications here, but viewports are typically expressed in terms of physical pixels. We may want to change PGraphicsOpenGL.setViewport to account for pixelDensity instead of only when writing the resolution uniform buffer. It loos like the only other uniform that uses this is the viewport uniform itself. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Resolves #1063
Changes
correctly set the uniform resolution to reflect the changes in pixelDensity
Why?
when pixelDensity is set to 2 either implicitly (starting from Processing 4.4.3 version) ,or when called when creating a sketch
the physical resolution (width and height) is doubled, but that isn't reflected on the uniform resolution (the rendering resolution)
so for example in conway.glsl this piece of code vec2 position = ( gl_FragCoord.xy / resolution.xy ); results in inconsistent position (wrong scaling) because uniform resolution still uses the logical resolution specificed in size() function
Tests
i tested all shaders examples, and everything seems fine except for two examples
deform, mouseX and mouseY also isn't reflected the change of pixelDensity
a simple solution is to multiple mouseX and mouseY by pixelDensity to reflect the correct position
DemoProjection this one is missed up, but i think it's related to the code written in sketch not sure about that