Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - MrM

Pages: 1 2 [3]
31
Support / Re: Texture repeat
« on: September 11, 2011, 08:00:11 pm »
I can see what you mean. Maybe it's just how things work in android.graphics.Shader.

I think I'd rather create a bigger texture which would be tiled (512 or 1024) in Photoshop or whatever,  then in a 3d program make the water plane (not the Airplane, but the sea) just one object (eg.: one plane), flatten it's UV's and make sure they're the shape of the sea plane (again, not the Airplane), align them with the texture, and export it all as OBJ (It's my favorite format).  Then load it in JPCT-ae, and assign the texture which was created before, the tiled one. I would also use MemoryHelper.compact() because:
Quote
This can be used to trigger some gc work that might otherwise interrupt the application causing an animation to stutter or similar. However, this method can't avoid that...it just increases the chance that won't happen or at least not that often.

and probably clear the loader cache with Loader.clearCache();...

I think if you use one single bitmap which you would manually tile in an image editor, and slap it on just one flat UVed object, it would look nicer, and improve the fps...

32
Support / Re: Texture repeat
« on: September 11, 2011, 07:04:25 pm »
Hmmm... This could be a problem.

Where are you loading the resources? onSurfaceChanged or onSurfaceCreated?
I think it could be happening if the image was loaded separately for each tile.
How big is your image? Try compressing it if it's too big...

And if you're loading your stuff in onSurfaceChanged try doing it in onSurfaceCreated.

Quote
public abstract void onSurfaceCreated (GL10 gl, EGLConfig config)
Since: API Level 3

Called when the surface is created or recreated.

Called when the rendering thread starts and whenever the EGL context is lost. The EGL context will typically be lost when the Android device awakes after going to sleep.

Since this method is called at the beginning of rendering, as well as every time the EGL context is lost, this method is a convenient place to put code to create resources that need to be created when the rendering starts, and that need to be recreated when the EGL context is lost. Textures are an example of a resource that you might want to create here.

Note that when the EGL context is lost, all OpenGL resources associated with that context will be automatically deleted. You do not need to call the corresponding "glDelete" methods such as glDeleteTextures to manually delete these lost resources.

Please provide feedback if possible, or if there are any improvements.

33
Support / Re: Texture repeat
« on: September 11, 2011, 06:13:50 pm »
No problem, I could try and make your texture image seamless if you want (if it's not seamless already), but as you use multiple planes, I doubt that will help you.
Cheers, and good luck  ;D

34
Support / Re: LiveWallpaper Shader Problem
« on: September 11, 2011, 05:45:43 pm »
These are shots from the device:

This is how the application looks like:


And this is how the LiveWallpaper looks like:


As you can see, the LiveWallpaper is flat, and it's more on the purple side, because of the normal map being blended. The texture settings are the same for both the application and the Live Wallpaper.

Would anybody take a look at the project? I'm at wits end :)

35
Support / Re: Texture repeat
« on: September 11, 2011, 04:56:43 pm »
Try this:
Put your texture in drawable, just for siplicity's sake.

Code: [Select]

import android.graphics.drawable.BitmapDrawable;
import android.graphics.BitmapFactory;
import android.graphics.Shader;

BitmapDrawable tile = new BitmapDrawable(BitmapFactory.decodeResource(Flight.getResources(), R.drawable.seaday));
tile.setTileModeXY(Shader.TileMode.REPEAT, Shader.TileMode.REPEAT);

Texture sea = new Texture(tile);

TextureManager.getInstance().addTexture("seaday.jpg", sea);


Then, take whatever your Object3D is called, for example plane:
Code: [Select]
plane.setTexture("seaday.jpg")

Tell me if ti works out for you. You might need to change the image size, or fiddle with the Shader tiling.

36
Support / LiveWallpaper Shader Problem
« on: September 11, 2011, 01:06:33 am »
I've got JPCT-ae working with markguerra's LiveWallpaperService, and the only problem's I've had so far was the Texture inpus, since texturemanager is a singleton but that's bypassed with a few ifs.

My problem are the shaders, I can't get them working at all, it's as if they're not used, while logcat says they're loaded, and debugging shows no problems. If I blend them, the normal map is dominant, and it's like IT IS the face map. I'd appreciate it if somebody could take a look at what I'm doing wrong, I'm guessing it's where I instance the renderer or probably at the Engine. The complete Eclipse project, along with jpct and the wallpaperservice libraries are at this link:
http://www.mediafire.com/?yyfchd20h71jotj

Pages: 1 2 [3]