Editable grid 16x16x16
Finally, my grid is editable now.
We can edit or remove current blocks – adding new ones will be introduced after optimisation stage.
Current version supports 4 standard blocks (Blue, Green, Yellow, Brown) and 1 point light (Blue with circle in the middle).
In this iteration of “boxel engine” regenerateBuffers method updates nearest block that collides with ray fired from camera POV within worldGrid 3 dimensional table, after that, buffers that contain shadow and light powers are recalculated, at the end two openGL methods are called (for each buffer):
glBufferSubData(GL_ARRAY_BUFFER, 0, frame_vertices[sectorID].size()*sizeof(glm::vec3), &frame_vertices[sectorID]);
first, buffer is bind, and then values are updated, starting from index 0 and then updating whole buffer.
Optimisation, that I will be introducing soon, is updating only changed values that will reduce data size.
That has to be send to graphics card.
Grid 64 recalculation takes a while :S
Metrics will be added soon.
Shadows added - calculated on GPU but still works fine!
Shadow value for each cube is stored in separate grid, values are sent to shader and then output is altered. It all depends on value.
The value is calculated based on number of obstacles on the way between light and current cube.
Below you can find some metrics:
Metrics for shadow added.
Earlier I have introduced point light to engine, there is example of one point light – shown below.
Point lights introduced.. performance drops.. but that's good.
Below 510 point lights on 64x64x64 cubes grid.
Point lights on 64 grid - 36 FPS.. pretty Ok.
And its metrics..
512 Point Lights took 2 Friends Episodes to load in
Metrics for grid of 32x32x32 cubes, below:
Wait.. What?!?.. straight Line?
Why the results for point lights are almost the same?
All the calculations are precomputed on CPU so we are dealing with fixed buffer of light values – which is fair enough, however I need to optimise loading process so it will allow to add lights in real time.
Next step, editable terrain..
Directional Lighted "boxel" scene
Very simple calculation of directional light had noticeable impact on the performance, table below shows it:
Performance impact for different number of boxes.
and yeah, SW:TOR is pretty Ok but nothing can win with “coding hunger”.
Textured 262144 cubes
This evening code hunger got me badly.. tomorrow, big launch of SW:TOR and lets be honest about it.. I will do no more honours project related work over this Christmas.
Anyway, in order to evaluate the software I have collected FPS and Memory Usage of the application.
Metrics for above project
Base metrics are like this:
Funny enough, in texture integration progress I have made some optimisation, frame rate went up by slight cost of memory.. I am happy, I can deal with that.
Task: need to store grid of 128x128x128 cubes (36 vertices each) no octree yet.. any ideas?
Last few days disappeared from my life.
Thinking about “what exactly I want to evaluate in the engine” and “how do I compare it”, “with what”. Made me little bit crazier.
I came up with several ideas but yet.. not good enough.
“What are the techniques of rendering voxel based objects in real time?”
This is a question I have been struggling with since last summer.
I will be doing that for next year – in my honours project.
I have designed test/experiments.
Some of them has been – already – eliminated.
However, there are so many things I could perform in order to make me my GPU cry.
meanwhile.. “boxel” engine is in development – time to test “crazy” ideas of mine.