-- | Coordinates transformation from viewport system to specified local. This function maps points in particular
-- region into texture coordinates.
remapCoords :: Vec2 Float -> Vec2 Float -> Vec2 (Shader t Float) -> Vec2 (Shader t Float)
remapCoords (ox:.oy:.()) (sx:.sy:.()) (ux:.uy:.()) = ux':.uy':.()
  where
    ux' = (ux - toGPU ox) / toGPU sx
    uy' = (uy - toGPU oy) / toGPU sy

-- | Some trivial transformations for viewport quad.      
remapCoords :: Vec2 Float -> Vec2 Float -> Vec2 (Shader t Float) -> Vec2 (Shader t Float)
remapCoords (ox:.oy:.()) (sx:.sy:.()) (ux:.uy:.()) = ux':.uy':.()
  where
    ux' = (ux - toGPU ox) / toGPU sx
    uy' = (uy - toGPU oy) / toGPU sy

-- | Some trivial transformations for viewport quad.      
remapCoords (ox:.oy:.()) (sx:.sy:.()) (ux:.uy:.()) = ux':.uy':.()
  where
    ux' = (ux - toGPU ox) / toGPU sx
    uy' = (uy - toGPU oy) / toGPU sy

-- | Some trivial transformations for viewport quad.      