tisdag 18 januari 2011

Or not... :3

If there is anything in life i should know by now, is that just because something looks good, don't mean it has to be.

This is something i always forget, I get all excited about something, just to find out it don't work... and have my dreams shattered :(

The instancing incident looks to be exactly the same, it looks very good in theory, but not so much in application(at leasts not my application).

I'm sure some one could use instancing for the type of engine I'm working on, but i don't think it will be with SunBurn.

So what is the problem?

The problem lays in the structure of witch sunburn handles instancing(maybe this is the normal way, i have only tried instancing with SunBurn), SunBurn works with containers, each container may hold up to 75 objects, all these objects are basically one and the same but located at different locations and they all share the same effects.

in my solution, i had 2 ideas.

1. I have a per-chunk based solution, where every chunk kept track of the blocks in it.
This makes the most sense and is a clean and simple solution, here is an example:

our chunk is made from 256 block, 250 of them are stone and 6 are sand, this means we need 3 containers to store 225 stone, and one to store the rest 25 stone, we also need one container to store the 6 sand.
and you can see, this is ALLOT of wasted container space, and it would happen in evry chunk.

so, the optimal alternative would be.

2. We have one gigantic global multi-array of containers, and every block in the world is added to this array whenever needed, the waste would be as small as it could possible be, BUT it also means:

1# Forget chunk-based Occlusion!, it would be impossible to know witch chunk a block is located in, blocks are basically in a random mess somewhere in that array, and in no way correspond to a chunk, any chunk.

2# for the same reason, it would be very messy to make changes in the terrain, remove a certain block for example, however adding is simple.


There is one more thing that worries me, running the SunBurn instancing example, with 30.000 block gives me <40fps, this can be compared with the original minecraft witch renders 60-70.000+ at 60+ fps, and we don't even have half the objects... no good :3

so what does this mean?
well it means that even tho i love the idea of instancing, i don't think it will work with SunBurn for my needs.

Edit: It should be noted that i don't have anything against Instancing in SunBurn, and i might use it for other things... bonuses, drops on the ground, monsters, and so on... but not blocks in terrain.

Inga kommentarer:

Skicka en kommentar