• Welcome to Dark Bit Factory & Gravity.
 

[PROCEDURAL] Cave (ps 2.0)

Started by hellfire, May 01, 2008

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

hellfire

Hi everybody,

here's an effect inspired by monkey, a winamp-plugin by Ryan Geiss.

Unlike the original, I wanted to give it a more "realistic" look with smoother surface, proper texturing and a more organic touch.
I already wanted to try this for years, but never really found time until yesterday.
The implementation was pretty straight forward, I did the geometry-generation (including parameter tweaking) yesterday evening and - 1st of may is holiday here :) - a *very* simple texture-generator with gui today.

So what it does is twirling a set of intersecting pipes into a volume (effectively a 64x64x128 grid) and generating the iso-surface using a marching cubes algorithm.
The shading is done by simple vertex-coloring using some kind of local ambient-occlusion approach - since I got the volume-grid anyway, I simply look for potential occluders in the vertex' surrounding.
Texturing is done using one simple generated 2D texture which is mapped from all three canonical axes and blended over at the cross-sections - which works pretty well as long as the texture has rather low contrast.
Since this is done at per-pixel-level it requires ps 2.0 to run (actually it *would* work with ps 1.1 but glsl doesn't really support those).
The texture itself is generated from a set of differently coloured and blended plasmaclouds (and looks like this).
When I have some spare time again, I will definetly try to improve it, as it still looks somewhat too ... generated.
But since this will probably not happen before the end of the challenge, I'm already posting it now.

I didn't go for much size-optimizing here, but then again it isn't actually big either.
At the moment the source is probably way too messy to be of any use, but if anyone is interested in details, I'm willingly telling.

Enjoy.


If, for whatever reason, it won't run on your machine, here is a video, too.
Also attached a shot of the current texture (downsampled, "actual size" is 2048x2048).
Challenge Trophies Won:

Clyde

Wow! Thats amazingly awesome. Welldone dude :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

rain_storm

Yeah very impressive beautiful textures, this is an awesome entry hellfire

Challenge Trophies Won:

Rbz

Really good one, well done  :cheers:
Challenge Trophies Won:

Voltage

Jeepers!  Great entry, this is fantastic.  Very professional. 

I like the geometry the most, although the textures and shading are funky too. 

Excuse me while I go and look up marching cubes....
Challenge Trophies Won:

va!n

@hellfire:
wow! its fucking great and kicking ass! :goodpost:
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Pixel_Outlaw

Marching cubes algorithm is now free for public implementation. There was a time when it was protected.

GREAT Work!
Challenge Trophies Won:

hellfire

Thanks for your appreciation!
At the moment it's a bit boring to look at, guess I should add some dynamic lighting or something...
I'm open to any ideas :)

A comprehensive article about marching cubes can be found here.
Patents aren't of much concern for uncommercial home-dev - at the end we're using mp3, too...
Challenge Trophies Won:

Optimus

Wow! Nice, very nice!!!
Challenge Trophies Won:

Shockwave

What can I say except it looks fabulous!
Thanks for entering the challenge and good luck with the voting, this will do well in the voting I think.
Shockwave ^ Codigos
Challenge Trophies Won:

mind

#10
damn, thats pretty damn funky :D good job

and speaking of beeing interested, i wouldnt mind taking a peek at your texture code.. those clouds look pretty nifty :)
Challenge Trophies Won:

hellfire

Quotei wouldnt mind taking a peek at your texture code..
Oh well, there's absolutely nothing special about that, except maybe that I'm working at 16bit-precision per channel, so I can mess with the levels without running into colour-banding.
The "cloud" is generated recursively:
starting from a flat (all 4 corners have equal colour) 0,0..512,512 image, a new point is created in the center which gets the average of the corner-colours plus/minus some randomness. The resulting four sub-images are then subdivided again until a 1x1 area is reached where the current colour is stored.
All the rest is just some histogram-equalization (of the simplest form), colouring and alpha-blending between layers.
Challenge Trophies Won:

mind

Quote from: hellfire on May 02, 2008
Quotei wouldnt mind taking a peek at your texture code..
Oh well, there's absolutely nothing special about that, except maybe that I'm working at 16bit-precision per channel, so I can mess with the levels without running into colour-banding.
The "cloud" is generated recursively:
starting from a flat (all 4 corners have equal colour) 0,0..512,512 image, a new point is created in the center which gets the average of the corner-colours plus/minus some randomness. The resulting four sub-images are then subdivided again until a 1x1 area is reached where the current colour is stored.
All the rest is just some histogram-equalization (of the simplest form), colouring and alpha-blending between layers.


ohh a normal recursive subdivision plasma :) it looked very different from those plasmas, but i guess its the histogram levels and blending used :)
Challenge Trophies Won:

Jim

Very nice indeed!
Jim
Challenge Trophies Won:

Dr_D

Wow. That's just... Wow.  :cheers:
The Dr. is INsane!!!

stormbringer

Fantastic indeed! Maybe it just misses a starship and some aliens to blast! Never saw a shoot'em up usin this.....
We once had a passion
It all seemed so right
So young and so eager
No end in sight
But now we are prisoners
In our own hearts
Nothing seems real
It's all torn apart

benny!

Awesome effect. Runs very smooth here!
Well done, hellfire!!!

Keep us informed with any new version you produce!


@Stormbringer:
That would be indeed interesting to see a game like
this. Remember DESCENT ?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

hellfire

#17
Since you asked, here's a different version ;D
Played a bit with light, color and texture - not exactly what I was looking for, but what the hell...
Now looks different every time you run it.
Challenge Trophies Won:

Rbz

Should it look like this image ???
Challenge Trophies Won:

hellfire

Err, well... no!
But to be honest I somewhat like that, too :)
What card is that?

Challenge Trophies Won: