Hi,
I'm realising that pix_crop x/y coordinates work as follows:
- x grows from left to right - y grows from bottom to top
Isn't it a bit weird (the y part)? I know coordinate systems are always arbitrary but, aren't digital images rows almost universally counted from top to bottom? Isn't that even how they are stored in image files and memory?
You may argue that this is for uniformity with Gem's coordinate system that has the Y axis pointing upward, but then pixels are not gem units....
Is there a clear advantage in using this convention against the almost universal one? Or am I plain wrong about the latter being an almost universal convention?
thanks m.
On 2010-03-17 22:22, Matteo Sisti Sette wrote:
Hi,
I'm realising that pix_crop x/y coordinates work as follows:
- x grows from left to right
- y grows from bottom to top
Isn't it a bit weird (the y part)? I know coordinate systems are always arbitrary but, aren't digital images rows almost universally counted from top to bottom? Isn't that even how they are stored in image files and memory?
no. in openGL pixes are bottom up.
fmgasdr IOhannes
IOhannes m zmoelnig escribió:
On 2010-03-17 22:22, Matteo Sisti Sette wrote:
Hi,
I'm realising that pix_crop x/y coordinates work as follows:
- x grows from left to right
- y grows from bottom to top
Isn't it a bit weird (the y part)? I know coordinate systems are always arbitrary but, aren't digital images rows almost universally counted from top to bottom? Isn't that even how they are stored in image files and memory?
no. in openGL pixes are bottom up.
Oh, I see. Thank you
By the way (and somewhat unrelated), I have to do some serious test as soon as I have the occasion to use a Mac, but I have noticed inconsistencies in the ways things work between PC and Mac when using shaders.
That is, using the same patch with the same shaders (and both with rectanguar texture mode explicitly set, or explicitly turned off), I get an image or video correctly displayed on PC and upside-down in Mac (or, obviously, viceversa).
Does the OpenGL standard allow for some differencies between implementations in the way texture coordinates are treated, or is it safe to state that if the same patch with the same shaders gives different results (such as an image upside-down in either but not both) something is wrong in Gem?
thanks m.
On 2010-03-18 16:23, Matteo Sisti Sette wrote:
Does the OpenGL standard allow for some differencies between implementations in the way texture coordinates are treated, or is it safe to state that if the same patch with the same shaders gives different results (such as an image upside-down in either but not both) something is wrong in Gem?
it's a known issue. until this is fixed (i almost got it there, remember the thread on having to premultiply texture transformation matrices in shaders?), i suggest to use [pix_flip] right after your image source.
fgmasdr IOhannes
IOhannes m zmoelnig escribió:
it's a known issue. until this is fixed (i almost got it there, remember the thread on having to premultiply texture transformation matrices in shaders?),
Oh, I'll look for that thread and have a look.
thanks m.
By the way, it is not in the bug tracker, is it?
Something related is mentioned in bug 2844089 but that is specific to [model] and the bug itself doesn't seem to be the consequence of the issue we're talking about here.......
IOhannes m zmoelnig escribió:
On 2010-03-18 16:23, Matteo Sisti Sette wrote:
Does the OpenGL standard allow for some differencies between implementations in the way texture coordinates are treated, or is it safe to state that if the same patch with the same shaders gives different results (such as an image upside-down in either but not both) something is wrong in Gem?
it's a known issue. until this is fixed (i almost got it there, remember the thread on having to premultiply texture transformation matrices in shaders?), i suggest to use [pix_flip] right after your image source.
fgmasdr IOhannes
On 2010-03-18 16:55, Matteo Sisti Sette wrote:
By the way, it is not in the bug tracker, is it?
Something related is mentioned in bug 2844089 but that is specific to [model] and the bug itself doesn't seem to be the consequence of the issue we're talking about here.......
it is (unless i am mistaken)
fgmasdr IOhannes
IOhannes m zmoelnig escribió:
On 2010-03-18 16:55, Matteo Sisti Sette wrote:
By the way, it is not in the bug tracker, is it?
Something related is mentioned in bug 2844089 but that is specific to [model] and the bug itself doesn't seem to be the consequence of the issue we're talking about here.......
it is (unless i am mistaken)
It mentions one missing dimension: I didn't understand that very well but thought there was something more (specific to [model]) on top of this issue.
If it is just this issue, maybe the title should be changed? Maybe that's not so important if somebody (namely you iiuc?) is already working on it :)
On Thu, Mar 18, 2010 at 11:23 AM, Matteo Sisti Sette < matteosistisette@gmail.com> wrote:
Does the OpenGL standard allow for some differencies between implementations in the way texture coordinates are treated, or is it safe to state that if the same patch with the same shaders gives different results (such as an image upside-down in either but not both) something is wrong in Gem?
OpenGL absolutely allows for platform specific behavior, and programmers have to account for those. This includes writing different shaders for different platforms!
chris clepper escribió:
OpenGL absolutely allows for platform specific behavior,
Wow, really sad
On 2010-03-18 17:35, Matteo Sisti Sette wrote:
chris clepper escribió:
OpenGL absolutely allows for platform specific behavior,
Wow, really sad
but it doesn't mean that one has to make an application behave differently on different plaforms.
sometimes there are reasons: e.g. performance (that's the reason why it is like it is)
on OSX we have upside-down textures by default for performance reasons; we also use rectangle textures for performance reasons (and because they are guaranteed to work on osx); on other platforms (w32, linux) rectangle textures might be not faster than normalized texs (or even slower) AND depending on the hardware or drivers installed, rectangle textures might not even be supported at all.
there are some good news, however: - in future releases all pixes will have top-down orientation (because there are virtually no codecs that provide bottom-up video material, and for images the performance penalty is not so big (and is blananced by the performance gain for videos) - the user will be able to set the default texture type on their systems in a central place (so they can guarantee themselves that they always have rectangle textures (if supported, that is) - eventually we will find a way to use texture matrices to unify texcoords for shaders and complex geometries (therefore: always premultiply your texcoords with the current texture matrix in your shader - even if it doesn't do anything right now)
fgmasdr IOhannes
OpenGL is a consortium of manufacturers who have their own agendas and goals. The things they agree on make it into the main spec (or ARB), but they are free to add their own extensions.
If you want the dictatorial model try Microsoft's DX 3D.
On Thu, Mar 18, 2010 at 12:35 PM, Matteo Sisti Sette < matteosistisette@gmail.com> wrote:
chris clepper escribió:
OpenGL absolutely allows for platform specific behavior,
Wow, really sad
-- Matteo Sisti Sette matteosistisette@gmail.com http://www.matteosistisette.com