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

Pages: [1]
1
Support / Re: Decreasing polygone count make the app more laggy !
« on: June 14, 2012, 02:39:53 pm »
I don't fix the problem, 30 fps on a galaxy S2, it's just too poor, because I add 6 polygons every seconds... Other phones will not be able to run it :(. I can't imagine that my 3D models are too complexe.

2
Support / Re: Decreasing polygone count make the app more laggy !
« on: June 14, 2012, 01:20:03 pm »
Ok. There is no performance impact when I turn off collisions. In practice, if I do not have this parameter to 20000 offset collision, collisions are not detected on this huge wall (2000 units, maybe should I add more polygons?).

If I delete the wall I have the same performance problems. I try to adjust clipping too...

With Ogre for Android and a scene with 10 times polygons (50 000) their is no lag :'(. I prefere your 3D Engine because it is light and and because you track your work seems very nice and sharp!

TY another time for reading !

3
Support / Re: Decreasing polygone count make the app more laggy !
« on: June 13, 2012, 07:58:25 pm »
I just do some rotations and translations, and I have around 5000 polygones.

4
Support / Re: Decreasing polygone count make the app more laggy !
« on: June 13, 2012, 04:09:44 pm »
Only one moto is moving, others are static because solo mode is activated.

So, the floor with 300poly make the scene more laggy than the floor with 1200 (10 fps difference), I use a Galaxy S2, tested on android ICS and Gingerbread, same result.

In the onCreate :
Code: [Select]
/*3D*/
master = null;
if (master != null) {
copy(master);
}

super.onCreate(savedInstanceState);

/*Liaison avec OpenGL*/
mGLView = new GLSurfaceView(getApplication());

mGLView.setEGLConfigChooser(new GLSurfaceView.EGLConfigChooser() {
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
// Ensure that we get a 16bit framebuffer. Otherwise, we'll fall
// back to Pixelflinger on some device (read: Samsung I7500)
int[] attributes = new int[] { EGL10.EGL_DEPTH_SIZE, 16, EGL10.EGL_NONE };
EGLConfig[] configs = new EGLConfig[1];
int[] result = new int[1];
egl.eglChooseConfig(display, attributes, configs, 1, result);
return configs[0];
}
});

/*Moteur de rendu*/
renderer = new MyRenderer();

/*On assigne une vue au moteur de rendu*/
mGLView.setRenderer(renderer);
setContentView(mGLView);

This is the Render class (without onDrawFrame)

Code: [Select]
class MyRenderer implements GLSurfaceView.Renderer {


private long time;

private long prectime=System.currentTimeMillis();

private boolean lost=false;


public MyRenderer() {
}

public void onSurfaceChanged(GL10 gl, int w, int h) {
/*initialisation*/
time=System.currentTimeMillis();
if (fb != null) {
fb.dispose();
}

fb = new FrameBuffer(gl, w, h);

if (master == null) {

prectime=System.currentTimeMillis();
world = new World();
world.setAmbientLight(250,250,250);

Config.collideOffset=20000;

Texture rouge = new Texture(1,1,new RGBColor(255, 0, 0));
TextureManager.getInstance().addTexture("rouge", rouge);

Texture vert = new Texture(1,1,new RGBColor(0, 255, 0));
TextureManager.getInstance().addTexture("vert", vert);

Texture bleu = new Texture(1,1,new RGBColor(0, 0, 255));
TextureManager.getInstance().addTexture("bleu", bleu);

Texture jaune = new Texture(1,1,new RGBColor(255, 255, 0));
TextureManager.getInstance().addTexture("jaune", jaune);

AssetManager assetManager = getApplicationContext().getAssets();
InputStream  is = null;
InputStream  is2 = null;

/*déserialisation*/
try {
is=assetManager.open("floor.3ds");
} catch (IOException e) {
e.printStackTrace();
}



/*déserialisation*/
try {
is=assetManager.open("floor.obj");
} catch (IOException e) {


e.printStackTrace();
}

try {
is2=assetManager.open("floor.mtl");
} catch (IOException e) {

e.printStackTrace();
}

floor = Loader.loadOBJ(is,is2,1);
for(int i=0; i<floor.length;++i)
{
floor[i].strip();
floor[i].build();
floor[i].scale(0.5f);
world.addObject(floor[i]);
floor[i].translate(new SimpleVector(-floor[i].getCenter().x/2,-floor[i].getCenter().y/2,0));

}

/*déserialisation*/
try {
is=assetManager.open("wall.obj");
} catch (IOException e) {



e.printStackTrace();
}

try {
is2=assetManager.open("wall.mtl");
} catch (IOException e) {




e.printStackTrace();
}

wall = Loader.loadOBJ(is,is2,1);
for(int i=0; i<wall.length;++i)
{

wall[i].setTransparency(5);

wall[i].strip();
wall[i].build();

world.addObject(wall[i]);
wall[i].setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);

}






/*déserialisation*/
try {
is=assetManager.open("mo.obj");
} catch (IOException e) {


e.printStackTrace();
}

try {
is2=assetManager.open("mo.mtl");
} catch (IOException e) {

e.printStackTrace();
}

cycle = Loader.loadOBJ(is,is2,1);

motos[0]=new Object3D[cycle.length];
motos[1]=new Object3D[cycle.length];
motos[2]=new Object3D[cycle.length];
motos[3]=new Object3D[cycle.length];

for(int i=0; i<cycle.length;++i)
{
motos[0][i]=new Object3D(cycle[i]);
motos[1][i]=new Object3D(cycle[i]);
motos[2][i]=new Object3D(cycle[i]);
motos[3][i]=new Object3D(cycle[i]);

if(i!=0)
{
motos[0][i-1].addChild(motos[0][i]);
motos[1][i-1].addChild(motos[1][i]);
motos[2][i-1].addChild(motos[2][i]);
motos[3][i-1].addChild(motos[3][i]);

cycle[i-1].addChild(cycle[i]);
}


motos[0][i].build();
motos[1][i].build();
motos[2][i].build();
motos[3][i].build();

cycle[i].build();


world.addObject(motos[0][i]);
world.addObject(motos[1][i]);
world.addObject(motos[2][i]);
world.addObject(motos[3][i]);

world.addObject(cycle[i]);

}

cycle[COLLIDER].setCollisionMode(Object3D.COLLISION_CHECK_SELF|Object3D.COLLISION_CHECK_OTHERS);

motos[0][0].rotateZ((float) Math.PI);
motos[1][0].rotateZ((float) (Math.PI-1*(Math.PI/2)));
motos[2][0].rotateZ((float) (Math.PI-2*(Math.PI/2)));
motos[3][0].rotateZ((float) (Math.PI-3*(Math.PI/2)));

cycle[0].rotateZ((float) Math.PI);

motos[0][0].translate(new SimpleVector(1000,1000,0));
motos[1][0].translate(new SimpleVector(1000,1000,0));
motos[2][0].translate(new SimpleVector(1000,1000,0));
motos[3][0].translate(new SimpleVector(1000,1000,0));

cycle[0].translate(new SimpleVector(1000,1000,0));

SimpleVector initVect = new SimpleVector(0,-60,0);

motos[0][0].translate(initVect);
initVect.rotateZ((float)Math.PI/2);
motos[1][0].translate(initVect);
initVect.rotateZ((float)Math.PI/2);
motos[2][0].translate(initVect);
initVect.rotateZ((float)Math.PI/2);
motos[3][0].translate(initVect);


precPos=new SimpleVector(cycle[0].getTransformedCenter());
mCam = world.getCamera();

mCam.moveCamera(cycle[3].getTransformedCenter(), 1);
mCam.moveCamera(new SimpleVector(mCam.getPosition().x, mCam.getPosition().y+200, mCam.getPosition().z+100), 1);

SimpleVector upOld = world.getCamera().getUpVector();

SimpleVector dirOld = world.getCamera().getDirection();

SimpleVector rotation = new SimpleVector(-(float)(0.65*Math.PI/2),-(float)Math.PI, 0);
upOld = upOld.rotate(rotation);
dirOld = dirOld.rotate(rotation);
world.getCamera().setOrientation(dirOld, upOld);

/* Light pos*/
SimpleVector sv = new SimpleVector();
sv.set(floor[0].getTransformedCenter());
sv.x += 100;
sv.y += 100;
sv.z +=100;

MemoryHelper.compact();

if (master == null) {
Logger.log("Saving master Activity!");
master = GameActivity.this;
}

cpd.hide();
}
}

So do you think (particularely for initialisation, loading of objects) there is an error of my part ? For the offset its a mistake, my english is too poor, and I thought it was the maximal size of a polygon.

5
Support / Re: Decreasing polygone count make the app more laggy !
« on: June 13, 2012, 01:50:45 pm »
Ok... My calculation doesn't exceed 5ms in on draw frame, it just can be a bad parameter or a huge number of polygones... How many polygons can be managed smoothly with 60 fps ?

6
Support / Decreasing polygone count make the app more laggy !
« on: June 13, 2012, 01:02:42 pm »
Hi,

I have 1445 polygones (30 fps), I decrease the count to 289 and the scene pass to 20fps !

How is it possible ?

I use collision method for an object and a complex wall, I don't think it can be that. collideOffset is set to 20 000, because I create numerous polygons more the scene is old.

Thank you for reading

7
Support / Re: Disable adb Logs
« on: June 13, 2012, 12:54:08 pm »
Ok, thank you !

8
Support / Disable adb Logs
« on: June 12, 2012, 05:11:36 pm »
Hi,

Is it possible to disable jpct ae logs ?

TY

9
Support / Distance View
« on: May 27, 2012, 02:10:00 pm »
Hi,

How to increase just a little bit the distance view ?

With the Camera documentation I didn't see something which allow to do that.

Thank you for any answer.

Jo

10
Support / Re: Texture rendering bug - SGS2 DEV
« on: May 27, 2012, 01:53:10 pm »
Ok, thank you very much

11
Support / Re: Texture rendering bug - SGS2 DEV
« on: May 26, 2012, 02:47:06 pm »
I use a Samsung Galaxy S2 (I9100)

12
Support / Re: Texture rendering bug - SGS2 DEV
« on: May 26, 2012, 10:02:37 am »
http://www.youtube.com/watch?v=_vesmHaDCow

TY for this answer but I did not expect this, Verily there is no solution to obtain a correct rendering? On this video the graphics engine seems to provide a rendering more than correct.

Jo

13
Support / Texture rendering bug - SGS2 DEV
« on: May 25, 2012, 11:44:02 pm »
Hi,

I have some trouble with texture rendering (floor), with this code, I obtain :

Texture texture2 = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.vertpic)), 64, 64));
TextureManager.getInstance().addTexture("vertpic", texture2);
            
floor = Loader.load3DS(is, 500)[0];
floor.scale(10);
            
floor.setCulling(Object3D.CULLING_DISABLED);
floor.rotateX((float)Math.PI);
floor.setTexture("vertpic");
world.addObject(floor);



Where do you think it come from ?

TY for any answer

Jo

Pages: [1]