jrenner / gdx-proto

GDX Proto - a lightweight 3D engine built with libgdx
Apache License 2.0
161 stars 28 forks source link

Replace Decal batch with a Model #2

Closed Caresilabs closed 10 years ago

Caresilabs commented 10 years ago

In the View.class batches goes like this:

  1. Render all models
  2. Render decals and flush
  3. render particles

Shouldn't we gain performance by replacing the Decal Model with a "Plane" model so we get rid of these flushes and begins:

    @View.class
    for (EntityDecal entityDecal: EntityDecal.list) {
        entityDecal.update();
        decalBatch.add(entityDecal.decal);
    }
    decalBatch.flush();

    modelBatch.begin(camera);
    drawParticleEffects();
    modelBatch.end();

If we use a Plane Model everything can be done within one batch!

jrenner commented 10 years ago

Yes, that is probably a good idea. Also, there is some graphical errors that occur (depth testing related) between the the models and decals. (you can see it when your shadow is between you and a decal, or sometimes when particle effects and decals conflict.

I just went with decals to save time.

Caresilabs commented 10 years ago

@jrenner Right! Are you still working on Proto (which I wish you are)? I can see what I can do when I get home from work.

Cheers!

jrenner commented 10 years ago

I just did some work today to get it working on Android (a recent bug fix in libgdx allowed this)

jrenner commented 10 years ago

done