Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Is texture compression supported in jogl?
If yes, which kind of compression? Is there any example out there? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Hi
Yes it's supported, look at how it is used in the JOGL renderers, for example in JMonkeyEngine 3 and Ardor3d.
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Where, here? http://code.google.com/p/jmonkeyengine/source/browse/#svn%2Ftrunk%2Fengine%2Fsrc%2Fjogl%2Fcom%2Fjme3%2Frenderer%2Fjogl |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
jMonekyEngine recently moved to GitHub so for the latest source look here: https://github.com/jMonkeyEngine/jmonkeyengine/tree/master/jme3-jogl/src/main/java/com/jme3/renderer/jogl |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Yes jmaasing is right. Look at the class TextureUtil. I fixed a bug in this class in August 2013.
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by elect
How can I convert an image to dds format? is there any utility in jogl?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Look at com.jogamp.opengl.util.texture.spi.DDSImage.
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks, you meant this one createFromData public static DDSImage createFromData(int d3dFormat, int width, int height, ByteBuffer[] mipmapData) throws IllegalArgumentException Creates a new DDSImage from data supplied by the user. The resulting DDSImage can be written to disk using the write() method. Parameters: d3dFormat - the D3DFMT_ constant describing the data; it is assumed that it is packed tightly width - the width in pixels of the topmost mipmap image height - the height in pixels of the topmost mipmap image mipmapData - the data for each mipmap level of the resulting DDSImage; either only one mipmap level should be specified, or they all must be Returns: DDS image object Throws: IllegalArgumentException - if the data does not match the specified arguments Ps: how can I do if I only have an image? Because with that method I also have to submit the mimaps, which I don't have.. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Then you have only 1 level of mipmap. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I see jogl has only
GL_COMPRESSED_RGB_S3TC_DXT1 GL_COMPRESSED_RGBA_S3TC_DXT1 GL_COMPRESSED_RGB_S3TC_DXT3 GL_COMPRESSED_RGB_S3TC_DXT5 but it misses the counterparts for the sRGB space: GL_COMPRESSED_SRGB_S3TC_DXT1 GL_COMPRESSED_SRGBA_S3TC_DXT1 GL_COMPRESSED_SRGB_S3TC_DXT3 GL_COMPRESSED_SRGB_S3TC_DXT5 Why? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
GL_COMPRESSED_SRGB_S3TC_DXT1 _EXT was in JOGL 1 but I don't know why it isn't in JOGL 2.
Sven, do you know why??
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Digging the web, I didnt find anything clear, but some hints
https://www.opengl.org/wiki/Image_Format http://stackoverflow.com/questions/12358863/opengl-compressed-textures-and-extensions seem to point out the sRGB versions are somehow connected/implicit with the EXT_texture_sRGB extension But I still need to figure it out how |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Found!
public static final int GL_COMPRESSED_SRGB_S3TC_DXT1_NV = 0x8C4C; /** Part of <code>GL_NV_sRGB_formats</code> */ public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_NV = 0x8C4D; /** Part of <code>GL_NV_sRGB_formats</code> */ public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_NV = 0x8C4E; /** Part of <code>GL_NV_sRGB_formats</code> */ public static final int GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_NV = 0x8C4F; in GLES2 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Is it possible to create a compressed texture with mipmaps using the jogl classes starting from a single image?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
The problem is, to create a DDSImage a need the byteBuffer[] array containing the mipmaps
I can get that from the textureData, but textureData *dont* really create the mipmaps textureData = TextureIO.newTextureData(gl3.getGLProfile(), file, true, TextureIO.PNG); System.out.println("textureData.getMipmap() "+textureData.getMipmap()); System.out.println("textureData.getMipmapData().length "+textureData.getMipmapData().length); This prints true and then crashes because textureData.getMipmapData().length is null and if I look in the code, I reach the public TextureData newTextureData(GLProfile glp, File file, int internalFormat, int pixelFormat, boolean mipmap, String fileSuffix) throws IOException; in the TextureProvider, but it has only methods in DDS/IIO/StreamBased TextureProvider, no PNG |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
How can I get internalFormat, format and type from a DDS?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I tried both with TextureIO and AWTextureIO
TextureIO.newTextureData(gl3.getGLProfile(), conn.getURL(), ddsImage.getNumMipMaps() > 1, TextureIO.DDS); but I keep getting Unsupported DDS compression format "DX10" |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I read in the DDSImage.java:
"/** Simple class describing images and data; does not encapsulate image format information. User is responsible for transmitting that information in another way. */" I wish the dds loader encapsulates the format as well.. which is the reason why it has not be included? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I'm also thinking about including support for ktx textures, is someone interested?
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Free forum by Nabble | Edit this page |