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 - Alexey

Pages: [1] 2 3 4
1
Support / Re: OutOfMemoryError on ICS
« on: December 02, 2011, 09:55:16 am »
Code: [Select]
o.shareCompiledData(original);
Yes! Thats it! Thank you! With this data sharing i run 3000 objects  without OOM.
Another question  - if objects convert to native data (as i know, native memory usage  not included to activity memory usage) they should not contribute to the overflow activity memory limit if load its by parts then convert loaded part to native data and clear their mesh data in java object3d (of course this only for static meshes). If sometime will be need to load ~many hard-weight static objects without sharing compile data, is it possible to realize some like this loading process? Is there a way to force convert obj to native data and safety set null its mesh data? (and same for textures)

2
Support / Re: OutOfMemoryError on ICS
« on: December 01, 2011, 05:24:23 pm »
i tried cloneObject() & new Object3d(o, reuseMesh=true). Tried primitive.shareCompiledData(each cloned object).
Creation part:
Code: [Select]
Object3D original = Primitives.getSphere(4, 1);
original.compile();
original.strip();
original.build();
original.rotateY((float) (Math.PI / 4));
short i = 0;
short y = 0;
short z = 0;
short rowCount = 0;
for (int j = 0; j < particles.length; j++) {
ParticlePB particle = new ParticlePB();
Object3D o =  new Object3D(original, true);//box.cloneObject();
if (i == inRow) {
i = 0;
++rowCount;
}
original.shareCompiledData(o);
o.strip();
// o.forceGeometryIndices(true);
o.build();
y = (short) (i * moveStep);
z = (short) (rowCount * moveStep);
o.translate(0, y, z);
++i;
particle.setObject3D(o);
particles[j] = particle;
world.addObject(o);
System.out.println(usedMemory());
}
after create each SOUT write:
Code: [Select]
12-01 18:05:48.775: INFO/System.out(29877): 7857992
12-01 18:05:48.775: INFO/System.out(29877): 7870520
12-01 18:05:48.775: INFO/System.out(29877): 7885464
12-01 18:05:48.775: INFO/System.out(29877): 7898184
12-01 18:05:48.775: INFO/jPCT-AE(29877): Memory usage before compacting: 7714 KB used out of 23399 KB
So each obj ~12k, count of iteration = 500;
after that log write sequence
Code: [Select]
2-01 18:05:49.495: INFO/jPCT-AE(29877): Subobject of object 5/object7 compiled to flat fixed point data using 96 vertices in 5ms!
12-01 18:05:49.495: INFO/jPCT-AE(29877): Object 5/object7 compiled to 1 subobjects in 12ms!
12-01 18:05:49.495: INFO/jPCT-AE(29877): Object 'object7' uses one texture set!
12-01 18:05:49.495: INFO/jPCT-AE(29877): Subobject of object 6/object8 compiled to flat fixed point data using 96 vertices in 1ms!
12-01 18:05:49.505: INFO/jPCT-AE(29877): Object 6/object8 compiled to 1 subobjects in 8ms!
12-01 18:05:49.505: INFO/jPCT-AE(29877): Object 'object8' uses one texture set!
...
12-01 18:05:50.515: INFO/jPCT-AE(29877): Subobject of object 310/object312 compiled to flat fixed point data using 96 vertices in 1ms!
12-01 18:05:50.515: INFO/jPCT-AE(29877): Object 310/object312 compiled to 1 subobjects in 3ms!
12-01 18:05:50.515: INFO/jPCT-AE(29877): Object 'object312' uses one texture set!
12-01 18:05:50.515: ERROR/dalvikvm-heap(29877): 768-byte external allocation too large for this process.
12-01 18:05:50.515: ERROR/dalvikvm(29877): Out of memory: Heap Size=23399KB, Allocated=8826KB, Bitmap Size=943KB, Limit=21884KB
12-01 18:05:50.515: ERROR/dalvikvm(29877): Trim info: Footprint=23879KB, Allowed Footprint=23879KB, Trimmed=480KB
12-01 18:05:50.515: WARN/OSMemory(29877): External allocation of 768 bytes was rejected
12-01 18:05:50.525: WARN/dalvikvm(29877): threadid=8: thread exiting with uncaught exception (group=0x40025a70)
12-01 18:05:50.535: ERROR/AndroidRuntime(29877): FATAL EXCEPTION: GLThread 9
        java.lang.OutOfMemoryError
        at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
        at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:150)
        at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:66)
        at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:51)
        at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:93)
        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:68)
        at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:774)
        at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:151)
        at com.threed.jpct.World.compile(World.java:2050)
        at com.threed.jpct.World.renderScene(World.java:1093)

There are only this objects in world. I think they should not overflow the memory.
What doing when out like "INFO/jPCT-AE(29877): Subobject of object 5/object7 compiled to flat fixed point data using 96 vertices in 5ms!
12-01 18:05:49.495: INFO/jPCT-AE(29877): Object 5/object7 compiled to 1 subobjects in 12ms!" ?

