Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Ayumi, AndrewAMD), 833 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Gallery
Next Gallery
Print Thread
Rating: 5
Page 2 of 2 1 2
Procedural generated ...'ähm'.... things #206065
05/11/08 00:16
05/11/08 00:16
8 Images
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline OP
Serious User
Procedural generated ...'ähm'.... things

Can't you see the beauty, Emo. There are millions of world which you even can't imagine. Just go through the portal of insanity, Emo, and you can go everywhere, EVERYWHERE Emo! Believe me.



More screenshots: http://swollen-eyeballs.org/terrain/

All worlds are procedural generated in a few seconds, including calculating ambient occlusion. If you wan't to program something similar search for "marching cubes".
All shots are taken on:
Pentium D 820 2*2.8GHz
1GB Ram
Geforce 6600GT
19 Comments
Re: Procedural generated ...'ähm'.... things [Re: PHeMoX] #206357
05/13/08 06:38
05/13/08 06:38
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
i like that very much! may i ask how to learn to create meshes with lite-c and use them for further stuff (e.g. collision detection).

Re: Procedural generated ...'ähm'.... things [Re: ChrisB] #206519
05/14/08 00:10
05/14/08 00:10
Joined: Sep 2003
Posts: 3,236
San Diego, CA
M
Marco_Grubert Offline
Expert
Marco_Grubert  Offline
Expert
M

Joined: Sep 2003
Posts: 3,236
San Diego, CA
Originally Posted By: ChrisB
If you wan't to program something similar search for "marching cubes".
But marching cubes only does the triangle conversion. What did you use to generate your field in the first place?
Can a vertex shader access 3d texel values? In that case it could be done on the GPU.

Re: Procedural generated ...'ähm'.... things [Re: Marco_Grubert] #206521
05/14/08 01:20
05/14/08 01:20
Joined: Jul 2006
Posts: 503
Australia
A
adoado Offline

User
adoado  Offline

User
A

Joined: Jul 2006
Posts: 503
Australia
In GPU Gems 3 there is a chapter on realtime terrain generation on the GPU using a 3d grid like system with the new Geometry shader. But I guess this is a CPU version as the card is a 6600..

This cannot be done easily on 3dgs though can it, we need access to the vertex data?

Edit: With Lite-C we can uses D3D so maybe it is possible ^^

Looks amazing though wink laugh

Thanks,
Adoado ^^

Last edited by adoado; 05/14/08 01:21.
Re: Procedural generated ...'ähm'.... things [Re: adoado] #206737
05/15/08 11:09
05/15/08 11:09
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
how do you generate seamless uv coordinates? is this some kind of unwrapping or do you use a procedural approach?

Re: Procedural generated ...'ähm'.... things [Re: Joey] #206833
05/15/08 23:02
05/15/08 23:02
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline OP
Serious User
ChrisB  Offline OP
Serious User

Joined: Sep 2002
Posts: 1,604
Deutschland
Thanks for all the comments.
Some explanations:
I split the whole scene which is to be generated into smaller tiles (typically 64*64*64), this saves memory (the memory used for creation stays constant, no matter how big your scene will be) and its easier to use several threads to speed things up (but every thread must has its own temporary memory for generation, so this could be a big problem, you can solve that if you use smaller tiles (which are slower though)).
So next is to create the density map for one part, these are double the size of the part (128*128*128) to prevent visible edges between the parts caused by wrong normals and occlusion term. Creating one takes around 50ms. Actually this map are 128 floating points textures which are filled with a shader, and then copied back to an array (faster then doing everything on the cpu). The densitymap specify which parts of the scene is rock (positive values) or air (negative values).
I'm using 4 64*64*64pixel noise 3d textures (filled with rand()s) which gets combined at several different frequencies and amplitudes to form the scene, but you can also encode your own worlds in the shader like planets, or a helix or...

On this map i run the marching cube algorithmus which creates the polygons. Normals and ambient occlusion term gets also calculated. This takes 500ms-2sec (depending on how many polygons needs to be created and if ambient occlusion is calculated)
After this there is also the possibility to generate several LOD meshes.

Quote:
Can you bake the ambient occlusion into the texture?

