Open creek23 opened 5 years ago
there are no rules and no clipping when rendering objects, but the framerate should not drop. I could not reproduce so far.
Somehow, I think frame rate drop is somewhat related to how I first wrote the Collada DAE parser -- I had 1 Face3D per triangle inside an Object3D.
In this case, I had 1 Sprite per "tile" in my tile-map.
What is the proper way of rendering the "tile"? Will it be like a single Face3D with multiple triangle represented by float-array? As such, in this case, 1 Sprite with multiple "tile"? but how will I populate the "tile" inside 1 Sprite?
Below is my sample code:
Texture pngGrass = new Texture(this.getBaseContext(), R.drawable.grass);
for (int i = 0; i < 100; ++i) {
for (int j = 0; j < 100; ++j) {
Sprite sprMap = new Sprite(pngGrass.getWidth(), pngGrass.getHeight());
sprMap.setTexture(pngGrassC);
newX -= (sprMap.getWidth() / 2);
newY += (sprMap.getHeight() / 4);
sprMap.setPos(newX, newY);
renderPassSprite.addSprite(sprMap);
}
newX += (tmpX * 101);
newY -= (tmpY * 99);
newY -= (tmpY * 99);
}
Below is the sprite I used.
~creek23
Tried rendering 100x100 iso tile, and FPS dropped to 2frames/second
How come SmartGLRenderer tries to render objects outside the screen? I had to implement my own clipping by checking tile position if it's off screen and got a 30~fps. Not sure how to further improve to get back to 60fps.
~creek23