Main Menu
Menu

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.

Show posts Menu

Messages - vael

#1
Support / Re: GC frees too much
November 22, 2010, 06:44:17 PM
wow you're fast! with the new version and my own code rewritten to match the optimized getters it is WAY better.

Thank you for a that fast fix.

By the way doesn't Object3D's method getRotationMatrix() create objects?
#2
Support / Re: Texturing a Primitive
November 21, 2010, 06:12:00 PM
btw what does calcTextureWrap() do? I tried calling it with a box primitive and it seemed like all uv were set (0; 0)
#3
Support / Re: GC frees too much
November 21, 2010, 04:38:26 PM
and by the way seems like you've pointed the right method. because when I comment using it GC goes way more quite. By the way are you sure translate() doesn't create objects and doesn't cause a renderer to create some because an object is translated?
#4
Support / Re: GC frees too much
November 21, 2010, 04:15:26 PM
oh it seems like I've found the problem:



public class JPCTBulletMotionState extends MotionState
{
private Object3D obj3d;
 
public JPCTBulletMotionState(Object3D obj)
{
this.obj3d = obj;
}
 
public JPCTBulletMotionState(Object3D obj, Transform startTrans)
{
this.obj3d = obj;
this.setGraphicFromTransform(startTrans);
}  


public Transform getWorldTransform(Transform worldTrans)
  {
this.setTransformFromGraphic(worldTrans);
return worldTrans;
  }
 
public void setWorldTransform(Transform worldTrans)
  {
this.setGraphicFromTransform(worldTrans);
  }
 
 
private void setTransformFromGraphic(Transform tran)
{
SimpleVector p = this.obj3d.getTransformedCenter();
tran.origin.set(p.x, p.y, p.z); // not sure if translation or position

Matrix matrixGfx = this.obj3d.getRotationMatrix();
//matrixGfx.rotateX((float)Math.PI);
MatrixUtil.getOpenGLSubMatrix(tran.basis, matrixGfx.getDump());
}
 
private void setGraphicFromTransform(Transform tran)
{
SimpleVector pos = obj3d.getTransformedCenter();
this.obj3d.translate(tran.origin.x - pos.x,
 tran.origin.y - pos.y,
 tran.origin.z - pos.z);

float[] dump = this.obj3d.getRotationMatrix().getDump(); //new float[16];
Matrix matrixGfx = new Matrix();
    MatrixUtil.getOpenGLSubMatrix(tran.basis, dump);
   
    matrixGfx.setDump(dump);
    //matrixGfx.rotateX((float)Math.PI);
   
    this.obj3d.setRotationMatrix(matrixGfx);
}
}


Is there anything I can save here?

when I create DefaultMotionState instead of this one, I don't have GC working so hard
well at least it is freeing way less
#5
Support / Re: GC frees too much
November 21, 2010, 04:06:47 PM
I use an up-to-date version of jPCT.

And no, I don't create new SimpleVector's but maybe those methods do?
#6
Support / Re: GC frees too much
November 20, 2010, 08:08:06 PM
The source is quite big already so lets try to find it out this way:

I use these methods in the main loop:

Camera's:
rotateX(float);
setPosition(float, float, float);
setOrientation(SimpleVector, SimpleVector);

Object3D's:
translate(float, float, float);
rotateAxis(SimpleVector, float);

can they cause this? as I said I am having about 40 boxes at a time
#7
Support / GC frees too much
November 20, 2010, 05:54:50 PM
Hello,

I'm experiencing lags because of GC and I am rendering only like 30-40 box primitives at a time. I reuse all the objects so I actually I stop allocating memory after 2-3 seconds. But here is what I see in log:


D/FREEROLL(  650): CURRENT FPS: 30
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 40
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 50
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 44
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 52
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 56
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/dalvikvm(  650): GC_FOR_MALLOC freed 39703 objects / 1584536 bytes in 77ms
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 45
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 60
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 54
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 50
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/dalvikvm(  173): GC_EXPLICIT freed 487 objects / 48936 bytes in 837ms
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 45
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/dalvikvm(  650): GC_FOR_MALLOC freed 47179 objects / 1782160 bytes in 78ms
D/FREEROLL(  650): CURRENT FPS: 41
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 56
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 57
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 49
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
E/Tethering(   85): active iface (usb0) reported as added, ignoring
I/jPCT-AE (  650): Static references cleared...
D/LocationMasfClient(   85): getNetworkLocation(): Returning cache location with
accuracy 3875.0
D/FREEROLL(  650): CURRENT FPS: 47
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 47
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/dalvikvm(  650): GC_FOR_MALLOC freed 48783 objects / 1835704 bytes in 77ms
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 43
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 52
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 47
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 54
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 50
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/dalvikvm(  650): GC_FOR_MALLOC freed 48624 objects / 1832888 bytes in 76ms
D/FREEROLL(  650): CURRENT FPS: 45
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 53
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 61
I/jPCT-AE (  650): Static references cleared...
I/jPCT-AE (  650): Static references cleared...
D/FREEROLL(  650): CURRENT FPS: 58


as you see it frees about 1.5mb every few seconds. I have no any dynamic light in the world. When I had it, I had like 1.5mb free per second.

So my question is: why does jPCT needs so much memory to just render? or do I do something wrong?

Thank you
#8
Support / Re: Background pic
August 22, 2010, 12:58:28 PM
oh and one more question please :)
is there in alternative to ReflectionHelper in Android version of jPCT?
#9
Support / Re: Background pic
August 22, 2010, 12:50:16 PM
that's right, thanks for explanation :)
#10
Support / Background pic
August 21, 2010, 10:53:35 PM
Hi all. I've got a problem trying to set a background pic
I tried to blit texture to framebuffer after calling clear()
and something definitely went wrong. in log I see that it resized (lowered) resolution when loaded the texture, but thats not the whole problem I guess. and I'd like resolution to stay high enough, like 800x480.
could you please tell me how I am supposed to do it?