VoxelSim Development Thread - SLUniverse Forums
Navigation » SLUniverse Forums > Virtual World Discussion > Other Grids / Virtual Worlds > OpenSim » VoxelSim Development Thread


OpenSim Discuss development, use, and support issues related to the OpenSim project.

 
Reply
 
LinkBack Thread Tools Display Modes
Old 04-30-2010, 07:37 PM   #1 (permalink)
Senior Member
 
Fred Rookstown's Avatar
I see what you did there.
 
Join Date: Oct 2009
Location: Internets
Posts: 2,416
My Mood:
SL Join Date: 3/16/2009
VoxelSim Development Thread

VoxelSim - Adding Voxels to OpenSim
N3X15's VoxelSim at master - GitHub

What Are Voxels and Why should I care?
These blocks are voxels, and the terrain shape alone should be enough to pique your interest.



Notice, in particular, the overhangs and horizontal holes in the terrain.

SL currently uses a heightmap-based terrain system, meaning that it basically sends a black-and-white picture to your viewer, with each "pixel" having a "color" that specifies how high the terrain should be at that specific X/Y position. This is great for transmission over a network, but it has a drawback: You cannot have overhangs, because each (x,y) position on the heightmap can only specify how high the terrain is at that point. There's no room for gaps.

What I'm replacing this shitty system with are called Voxels. Imagine you have <1,1,1>-scale boxes arranged in a perfect grid pattern, 256 boxes on each side, 512 boxes high. You can then select and delete boxes to simulate terrain, or to carve out a house, or to make a cave or even floating islands, all made out of these boxes.

VoxelSim doesn't transmit terrain as a series of (x,y) points with a height. Instead, it transmits a series of (x,y,z) coordinates telling the client where each block of terrain is. The client then smooths the terrain into a less-blocky form.

But oh no, we're not done yet.


I've extended the system to transmit not just {x,y,z}, but {x,y,z,MATERIAL_ID}. Materials allow different types of terrain matter to be used, so that you can have dirt, rock, metal, Zerg Creep, whatever the hell you want, whereever the hell you want it. This improves upon SL's really shitty method of specifying only 4 terrain textures at different fractional heights, reducing the ability for people to add different types of terrain material and prevents them from customizing the terrain to exactly the way they like it.

