Mythruna
March 28, 2024, 07:02:03 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to the new forums. See "Announcements" for a note for new users.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: March 2014 status...  (Read 82286 times)
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« on: March 31, 2014, 06:37:02 PM »

So, it's been a while since I've posted a status to the community so I felt one was overdue.

At the beginning of the month, my wife went out of town for her every other month "checkup from the neck-up".  The tumors are kind of still growing so they have put her on yet another medicine.  When she is out of town, I watch the kids and then we had the added benefit of her getting snowed in down there for an extra data.  Between that and all the stuff surrounding it, getting the house ready (on this new medicine it is even more important that she doesn't fall), dealing with the news, etc... there wasn't much time for Mythruna.  Between all of that and trying to keep up with "day job" work, I really didn't even want to sit in front of the computer anymore.

Back somewhere in 2003 or 2004, I did some work with what can loosely be called "isosurfaces".  A lot of the modern sandbox "voxel" games are using this approach to render their terrain.  Back then I was using it for data visualization.  We had lots of "fields" (think meta-balls http://en.wikipedia.org/wiki/Metaballs) and were drawing surfaces on those fields at some threshold.  Animated it looked kind of cool but we never did much with it other than skinning some data sets.

I've long had this sort of thing in the back of my mind as a potential way to deal with flowing water in Mythruna.  For the record, I'm pretty sure that it won't work but it's still been the top of my list for things to try.  Also, I have a directory where I keep design documents for "quick game ideas that might make me some money".  At least half of those could benefit from some kind of voxel/isosurface technique.

Many may remember that I played with doing photorealistic style terrain back in around 2006.  Actually that was my first playing around with jMonkeyEngine way back in its more primitive state.  Things were just frustrating and I ended up abandoning it... still, I do get a bit of "terrain envy" when I see all of these nice looking voxel terrain engines showing up.  I know a lot more about the subject now and was pretty sure I could throw something together quickly.

With Mythruna I made a conscious choice to make a block-world engine.  That's part of the whole aesthetic and I don't plan to change my mind on that but the theory was always that the "land is blocks" but everything else is more organic.  This is why trees are round, water wavy, animals and people will look regular, etc..  In my minds eye, I'd even like it if sand was smoother but I don't know that I will get there.  If I do, then isosurfaces are the way to achieve that.

Creative momentum is a funny thing.  When you are used to being obsessed with something and having that push you through it can be hard to stay motivated when you are "out of it".  If you swing the other way and have things actively pulling you away from the computer every day then it gets even harder.  If you add to that some aversion to sitting in front of the computer at all... you have a recipe for never getting anything done.  That's kind of where I was headed.  I needed a project to get the creative juices flowing.  Something to get back in the habit of coding like a banshee every time I say down at the computer.  Just nothing was really piquing my interest these days.

Anyway, two weeks ago or so I saw "yet another voxel terrain" engine show up, on the JME forums this time.  This kind of was the straw that broke the camel's back.  I thought "not only will I create a voxel terrain engine... but I will open source it making sure that the market gets flooded with them and block worlds are unique again..."  There may have even been a maniacal laugh in there somewhere. Wink  But seriously, I do plan to open source this piece... it's not directly related to the Mythruna engine but the improvements people contribute there will directly benefit my engine.

I'd read chapter one of GPU Gems about 10 times before: http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html  It's got a nice compact technique (designed for GPUs actually) for generating terrain.  This has long been on my to-do list to try out so a day or so later I had something cobbled together.

First, the fractal implementation they were using needed to be adapted and I wanted to visualize it before going through the work of surfacing it... so I just plopped down a bunch of point sprites:


Then the initial mesh implementation: (easier to test with lines than triangles)


Proper surface normal calculation: (little red lines are pointing in the surface normal direction)


Proper triangles and lighting:


I wanted to see what it would look like with a glass material (water is still in the back of my mind after all):


Now the fun part, basic triplanar texture mapping from the GPU gems article:


And finally, some of my own enhancements to give the grass more defined borders and also add multiresolution layering of the textures:


Adding in some JME post-processing filters and it really starts to look like something:


...personally I think that pic is really beautiful even without grass or trees.  Never mind that there is grass growing underwater.  It's not important. Smiley

Here is a video.  Be sure to watch on HD:
https://www.youtube.com/watch?v=MabpkOVLF3c

I'll even do one better.  Here is a demo you can download:
http://mythruna.com/temp/IsoSurface/IsoSurfaceDemo-Windows.zip
http://mythruna.com/temp/IsoSurface/IsoSurfaceDemo-Linux.zip
http://mythruna.com/temp/IsoSurface/IsoSurfaceDemo-MacOSX.zip

Most likely... if you have trouble running Mythruna then this may give you issues.  With all options on, it hammers the snot out of my graphics card.

Controls:
-space bar toggles between camera and mouse cursor.  (ie: hit the space bar to be able to click on stuff, space again to go back to flying)
-WASD moves
-mouse looks
-left shift runs (10 m/sec)
-left shift + control runs really fast (20 m/sec)
-F3 toggles the HUD
-F5 toggles the stats display
-SysReq/Prt Scr takes a screen shot

On the HUD, if you click on the section titles it will collapse/expand the section.  The little orb on the right side of the section titles turns the effect on/off.  (See video.)

By default, I've turned many of the effects off because they seem to cause issue on some computers.  (Bugs in some JME code.)

I want to stress again that I will not be turning Mythruna into a voxel engine... but I do hope to use this technique for some things in the engine (perhaps crafting if nothing else).

Still, it's a fun little side project, may lead to some simple games I can throw onto a store somewhere, and it gets the creative juices flowing again.  I'm even kind of excited to get back to the more boring things I was working on deep in Mythruna.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #1 on: March 31, 2014, 06:38:16 PM »

P.S.: I find it immensely fun to fly really close to the ground holding shift+ctrl... especially trying to stay in the valleys and go through open caves and overhangs.... without 'crashing'.

...which is good because one of the initial simple game ideas I had was some kind of speeder/hover bike racing game.  I just need lot so big trees. Smiley
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #2 on: March 31, 2014, 07:58:31 PM »

Lol, thanks for the progress update, and I saw this video a few days ago before you posted this. Smiley

I'm still praying for your wife, Paul.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #3 on: March 31, 2014, 08:16:51 PM »

Lol, thanks for the progress update, and I saw this video a few days ago before you posted this. Smiley

I'm still praying for your wife, Paul.

Thanks.

And now you should be able to try the demo out for yourself instead of being forced just to watch. Smiley
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #4 on: April 01, 2014, 01:38:50 PM »

graphics stuff like this never cease to amaze me  Smiley its just so awesome how we can do that. Usually when i want a scenic game i play Just Cause 2 multiplayer mod. You can do the crazy stuff everyone does, or you can spawn a motorcycle and calmly ride through the mountains and by the coast. So breathtaking, that world on full graphics. Even not on full graphics its good.

Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #5 on: April 01, 2014, 03:50:09 PM »

graphics stuff like this never cease to amaze me  Smiley its just so awesome how we can do that. Usually when i want a scenic game i play Just Cause 2 multiplayer mod. You can do the crazy stuff everyone does, or you can spawn a motorcycle and calmly ride through the mountains and by the coast. So breathtaking, that world on full graphics. Even not on full graphics its good.



Very pretty.  I would love to be able to get my little iso engine close to that... not the kind of thing I can easily do over a quick weekend here and there, though. Smiley

Still, fixing water to look better and adding some atmospherics would go a long way.
Logged
Moonkey
Hero Member
*****
Posts: 1587

This is probably a picture.


View Profile
« Reply #6 on: April 03, 2014, 03:20:09 AM »

That looks beautiful. Metaballs are a good way to go Cheesy
Logged

Mythruna: Don't you dare read any posts I made before 2014.
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #7 on: April 03, 2014, 07:10:49 PM »

Wait... do I see Paul thinking about upgrading his engine!? He's probably going to have to, because every other Voxel game is. And what is this I hear about the water? I thought you weren't going to make water out of blocks....
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #8 on: April 03, 2014, 08:58:17 PM »

With Mythruna I made a conscious choice to make a block-world engine.  That's part of the whole aesthetic and I don't plan to change my mind on that but the theory was always that the "land is blocks" but everything else is more organic.  This is why trees are round, water wavy, animals and people will look regular, etc..  In my minds eye, I'd even like it if sand was smoother but I don't know that I will get there.  If I do, then isosurfaces are the way to achieve that.

And what about my post indicates that I'm doing water as blocks?  In fact, the entire point is to do something more organically shaped.

Water will still have to be voxel based on some level... even massive water simulations simulate water particles.
Logged
Michael
Donators
Hero Member
***
Posts: 2166



View Profile
« Reply #9 on: April 04, 2014, 03:28:02 PM »

I wonder, how are the texture applies across so many polygons? Does it take a single texture, and stretch it along making it fit nicely, and probably repeats?
Logged
Teknonick
Sr. Member
****
Posts: 438


View Profile
« Reply #10 on: April 04, 2014, 07:45:54 PM »

I mean, Paul, by blocks I mean voxel-placed. If you've played Minecraft's Finite Liquid Mod, then that's kind of what I thought you decided you are heading for. I was originally thinking you were going to be making water more like 'entities' and such... but I wasn't quiet sure how that would work. Either way, as long as it's better than Minecraft (Or not), I'm in for it. Wink
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #11 on: April 04, 2014, 11:26:45 PM »

I wonder, how are the texture applies across so many polygons? Does it take a single texture, and stretch it along making it fit nicely, and probably repeats?

It's... complicated.

First, depending on the surface normal, three different textures are mixed together using different planar axes.  Basically, they use the world coordinates.  So up (x,z) is mixed with east/west (zy) is mixed with north/south (xy) depending on how much it points in any of those directions.

But each plane is double sampled.  So, given the x,y world location, for example, that coordinate is used on a larger scale texture and mixed with one at higher repeat.  But both of the coordinates are warped in a fractal so the repetition is less apparent (many cases you can't see repetition at all).  If you run the demo you can see that that textures get more detailed as you get closer.  The mixing of large scale to small scale is done based on distance.

There is also some funky stuff with normals pointing up where I threshold (and run that through fractal noise also) to get the hard edges around the grass.  That part was quite tricky... and I will need to modify it to handle beaches/silt at the water line at some point.

Trees and grass first, though.
Logged
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #12 on: April 04, 2014, 11:28:50 PM »

Incidentally... the dirt texture I used is Mythruna's dirt texture.  I use a different bump map and the fractal warping makes it less obvious that it is the same.
Logged
belgariad87
Donators
Hero Member
***
Posts: 507


RPG player for life


View Profile
« Reply #13 on: April 06, 2014, 01:20:54 PM »

i swear, one of these days when i'm trying to make a game, I'm just gonna comb through all the techinical knowledge you've handed out, Paul. you could write a book.
Logged

Specs for future reference:
Windows 7 64bit ; Intel Quad Core ; 8GB RAM ; AMD Radeon HD 6800 ; TB HD
pspeed
Administrator
Hero Member
*****
Posts: 5612



View Profile
« Reply #14 on: April 06, 2014, 01:32:56 PM »

i swear, one of these days when i'm trying to make a game, I'm just gonna comb through all the techinical knowledge you've handed out, Paul. you could write a book.

Smiley  Thanks.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!