Project ES refactoring and random playing with OpenGL

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Ok, as promised during the meeting I have created this thread.

Here is a link to the GitHub repo with the code I'm focusing on:
https://github.com/MarcinSc/TerasologyPrime

Today I have:
1. Improved shadow rendering (tweaked settings a bit - see picture below for tree casting shadow).
2. Extracted secsy-network - module that adds networking capabilities to ES in my codebase.
3. Finally generated satisfiable branch/trunk structure for L-system generated trees. Effects as shown below.



Tomorrow I'm planning to add "leaves" to the tree.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Good stuff :)

The finer shapes doable there remind me of @woodspeople's proof of concept in Python of a growth simulator (which is even a GSOC item). It produced plants with far more detail like that. Could that work together theoretically? Or is it too much rendering trickery in use vs. the kind of data backed growth from the advanced simulator? Not saying it would necessarily justify the extra complexity for gameplay reasons.
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Well, it depends how many polys does their solution generate. It's not always "the more, the better". :)

But theoretically it could be adapted.
 
Last edited:

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I think it has a certain charm to it for one tree type - but you'd probably need additional ways to show other types
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Ok, a short video to show chunk generation, rendering speed and shadow quality on my work Mac:

Would be nice to know, how it performs on some older machine (the code on GitHub is up to date).
 

manu3d

Active Member
Contributor
Architecture
I like the cubic look for the leaves. But you nailed the look in the lower portion of the tree: the upper canopy is just too much one big block for my taste!
 

Rostyslav Zatserkovnyi

Member
Contributor
Architecture
GUI
Hunter
Question from an end-user perspective: the generated trees appear to be not quite voxely - can they be interacted with just like normal Minecraft/Terasology trees? (Partially removing trunks/leaves, building on them etc.)
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
What is the correct way to run TerasologyPrime? I tried hacking around intellij for a bit to get it working. but ended up with an error:
Exception in thread "LWJGL Application" java.lang.RuntimeException: Path 'C:/Projects/TerasologyPrime-master/trees/build/resources/main/blockTiles/trees/OakBark.png' does not start with root: C:/Projects/TerasologyPrime-master/core/build/resources/
There must be some run config that I am missing.
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
What is the correct way to run TerasologyPrime? I tried hacking around intellij for a bit to get it working. but ended up with an error:


There must be some run config that I am missing.
It runs fine for me in IntelliJ (after switching to version 1.8 language support). Did you generate the project with "./gradlew clean idea"?
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Question from an end-user perspective: the generated trees appear to be not quite voxely - can they be interacted with just like normal Minecraft/Terasology trees? (Partially removing trunks/leaves, building on them etc.)
No, the plan is to be able to interact only with the bottom block of the trunk. Over the time I tried multiple approaches to generating trees, and nothing works perfectly - you either have nice looking trees with details but no interaction, or blocky trees and you can interact with each block separately.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
There we go. Got it working on my local. Main project structure in intellij set to "8 - Lambdas, type annotations etc" after a "gradlew clean idea" did the trick. (and your fixes to the dependencies)

Going full tilt into new chunks I averaged 55FPS. Standing still I was getting 120FPS. I have a AMD FX 8320 CPU and Radeon 6670 GPU.
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
Terasology runs at 45FPS at "far" distance. 50FPS at "moderate". And seems to throttle more steady when generating chunks at a "full tilt". However, if I go to "far" and go full tilt, it brings things down to 8FPS. Hah.

The interesting difference is that generating chunks has immediate FPS effects in TerasologyPrime than Terasology. Standing still in Terasology does not ramp up to 100+ FPS.

Anything else you want checked?
 

Josharias

Conjurer of Grimoires
Contributor
World
SpecOps
Lies, all lies. I would like to retract my previous statements about TerasologyPrime performance now that I know what to look for. I was confused because the day cycle is presently super fast. :)

Daytime 58-70 FPS
NightTime 143 FPS

Generating chunks decreases the FPS by only a handful of FPS (hard to tell the exact amount).
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Yesterday I've been working on performance improvements. A lot of stuff has been moved from fragment shaders to their respective vertex shaders.

I have also made a successful attempt at getting one level lower in rendering. Rather than using libGDX provided objects (ShaderProvider and ModelBatch) I have directly called ShaderProgram and Meshes to try to improve performance, however the performance boost I got was negligible, and the code was much more difficult to understand and less flexible, therefore I've decided to get back to the original state.

Overall, I was able to boost the FPS by ~20%.

In addition - I have added better support for controls. Now both WASD and arrow keys can be used to move and also mouse can be used to steer the camera angle (pitch and yaw). The controls are now properly processed in the client context and an event is sent to server.
 
Last edited:
Top