OpenSim's terrain generator also leaves a lot to be desired. When you first start up the sim, you get a round island with really spiky underwater terrain surrounding it. I decided this was shitty and have added a procedural terrain generation system to OpenSim to fix this issue, by using Minecraft Infdev's terrain generation system (with Notch's written permission) to create amazing, surreal terrain without the blockiness.

What about Backwards Compatibility with old clients/old heightmaps?

The old terrain transmission method will be there, but users using old clients will find themselves falling through the terrain when they enter caves or fall into a hole.

Are you going to add this to Luna?

Yes.

What about LibOMV?

Yes, I'll have to maintain our own LibOMV branch due to OpenSim using it for packet handling.
__________________

Fred Rookstown is offline   Reply With Quote
1 User Said Thanks:
Old 04-30-2010, 09:31 PM   #2 (permalink)
Easy As

*SLU Supporter*
 
Pie Psaltery's Avatar
Dynamite with a Laserbeam
 
Join Date: Oct 2007
Location: Beneath the Perpetually Falling Sky
Posts: 542
My Mood:
SL Join Date: 01/13/2004
Fred, could you please fix the link to download your dam viewer please, pretty please kkthxbai.
Pie Psaltery is offline   Reply With Quote
Old 05-01-2010, 12:54 AM   #3 (permalink)
Senior Member
 
Fred Rookstown's Avatar
I see what you did there.
 
Join Date: Oct 2009
Location: Internets
Posts: 2,416
My Mood:
SL Join Date: 3/16/2009
Quote:
Originally Posted by Pie Psaltery View Post
Fred, could you please fix the link to download your dam viewer please, pretty please kkthxbai.
Done.
Fred Rookstown is offline   Reply With Quote
1 User Said Yay!:
Old 05-02-2010, 12:17 AM   #4 (permalink)
Grid.Living
 
Lordfly Digeridoo's Avatar
I kicked your dog. TO THE MOON.
 
Join Date: Aug 2007
Location: Michigan
Posts: 3,903
My Mood:
SL Join Date: 7/21/2003
Business: Grid.Living

Awards: 1
Thread Title of the Week 
Send a message via MSN to Lordfly Digeridoo Send a message via Skype™ to Lordfly Digeridoo
We can has sexy screenshots?
__________________
http://www.lordfly.com/
Lordfly Digeridoo is offline   Reply With Quote
Old 05-02-2010, 12:35 AM   #5 (permalink)
Senior Member
 
Fred Rookstown's Avatar
I see what you did there.
 
Join Date: Oct 2009
Location: Internets
Posts: 2,416
My Mood:
SL Join Date: 3/16/2009
Quote:
Originally Posted by Lordfly Digeridoo View Post
We can has sexy screenshots?
I haven't even begun planning on how the hell I'm going to to keep compatibility with SL while adding in Voxels (viewer-side).
Fred Rookstown is offline   Reply With Quote
Old 05-19-2010, 01:44 AM   #6 (permalink)
Senior Member
 
Fred Rookstown's Avatar
I see what you did there.
 
Join Date: Oct 2009
Location: Internets
Posts: 2,416
My Mood:
SL Join Date: 3/16/2009
Update:

IT FUCKING COMPILES. VoxelSim is available here.

THIS WILL NOT WORK PROPERLY WITH ANY EXISTING CLIENTS (for now). A modified LibOMV is in ThirdParty/libomv, but I don't know if it'll even work.

Changes

  • Voxel packets added. (LibOMV, too)
    Code:
    //////////////////////////////////////////////////////////////////////////////////////
    // VOXELSIM VOXEL PACKETS
    //////////////////////////////////////////////////////////////////////////////////////
    // Material table sent through capabilities.
    
    // VoxelLayer
    //    Sparse matrix of {x,y,MaterialID}
    //
    {
        VoxelLayer Low 911 NotTrusted Unencoded
        {
            LayerData        Single
            {    Z        U32    }
        }
        {
            VoxelData        Variable
            {    X        U32    }
            {    Y        U32    }
            {    Material    U32    }
        }
    }
    
    // VoxelAdd
    //    Adds a solid voxel to the terrain at the specified point.
    //
    {
        VoxelAdd Low 912 NotTrusted Unencoded
        {
            VoxelData        Single
            {    X        U32    }
            {    Y        U32    }
            {    Z        U32    }
            {    Material    U32    }
        }
    }
    
    // VoxelRemove
    //    Adds an air voxel to the terrain at the specified point.
    //
    {
        VoxelRemove Low 913 NotTrusted Unencoded
        {
            VoxelData        Single
            {    X        U32    }
            {    Y        U32    }
            {    Z        U32    }
        }
    }
    
    // VoxelUpdate
    //    Updates voxel material at the specified point.
    //
    {
        VoxelUpdate Low 914 NotTrusted Unencoded
        {
            VoxelData        Single
            {    X        U32    }
            {    Y        U32    }
            {    Z        U32    }
            {    Material    U32    }
        }
    }
  • Removed heightmap support (Map images should still work)
  • LSL API updated to figure out llGround/osGetTerrainHeight by finding the highest voxel in that X/Y column.
  • osSetTerrainHeight modfied to add/remove voxels
  • Fixed a few compile issues due to OpenSim devs not testing their builds :V
  • Added terrain generator.
  • Fixed some of the terrain-related console commands.
  • Added SendVoxelData(int[,,] map) to all client APIs for sending voxelspace data to the client.
  • Added minecraft NBT file format storage for voxel data. DOES NOT USE .MCLEVEL, OUR VOXEL FORMAT IS MUCH MORE COMPLEX.
  • System will send serialized height floats (old heightmap land patches) for the minimap and for clients that do not support voxels.
Fred Rookstown is offline   Reply With Quote
1 User Said Yay!:
Old 05-20-2010, 07:19 AM   #7 (permalink)
Senior Member
 
Fred Rookstown's Avatar
I see what you did there.
 
Join Date: Oct 2009
Location: Internets
Posts: 2,416
My Mood:
SL Join Date: 3/16/2009
Well, the world map works properly, and voxels are now being generated correctly.


Cross section at 128 Y: (White = solid voxels)


Changes:
  • Got rid of the voxel type, was taking up way too much memory. Each voxel is now just a byte that refers to an entry in the new materials table. (16MB memory usage compared to 1GB)
  • Default material (no textures, yet) added.
  • Terrain generator fixed and I added a cross section for debugging. (Big) caves have been seen in these cross-sections!
  • Terrain generation has been sped up considerably.
  • Got rid of the VoxelLayer type, isn't used anymore (layers are pulled apart in an easier way).
  • NBT now stores materials.
  • Various plugin fixes.
Fred Rookstown is offline   Reply With Quote
Old 06-29-2010, 09:28 PM   #8 (permalink)
Member

*SLU Supporter*
 
Tom Meta's Avatar
Reticulating Splines
 
Join Date: Jun 2010
Posts: 63
My Mood:
Some very, very awesome work here. I'm going to be investing some time into this to try and get the two terrain systems working side-by-side, I don't agree with mel that they can't co-exist.. it just needs a little plumbing work to make that happen.

I'll post my progress here

~T
__________________
I'm a grid admin over at meta7. Come check us out, if you're so inclined.. this isn't just any OpenSim Grid!
Tom Meta is offline   Reply With Quote
Old 06-29-2010, 09:43 PM   #9 (permalink)
fractal networker
 
infiniview Merit's Avatar
 
Join Date: Jul 2007
Location: seattle
Posts: 1,296
My Mood:
SL Join Date: 4-27-06
Business: Texture Arts
Wow that is really cool!

It reminds me of a simple version of 3dCoat all over the terrain.
__________________
Texture Arts Headquarters

http://slurl.com/secondlife/puea/126/10/60/
infiniview Merit is offline   Reply With Quote
Old 06-29-2010, 09:47 PM   #10 (permalink)
Account Closed
Screwing your scripts
 
Join Date: Apr 2009
Posts: 1,505
Giant Legos to play with?
Camille Serpentine is offline   Reply With Quote
Reply

Tags
luna, opensim, voxels

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On