Project ES refactoring and random playing with OpenGL

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Busy weekend:
1. Textures can now have transparency (i.e. leaves).
2. Further improved shadows.
3. Extracted rendering of backdrop to an interface and multiple backdrop renderers can participate in rendering it.
4. Added "celestial bodies" (using backdrop rendering) module that allows to define the position of celestial bodies rendered on the skysphere.
5. Extracted tree generation parameters to a component.
6. Added a new tree type (pine), just by dropping following prefab to project and making world generator use it:
https://github.com/MarcinSc/TerasologyPrime/blob/master/trees/assets/prefabs/treeType/pine.prefab

Here is screenshot showing pines and also leaves transparency:
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Today I've added post processing hook to the rendering engine.

I've also added two post processor implementations, blur:

And bloom:
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Finally found the time to check it out. Nice work, and pretty trees :) In case you are still intersted in statistics and comparison to Terasology, here are my stats. Is there any way to resize the window?

TerasologyPrime:
- Day/Night/Sunset: 190/240/130 fps
Terasology: (Epic, view distance 'far')
- constant 150 fps (larger frame)
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
TerasologyPrime: (fullscreen)
- Day/Night: 150/60(?) fps
Terasology: (Epic, view distance 'far', fullscreen)
- constant 100 fps

System: Radeon Hd6870, Intel Xeon E3-1231v3 (4x3.4GHz)

Oddly, the framerate at night is way lower than at daytime when running in fullscreen...
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
The "stars" at night are passed to shader in an array. If the number is large enough, multiple draw calls have to be made, each with set of stars to draw. The maximum size of an array is graphics card dependent. If you try to pass too many in one draw call it takes forever.

This might be the case in here. I'll have to make the size dynamic, based on GL read from property to avoid these situations. To test if it helps, you might try to reduce the number of stars in "CircleCelestialBodiesRenderer" in the "for (int i = 0; i < 300; i++)".
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Reducing the number to 100 actually helps, frames go up to 120 at night. The effect does not occur in windowed mode because the frame is way smaller and there are less stars to draw, is that a correct guess?
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
It's only about number of draw calls to shader, and then how many pixels shader has to evaluate. So, if you increase the size of window - the number of pixels increases. If you increase number of stars - number of draw calls increases, because of the max size of parameter array you can pass in one draw call.
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
It's time for an update again. I've been busy the last week so have not done much work, but here is what I've got:
1. Figured out what kind of "game" I want to make - imagine Minecraft, Tower Defense and League of Legends had an ugly baby.
2. Improved collision detections - still some work I want to do on that field to allow raycasting. I've completely abandoned the Bullet/JBullet approach, since even if I made it work, it would not allow me to do certain stuff.
3. Implemented a particle system.

Particle system in action:
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Very cool! We should have a particle system GSOC item or something, you could mentor!

:D

Is it tapping any LibGDX stuff or is it all more or less raw OpenGL?
 

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
Very cool! We should have a particle system GSOC item or something, you could mentor!

:D

Is it tapping any LibGDX stuff or is it all more or less raw OpenGL?
The LibGDX library has its own particle system, but it's very limiting and for example would not work in multi-world environment, because it uses static containers for particles. I wrote my own particle system, that uses LibGDX for rendering, that even allows some extendability.

It was actually pretty easy to implement and could be probably copy/pasted into Terasology:
https://github.com/MarcinSc/TerasologyPrime/tree/master/particle/src/main/java/com/gempukku/terasology/particle
 
Last edited:

Marcin Sciesinski

Code ALL the Ages!
Contributor
World
Architecture
And another update:
1. Implemented "faction" system that allows to specify allegiance of entities and define opposing factions.
2. Implemented rudimentary AI of characters that moves along specified path, until it encounters an entity of opposing faction within its firing range, once there - fires at it.

Here is the video:
 
Top