Wednesday, September 11, 2013

Better Look

Here's a better look at the Voxel Sandbox with the LoD off with an inlay:

Monday, September 9, 2013

Voxel Terrain Sector Preview

Got the basic voxel terrain in today.  The most time was spent on new ways to generate and enqueue Voxels, RenderMesh, PhysicsMesh in various worker threads and sync them amongst all the subsystems.  Also refactored some of the math library and noise generation while in there to avoid overlap.
Voxel Terrain Sectors 2x1x2

The scale of this image required me to adjust my camera... typical player could be about as big as a pixel here... going to hook this up to my biome and erosion simulation next.  That way flora and fauna will spawn with rivers and 'set piece' locations, and have some more high frequency details... I had some crazy stuff like ocean trenches prototyped, but who would ever see that?  Took out the randomized caves for now too as they should be created by the biome / erosion system.  The trick will be to convert it to density functions properly - eg account for overlapping terrain.  I don't think trees grow under ground.

This is just a 2x1x2 voxel terrain patch to get a sense of scale... I have mostly been testing with 6x2x6 and 9x3x9 for a complete world earlier.  It is all hooked up to script you can spawn more terrain as the player runs around until you run out of floating point sanity if you like.  

Memory overhead is super low at ~1/4 the size of the older heightmap generated terrain.  That said you could make worlds smaller than one walk cycle of animation or short sound clip by far still.  :D

Planning on adding real-time editor later that works by altering density in a selected Voxel Sector for artist controlled editing via terrain brush.  It would be nice to make it work with touchscreens via the web editor too in real-time, but not high on my list.  Elevation and Biome splat controller needs to come in next.  Maybe add some slope blending adjustments to the basic shader / materials too.  

The most fun will be allowing scripted density functions by exposing the native structs holding function pointers and args to script that run in the density summation as addends.  In other words alter the density functions from script ( data driven ) at any time not just alter the voxel field... well laters.  

Saturday, September 7, 2013

Isosurface Extraction done quick...

Cross post from Google+:

Voxels and Triplanar Mapping only took a day and a half thanks to the excellent docs from Nvidia and my awesome little engine that could. Going to work in real-time editing and maybe tessellation guided by isosurface extraction later if I don't get sidetracked with other big features. This is a CPU converted isosurface to standard mesh to use the CPU side physics. eg voxels -> mesh. Will be doing GPU side physics to use with noise based particles / fluid simulation at some point. Also GPU only is good for real-time editing.

BTW was using marching cubes for this, but I'm still toying with naive surface nets for low end mobile platforms as it's much less ploygon soup when done. Also with naive surface nets you can generate less dense CPU side physics meshes then render on GPU in higher detail.

I also tossed in a preview of a simple 2 texture triplanar 'cave' material for the same shader.

Here's the algorithms:

Chapter 1. Generating Complex Procedural Terrains Using the GPU

Polygonising a scalar field

Wednesday, August 21, 2013

Hey guys. It's been a long time since I posted anything about my engine kagura. I've started working on Physically-Based Lighting, and Clustered Deferred Shading with Forward+ will be the next big renderer change. Yes, I do enjoy rewriting my renderer fairly often it may seem. That's why I architected a plugable renderer! ;) First a screenshot of the latest alpha build with some horrible debug spew all over the place:

Currently I have Lambert with a Normalized Blinn-Phong enabled as I have stopped toying with the Oren-Nayar to get to some real business -- Removing the MDR system to replace with a standard HDR system with filmic tone mapping. 
Still using random assets from the web and what I can do with blender.  Really need to contract a professional artist do do a rigged character model with a walk cycle soon.




Also the editor has fully generic property mappings now.  This means you can bind script from native code or script to procedurally generate the UI on the target device such as a desktop webbrowser, nexus 7, or galaxy note in my case(s).  It's not pretty, but it gets the job done.  From native code this is how a bind looks:

KAEDITOR_PROPERTY_RANGE( "Exposure", 0.1, 4.0, mCamera->Exposure(), 0.01, Exposure ); This generates the JSON subpacket to be issued to the HTML5 editor when requested. This would look something like this for a full fresh:
"KaCameraComponent" : { "Properties" : [ { "name" : "Debug", "type" : "bool", "value" : 0, "script" : "$type.SetDebug( $instance, $value )" },{ "name" : "Culling", "type" : "bool", "value" : 1, "script" : "$type.SetVisbility( $instance, $value )" },{ "name" : "Field of View", "type" : "float", "value" : 60.000000, "script" : "$type.SetFieldOfView( $instance, $value )" },{ "name" : "Exposure", "type" : "range", "value" : { "min" : 0.100000, "max" : 4.000000, "value" : 2.000000, "step" : 0.010000 }, "script" : "$type.Exposure( $instance, $value )" },{ "name" : "Near", "type" : "float", "value" : 0.100000, "script" : "$type.SetClipNear( $instance, $value )" },{ "name" : "Far", "type" : "float", "value" : 12000.000000, "script" : "$type.SetClipFar( $instance, $value )" },{ "name" : "Clear Color", "type" : "color", "value" : [0.219000,0.219000,0.219000,1.000000], "script" : "$type.ClearColor( $instance, $value )" },... ] } }

This is then processed in javascript into HTML widgets with signals, updated values, and handlers. A preprocessor in javascript allows for Lua script expansion to save time yeilding something like this for the KaTelemetry callback ( html->js->lua on the remote host/game ) :
KaTelemetry( "KaCameraComponent.Exposure( KaGameObject.GetComponent( KaGameObject.FindByGuid( 0 ), "KaCameraComponent" ), 1.97 )" )

All this happens while you drag your exposure slider around. Yeah I decided to put in on the camera instead of in the Image Filter material while I was testing the tone mapping and linear color changes. This also allows for very complex scripting across the HTML editor and game host / remote server, but this is a simple example. I need to clean it up and optimize it, so I can do a full study and write-up at some point. :D

Friday, July 29, 2011

kagura update



Here's what she's looking like lately with the same data set seen many times. Using FXAA now since it's trendy. Will I have the lighting and AO in a working state for more than a week? Hopefully that'll all come together in a couple of months while working on the new editor. Might have to give up on using blender with the telemetry system after all due to workflow issues.

I should do a write-up on the telemetry system used for editing ( lights, materials, etc ) inside the webbrowser at a later date, however now I'm working on supporting more things with the telemetry system besides TTY / HTTP transport and may hold off until that's worth talking about.

Sunday, June 5, 2011

Cool!


I saw this on altdevblogaday a while back. Embedding a webserver in your game engine, and then using javascript on the webbrowser to visualize it.

Just tried it tonight... btw the tutorial is wrong in several parts of the examples from C to javascript to JSON, but it's the idea that counts. :D

Monday, July 19, 2010

Bon Odori test



I wanted to make a full O-Bon demo, but instead I just spawned some dynamic torches ( animated lights ) following a simple path like a particle system real quick. Need to fix lighting and visibility again new design new breakage. Hurts framerate to spew all the debug and error test each render command too.