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.

Topics - raft

Pages: 1 2 [3] 4 5 ... 8
Support / default object transparency
« on: January 11, 2011, 07:37:49 pm »
i set Config.glTransparencyMul to a low value (0.001) for finer control over transparency. but then some of my objects became invisible. seems as Loader.load3DS(InputStream, scale); sets transparency to 100 and in my case this makes my objects almost invisible.

it may make sense if Loader sets transparency to -1.

Support / Texture.keepPixelData(..) working correct?
« on: December 22, 2010, 06:00:43 pm »
even if i call Texture.keepPixelData(false), after a GL context loss, all textures are in place. how is this happening?

Support / texture recovery
« on: December 21, 2010, 03:20:37 pm »
after GL context is lost and recreated (for example after pressing home button and returning back to activity), textures are re-uploaded to gpu automatically when they are needed. this is great but has a side effect, we got a delay.

in my game, i use android widgets for in game gui (not for the overlays and in-game buttons but for paused menu etc). when user returns the activity, paused menu instantly appears (since it's android gui) with a black background, this lasts a few seconds (most textures are re-uploaded), then game is rendered in background, when user presses resume button, then another delay happens (this time overlay textures are re-uploaded, they werent rendered in paused state). not a nice experience for user. i'm not sure how to cope with this

* leave it as it's :)
* adding a method to TextureManager to manually force all textures re-upload may help.

Support / Comfig.isIndoor
« on: December 17, 2010, 06:26:52 pm »
my skybox is a 6 side cube so it's always guaranteed the whole scene is filled. although skybox and game is rendered in different worlds, i guess i can safely use Config.isIndoor = true in this case?

but there is no such setting in AE version, intentional?

Support / NPE, what is null here?
« on: December 17, 2010, 03:44:15 am »
this sometimes happes when i press home button. not sure what is null here?

Code: [Select]
  at com.threed.jpct.GLRenderer.blit(
  at com.threed.jpct.GLRenderer.execute(
  at com.threed.jpct.FrameBuffer.blit(

Support / camera rotation
« on: December 16, 2010, 08:31:06 pm »
i've faced some strange behaviour: i rotate a default camera around X axis once, then rotate around Y axis in each iteration. i expected camera direction's Y value remain same, but it doesn't ??? am i missing something?

a simple test case:
Code: [Select]
Camera camera = new Camera();


for (int i = 0; i < 100; i++) {

genarates this output:
Code: [Select]

Support / memory and gc
« on: December 13, 2010, 06:47:49 pm »
this is a bit annoying: according to my tests, the less objects you create, the less frequently dalvik garbage collects. but when it does, it collects many objects at once and hence the delay gets larger. kind of dilemma :-\ my gl thread's priority was 8, i left as default (5) but that didnt help.

anyway, inspecting memory allocations i've spot some methods. it may be worth improving them:
* Camera.lookAt creates a new Matrix all the time. instead using an instance field may help
* Camera.getPosition() is used frequently, so it may be worth adding a Camera.getPosition(SimpleVector) method

Feedback / malware ?
« on: November 07, 2010, 10:26:51 pm »
windows chrome just warned me about may contain malware content as it has a link to


Projects / Sky Maze 3D
« on: October 20, 2010, 03:16:56 am »
as in game graphics are almost complete, it's time to go public :D

this is a simple ball control game, purpose is to reach exit tile. controlled by touching screen and requires multi touch. seems as an N1 or higher device will be necessary. i've found no direct way of forcing this, so i assume forcing high resolution will practically result in such devices.

this game is a port (with minor modifications) of a flash game with author's permission.

here are some shots, all taken from stock N1 running Android 2.1.

simple start level. background image and possibly clock will change. the debug string w:5 means there are 5 objects in the world

another level with simple turns. by collecting diamonds extra points can be earned

a jump high level. this kind of levels are most fun IMHO

a big level and demonstration of breakable tiles.

my test level. red tiles are lava, the downward moving circles represent magnet tile is on, on upper right teleport tile is visible:

same test level with a different angle. lava particles can be seen. i've cut down the number of lava particles for performance

cheers ;D
r a f t

edit: corrected the title

Support / memory issues
« on: October 15, 2010, 02:52:55 pm »
as my game evolves, i begun to run into memory issues. game itself runs ok, fits the budget, but these things typically happens after pressing home and returning back. see the exception below.

i guess this happens when jPCT tries to restore textures after a GL surface lost. i dispose the FrameBuffer, null the reference and call MemoryHelper.compact() before creating a new one.

what else can i do?

Code: [Select]
E/dalvikvm-heap( 6803): 131072-byte external allocation too large for this process.
W/OSMemory( 6803): External allocation of 131072 bytes was rejected
W/dalvikvm( 6803): threadid=15: thread exiting with uncaught exception (group=0x4001b178)
E/AndroidRuntime( 6803): Uncaught handler: thread GLThread 8 exiting due to uncaught exception
E/AndroidRuntime( 6803): java.lang.OutOfMemoryError
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
E/AndroidRuntime( 6803): at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(
E/AndroidRuntime( 6803): at java.nio.DirectByteBuffer.<init>(
E/AndroidRuntime( 6803): at java.nio.ReadWriteDirectByteBuffer.<init>(
E/AndroidRuntime( 6803): at java.nio.BufferFactory.newDirectByteBuffer(
E/AndroidRuntime( 6803): at java.nio.ByteBuffer.allocateDirect(
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.convertTexture(
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.blit(
E/AndroidRuntime( 6803): at com.threed.jpct.GLRenderer.execute(
E/AndroidRuntime( 6803): at com.threed.jpct.FrameBuffer.blit(
E/AndroidRuntime( 6803): at

Support / setting polygon texture
« on: October 14, 2010, 02:08:50 am »
I have a merged object which is serialized with desktop jPCT. i change textures of some polygons during the course of the game. this works fine in desktop jPCT. but in AE I got some strange behaviour:

* with one subobject to change texture this works fine
* with a couple subobjects, i only get a result by setting texture of first one and this operation sets textures of other subobjects too. setting texture on other subobjects has no effect

i suspect this thing requires, build(false) method. if this is the case, there is no such method in AE, how can i serialize such an object from desktop jPCT?

i've also tried calling compile(true) before serialization but didnt help.

Support / lighting mode and ambient light
« on: September 24, 2010, 08:39:55 pm »
i need to set ambient light to a high value to make details of textures visible. but in that case i cant properly set color of glow planes. -i guess- because of over lighting they seem white. and seems as calling

Code: [Select]
has no effect with ambient light. so what can i do in this case except changing ambient light ?

Support / merging objects with transparency
« on: September 22, 2010, 07:37:57 pm »
seems as it has no effect merging objects with transparency. in the final merged object all transparency has gone. is this intentional ?

i've also tried setting one of object's transparency via PolygonManager, but in that case merging objects throws a NPE. ie. following code:

Code: [Select]
Object3D one = Primitives.getBox(1, 1);
for (int p = 0; p < one.getPolygonManager().getMaxPolygonID(); p++) {
one.getPolygonManager().setVertexAlpha(p, 0, 0f);
one.getPolygonManager().setVertexAlpha(p, 1, 0f);
one.getPolygonManager().setVertexAlpha(p, 2, 0f);

Object3D two = Primitives.getBox(1, 1);
two.translate(0, 3f, 0);

Object3D merged = Object3D.mergeObjects(one, two);

Code: [Select]
Exception in thread "main" java.lang.NullPointerException
at com.threed.jpct.Object3D.appendToObject(Unknown Source)
at com.threed.jpct.Object3D.mergeObjects(Unknown Source)
at tmp.MergeTransparent.main(

btw, i'm a bit unclear what PolygonManager().setVertexAlpha(..) does. in my tries i saw no effect of it.
we set alpha values of vertices not the polygon. how exactly does it work ?

Support / compile
« on: August 20, 2010, 07:23:41 am »
i know compile() method is removed because all objects are compiled in AE but it may still make sense to put it back. it's is useful as a preperation before game begins. if i dont miss something, at the moment we are forced to serialize even the simplest objects like particles. particles are typically cloned from a master and at each cloning a compile occurs

Support / some effects
« on: August 17, 2010, 06:43:25 am »
how would you implement these effects ? i've also written my ideas but maybe there are better ways

* gravity tile which makes things heavier then they are. i planned to use a billboarded transparent plane over the tile with a texture with small downward arrows on it. then change the UV coordinates in time such that arrows move downwards.
* lava (or similar) tile which kills the player. some particles maybe spawn over it but this may be a performace killer if number of lava tiles increase
* teleport or portal tile: billboarded plane with a texture like the shield in robombs. uv coordinates can be changed to provide some motion
* exit tile: with glow effect

Pages: 1 2 [3] 4 5 ... 8