31
General Discussion / Re: Voxelarium.js
« on: October 31, 2016, 04:34:46 pm »I did some experimenting with building presorted voxels.... which seem to apply pretty fast.
This was part of the C# work; but basically I made a linear list of the closest points of sectors that are to the [upper/0/lower][left/0/right][forward/0/backward]
I just went through each point(voxel) and figured it's distance from the respective point, and then sorted the resulting indexes; so I could have an ordered list of voxel indexes for transparent things that are outside of 'here' which is the 0/0/0 center point...
And really to be more accurate any sector that is on a 0 needs to be sorted based on the slice of other coordinates... blah I'm over-complicating this.
For 'here' the sort list has to be dynamically computed; there's too many combinations to keep them all pre-set; well maybe sub-sectors could be made that could be pieced back together as 'close enough' ...
so anyway then it's just foreach( index in list ) { mesh voxel[index] based on drawinfo } instead of just voxel based on offset... this will then add the faces to the draw list in the right order... (and maybe that's kinda what your sorter does; I just kinda wanted to implement it, because when I tried it with a bunch of semi transparent blocks it broke down because of how it serially stepped - without regard to which side the player was from the sector being meshed.
Why don't I get notifications? I end up having to just come back and read? I'm pretty sure I put in my email right?
The purpose of actual "rendering sorter" in Blackvoxel is mainly to avoid too many texture changes. Some GPU shows important performance improvements with this.
Sorting "by distance" is only made on sector rendering level... but not for each voxel in the sector.
Sorting by distance for each face in the sector would be dependant of the player's point of view. But this would implies that the work could have to be redone (at least on some sectors) each time the player's point of view will change.
In Blackvoxel, "semi transparent" rendering like "tinted glass" is made on an extra separate rendering pass. As faces aren't sorted in a sector, this could end up to rendering transparent textures in the wrong order.
It's could be surprising... but that's not a problem. As long as the textures are sufficiently transparent... it's blending correctly in any order. Of course, there is a drawback : this won't work correctly with texures with too much (or very different levels of) opacity. Sorting faces would make it better for this case. It's a matter of choice between pro and cons.
I've checked for notifications, it's active on the forum and it's working ok : we get it ourself. Yes, you have filled an email address. Check your email in your profile and also the "spam folder" at your mailbox.
The Blackvoxel Team