Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8091940

Add V-up texture coordinates support



    • Enhancement
    • Resolution: Unresolved
    • P4
    • tbd
    • 8
    • javafx


      Most 3D data formats/files use right handed, and V-up textures convention. However JavaFX uses a Y-down 3D coordinate system with a V-down texture.

      It would be nice to have a way handle the V flip either in the shader and flipping the image. Here is the suggestion written by Remi:

      The rendering engine take care of this. In all modern graphics API it is very simple to add (1-v) math to the vertex shader for instance.
      Without direct access to the shader, I would think a flag to set the V-up or V-down for a model would be a simple addition to the API.
      It is not hard to calculate new UV coordinates at load time, but it is prone to errors in case some other calculations depend on the UV coordinate system. Makes the code non portable.

      Alternatively, you may want to adopt the same help method used by WebGL (OpenGL convention) that has to live in a web browser, where Canvas 2D images are the other direction by default.
      In this case, the shader is not changed, but the image loader is loading the image upside down, keep 2 copies of the image in memory…

      see: gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);




            Unassigned Unassigned
            ckyang Chien Yang (Inactive)
            0 Vote for this issue
            4 Start watching this issue