No, it is saved per vertex at the moment and i don't want to unwrap this meshes. wink
Quote:
how do you generate seamless uv coordinates? is this some kind of unwrapping or do you use a procedural approach?

Its samples the texture 3 times (with XY, YZ, XZ world coordinates) and blend these according to the surface normal.

60fps means ~500k textured polygons on my PC, which i think is enough for a decent terrain wink.

Some numbers:
Memoryconsumption
1 thread: 350mb
2 threads: 570mb
4 threads: 900mb
Creation time of the babel tower:
1 thread: 16 sec
2 threads: 10,9 sec
4 threads: 10,7 sec

i think i will release a sample demo with the tower level (i like that one), but first i will try i could get some nice clouds around it and i must find a way to get collision with these meshs (any idea?)

http://swollen-eyeballs.org/terrain/babel_00.jpg
http://swollen-eyeballs.org/terrain/babel_01.jpg
http://swollen-eyeballs.org/terrain/babel_02.jpg


www.Swollen-Eyeballs.org
ICQ:169213431
#3dgs@quakenet
Re: Procedural generated ...'ähm'.... things [Re: ChrisB] #206874
05/16/08 09:07
05/16/08 09:07
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
thanks a lot, i never thought about splitting the volume. do you use cuda or plain c++ with directx?

Re: Procedural generated ...'ähm'.... things [Re: Joey] #208693
05/28/08 20:58
05/28/08 20:58
Joined: May 2008
Posts: 1
S
sometaffer Offline
Guest
sometaffer  Offline
Guest
S

Joined: May 2008
Posts: 1
it's kind of a late notice, but there's a Procedural Generation Competition going on at TIGSource Forums

Entries are due June 2. Almost everyone makes 2d games, but they DO allow 3d games. It would be nice if some Gamestudio user whips up a 3d procedurally generated game for this contest.

Re: Procedural generated ...'ähm'.... things [Re: sometaffer] #210584
06/11/08 16:42
06/11/08 16:42
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
jay. i've also implemented the marching cubes algorithm, my version is running on the cpu only. and i've got clouds... i must ask wether or not i may post an image of it.

another question, though: are you creating a volume texture and passing it to a pixel shader to generate the random values?

and i *think* you're using an optimized version of the standard marching cubes algorithm, or are you outputting vertices on all edges? i think not because you to have gouraud shading working on the mesh. do you know the book gpu gems 3?

joey.

Re: Procedural generated ...'ähm'.... things [Re: Joey] #212501
06/22/08 16:45
06/22/08 16:45
Joined: Sep 2002
Posts: 1,604
Deutschland
ChrisB Offline OP
Serious User
ChrisB  Offline OP
Serious User

Joined: Sep 2002
Posts: 1,604
Deutschland
Originally Posted By: Joey
jay. i've also implemented the marching cubes algorithm, my version is running on the cpu only. and i've got clouds... i must ask wether or not i may post an image of it.

another question, though: are you creating a volume texture and passing it to a pixel shader to generate the random values?

and i *think* you're using an optimized version of the standard marching cubes algorithm, or are you outputting vertices on all edges? i think not because you to have gouraud shading working on the mesh. do you know the book gpu gems 3?

joey.

Yeah post your images, maybe we can help each other to create a really fast version.
I'm filling the volume texture on the cpu with rand()s.
I'm saving each created vertex in an extra array, before I create a new vertex I test if there is already a vertex at this position in the array, if so i use the Index of this vertex for the Triangle.
Yeah i know the article in the book, but i only deals with DirectX10 cards.
I've found this article: http://www.mpi-inf.mpg.de/~gziegler/hpmarcher/techreport_histopyramid_isosurface.pdf
According there table there method is 2times faster then my implementation, so i might give it a try.


www.Swollen-Eyeballs.org
ICQ:169213431
#3dgs@quakenet
Re: Procedural generated ...'ähm'.... things [Re: PHeMoX] #212599
06/23/08 10:34
06/23/08 10:34
Joined: Jun 2008
Posts: 30
Russia\Georgia
VoroneTZ Offline
Newbie
VoroneTZ  Offline
Newbie

Joined: Jun 2008
Posts: 30
Russia\Georgia
It`s a cool!

Page 2 of 2 1 2

Moderated by  jcl, Realspawn, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1