3
Support / Re: OutOfMemoryError on ICS
« on: December 01, 2011, 03:24:49 pm »
Not about ICS, but about memory - when i create for example 200 objects (by cloning primitive.sphere(4,1) , without any texture) i have
Code: [Select]
12-01 16:08:15.743: ERROR/dalvikvm-heap(29270): 768-byte external allocation too large for this process.
12-01 16:08:15.743: ERROR/dalvikvm(29270): Out of memory: Heap Size=23399KB, Allocated=8825KB, Bitmap Size=943KB, Limit=21884KB
12-01 16:08:15.743: ERROR/dalvikvm(29270): Trim info: Footprint=23879KB, Allowed Footprint=23879KB, Trimmed=480KB
12-01 16:08:15.743: WARN/OSMemory(29270): External allocation of 768 bytes was rejected
12-01 16:08:15.753: WARN/dalvikvm(29270): threadid=8: thread exiting with uncaught exception (group=0x40025a70)
12-01 16:08:15.773: ERROR/AndroidRuntime(29270): FATAL EXCEPTION: GLThread 9
        java.lang.OutOfMemoryError
        at org.apache.harmony.luni.platform.OSMemory.malloc(Native Method)
        at org.apache.harmony.luni.platform.PlatformAddressFactory.alloc(PlatformAddressFactory.java:150)
        at java.nio.DirectByteBuffer.<init>(DirectByteBuffer.java:66)
        at java.nio.ReadWriteDirectByteBuffer.<init>(ReadWriteDirectByteBuffer.java:51)
        at java.nio.BufferFactory.newDirectByteBuffer(BufferFactory.java:93)
        at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:68)
        at com.threed.jpct.CompiledInstance.fill(CompiledInstance.java:774)
        at com.threed.jpct.Object3DCompiler.compile(Object3DCompiler.java:151)
        at com.threed.jpct.World.compile(World.java:2050)
        at com.threed.jpct.World.renderScene(World.java:1093)

Is that really out of memory or i have some memory leak ? (desire hd)

4
Support / Re: setAdditionalColor
« on: November 01, 2011, 08:54:56 am »
Tried in empty new project - setAdditionalColor work fine, so something wrong in my project, if i find  the cause - i will write here

5
Support / Re: setAdditionalColor
« on: October 30, 2011, 02:21:47 pm »
I try on 2 objects (base color of texture - green) - to one of them add color 0,0,255 and cant see at least some difference

6
Support / setAdditionalColor
« on: October 29, 2011, 02:18:41 pm »
Hello, i try to set additional color for the object, but it not do any color changes. May do something wrong?
Code: [Select]
Object3dEx marker = new Object3dEx(Primitives.getPlane(1, 10));
initTextureByName(UITextureName.marker.name(), true);
marker.setBillboarding(true);
marker.setTransparency(5);
marker.setTexture(UITextureName.marker.name());
marker.compile();
marker.setLighting(Object3D.LIGHTING_NO_LIGHTS);
marker.build();
world.addObject(marker);
//function for pc/android realization depend to in color class
        addAdditionalColor(marker, new int[]{0,255 ,0});
marker.translate(marker.getTranslation().calcSub(placeObj.getTransformedCenter()));
marker.addParent(placeObj);

        public void addAdditionalColor(Object3D o, int[] color){
o.setAdditionalColor(new RGBColor(color[0], color[1], color[2]));
}



7
Support / Re: Overlay depth
« on: September 30, 2011, 09:00:34 pm »
Try setting the depth of the overlay to something like -100 when calling Overlay.setDepth().
I can't say which version of javadoc i has read, but i remember that depth mast have positive value

8
Support / Overlay depth
« on: September 30, 2011, 01:24:27 pm »
Hello, i have an overlay issue - when camera overlaps with some object, overlay overlaps too (depth set to 0). For example:

Can i in some way avoid overlapping objects with overlay?

9
Support / Re: Keeping track of character direction
« on: September 08, 2011, 09:23:44 am »
Hello all! Egon, could you add a method lookAt(SimpleVector) to Object3D, like Camera has?

10
Support / Re: Path animation
« on: September 06, 2011, 12:35:40 pm »
I solve mi issue :)  - i created needed path, convert it to mesh, export to collada .dae, from result file copy vertices's array and translation vector & parse it with adding translation  vector to array of SimpleVector

11
Support / Re: Path animation
« on: September 06, 2011, 08:44:56 am »
I understand. I was not clear how the movement was specified. Manually move do not quite fit for me, but thanks anyway!

12
Support / Re: Path animation
« on: September 05, 2011, 11:26:58 am »
сan you explain more specifically?

13
Support / Path animation
« on: September 05, 2011, 10:49:41 am »
Hello all, i need to do something like path animation, move the object along the path. yet what I think to place a dummies in the world and use them as intermediate points, but this is somewhat time-consuming. Maybe have a better idea?

14
Support / Re: Low performance question
« on: August 29, 2011, 11:32:34 am »
What would not create a new topic, ask here - for example, some objects in camera focus, camera should rotate around its,  for performance better rotate camera or objects? or a small difference?

15
Support / Re: clear data
« on: August 15, 2011, 11:29:21 am »
Ok, thank you for replies!

Pages: [1] 2 3 4