DTX1 vs. ETC1

So I know water on the android is basically uncharted and an unsupported feature on Android, but I’m using the SimpleWaterProcessor class to implement water and a model of a cruise ship on a Samsung Charge… And here’s my question:

It keeps giving me the error “DXT1 is not supported by video hardware”… I assume this is because it is compressing .dds files included in the simpleWaterProcessor class to DXT1 (also known as S3TC). I did some research to find that ETC1 is supported by most Android phones, and DXT1 (S3TC) is supported only by certain phones (including Motorolla).

I’m wondering if there’s a way to download a plugin for this, or change the “Image.java” file (provided by the Android plugin for JME3) to support ETC1 compression.

I found this link on StackOverflow for seemingly this very issue, but I’m not sure what to make of it…

http://developer.android.com/reference/android/opengl/ETC1Util.html

just use a PNG file, ETC1 compression is enabled by default in the engine. Though be aware that this compression can have very poor quality one gradients.

I have converted the .dds and .jpg files (1 of each) in SimpleWaterProcessor.java to png files and the DXT1 error is still showing.

I looked at the compression methods in Image.java (not sure the directory path of that file), and there only seems to be DXT1, DXT1, DXT5, etc. methods of compression. I’m curious as to how and where ETC1 compression is configured by default.

I only have one other object for display on the screen and that is a .j3o mesh that displays fine on the Android by itself.

There is also a .j3md file used in the SimpleWaterProcesser.java file used for setting a material… but I’m not sure this would compress to DXT1…

Update: realized the .j3md file is a material file… so scratch that last sentence on my previous post

@testandrill said: I have converted the .dds and .jpg files (1 of each) in SimpleWaterProcessor.java to png files and the DXT1 error is still showing.
You may have missed one. DXT1 compression is only used in DDS files.

ETC1 compression is used in the TextureUtil class of the android part of the engine, because that’s an android only feature.

I’m getting error “at com.jme3.renderer.android.TextureUtil.unsupportedFormat(TextureUtil.java:228)”.

I can’t even find this directory anywhere. Is it contained with the jME3-android.jar file? BTW, I only just now realized to add that jar file to my project library (didn’t seem to change anything).

In the jmonkeyplatform > jmonkeyplatform > libs > jMonkeyEngine3-source.zip file I have edited SimpleWaterProcessor.java by extracting the zip file, editing, and rezipping.

Edit: I found rederer.android.TextureUtil using the jMonkey file explorer and I do see the ETC1 reference. Still don’t know why I’m getting DXT1 errors, but thanks for your help. I will keep working on it.

@nehon

We have removed references to DDS file in SimpleWaterProcessor.java. We have our game compiling and running on our computer’s correctly.
Each time we run on the Android, we have the same DXT1Error.

We are not sure why we have this issue since we have removed the DDS file.

One solution would be to modify the renderer.Android.textureUtil to print out what “img” file is causing the format trouble. How do we modify the textureUtil? When we load TextureUtil in JME, it is all compiled code. What is this? On Google search, we find this more clean java code (http://code.google.com/p/jmonkeyengine/source/browse/trunk/engine/src/android/com/jme3/renderer/android/TextureUtil.java?r=9436)

What are the differences between these two files? Do we have the 2nd java file locally on our machines? How do we access it.

Thank you.

T&D

Hmmm… if you aren’t compiling JME yourself then how did you remove the reference from SimpleWaterProcessor.java in the first place?

so what would be a good approach if I run in this error, would it be possible to automatically convert all textures for a loaded model from DXT1 to ETC1 if running on Android?