Bug 1241 - Util's Texture.coords (image coordinates) not updated properly
Summary: Util's Texture.coords (image coordinates) not updated properly
Alias: None
Product: Jogl
Classification: JogAmp
Component: util (show other bugs)
Version: 2.3.2
Hardware: All all
: P2 major
Assignee: Sven Gothel
Depends on:
Reported: 2015-10-02 14:47 CEST by Sven Gothel
Modified: 2015-10-03 01:14 CEST (History)
2 users (show)

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2015-10-02 14:47:59 CEST
See Bug 1218 comment 10.

"The bug is on texture.getImageTexCoords(). It gives [h: 0.0 - 1.0, v: 0.0 - 1.0] also with GL_TEXTURE_RECTANGLE, for this the texture is not displayed correctly.
If you update tex coords by manually calling for example setMustFlipVertically() the returned coords are correct."

'Texture.updateTexCoords()' must be issued if the texture target is changed!

'Texture.setImageSize(final int width, final int height, final int target)'
argument 'target', i.e. texture target is ignored.

'Texture.updateImage(..)' also fails calling 'updateTexCoords()'
on changes texture target.
Comment 1 Sven Gothel 2015-10-03 01:14:55 CEST
commit 670df25aae92079945a83401db9722d543730193
Adding 'imageTarget', i.e. GL target for this texture or 
its sub-components if cubemap.

The imageTarget preserves the used 2D image type
for the 2D Texture coordinates.
Note: 'Texture.updateImage(final GL gl, final TextureData data, final int targetOverride)'
This method needs an overhaul targeted for 2.4.0,
especially the semantics of argument 'targetOverride' 
which currently is quite ambiguous (implementation).

Further this method ignores the current setting of texture target
and w/ 'targetOverride' its implementation seems quite adventurous. 
See Bug 1241