OsnaCS / plantex

(UNMAINTAINED) :seedling: experimental open-world exploration game with plants :evergreen_tree: :leaves: :herb: :palm_tree:
Apache License 2.0
191 stars 37 forks source link

One vertex buffer to rule them all #190

Closed LukasKalbertodt closed 8 years ago

LukasKalbertodt commented 8 years ago

Instead of using instancing, this PR saves a whole chunk in one vertex and index buffer. This increases the performance of rendering the ground a lot. I lack exact benchmarks, but I hope a few of you could provide such benchmarks.

Without rendering shadow or plants, I get between 50 and 60 FPS on my integrated Intel HD Graphics 530. With plants enabled I still get around 50 FPS in biomes with few plants, but FPS drops a lot in forests.

There is still a lot of room for improvements, but I figured this is enough for now.

Oh and by the way: I fixed the indexing bug. Or at least one big indexing bug.

jonas-schievink commented 8 years ago

The indexing fixes sadly do not fix #88

jonas-schievink commented 8 years ago

The buffer building code is a tad too complex for my liking, but very well documented so looks good to me

LukasKalbertodt commented 8 years ago

The buffer building code is a tad too complex for my liking, but very well documented so looks good to me.

I think so, too, but I wasn't able to come up with a less complex solution yesterday that does exactly the same thing. But feel free to simplify it :stuck_out_tongue: I'd like to tweak it a lot still, but I have other things to do.

LukasKalbertodt commented 8 years ago

Btw, I just checked: this PR introduces the flickering plants. That's pretty nice, since the PR doesn't change any of the plant rendering code (except for the two deleted empty lines). OpenGL, fuck yeah :flushed:

We should check on what GPUs the plant flickering occurs.