World procedural generation library
World procedural generation library
Hey !
I've been working on a cool open-source library project involving infinite, complex world procedural generation, and I'm looking for a community where I can share it
Since I'm using Irrlicht for rendering, I thought this forum was a good start !
The aim of the library is to generate a complex world with plenty of things (terrains, trees, bushes, rocks, biomes, clouds, buildings, dragons...) and then explore it in first person mode, or creating scenery or beautiful landscapes, maybe export them to files, and then use them in video games or 3D artworks... there is plenty of stuff you can do
Here are some visuals :
At the moment, I've only implemented the terrain and a tree generator. The lib implements a level of details features that enables to generate more details if needed.
I host the code on github ; https://github.com/BynaryCobweb/world/
You can see some (fake) example code in the "examples" folder, or in the irrlicht implementation ("modules/world3D").
Currently I'm doing a lot of work on it, that's why the most advanced version of the software isn't on "master".
I will publish a version as soon as I have fixed all the usability issues and done some bit refactoring
Don't hesitate to make suggestions ! It helps me a lot I'm also looking for other forums where I could share my library and get feedback on it !
Thank you
~Klayr~
I've been working on a cool open-source library project involving infinite, complex world procedural generation, and I'm looking for a community where I can share it
Since I'm using Irrlicht for rendering, I thought this forum was a good start !
The aim of the library is to generate a complex world with plenty of things (terrains, trees, bushes, rocks, biomes, clouds, buildings, dragons...) and then explore it in first person mode, or creating scenery or beautiful landscapes, maybe export them to files, and then use them in video games or 3D artworks... there is plenty of stuff you can do
Here are some visuals :
At the moment, I've only implemented the terrain and a tree generator. The lib implements a level of details features that enables to generate more details if needed.
I host the code on github ; https://github.com/BynaryCobweb/world/
You can see some (fake) example code in the "examples" folder, or in the irrlicht implementation ("modules/world3D").
Currently I'm doing a lot of work on it, that's why the most advanced version of the software isn't on "master".
I will publish a version as soon as I have fixed all the usability issues and done some bit refactoring
Don't hesitate to make suggestions ! It helps me a lot I'm also looking for other forums where I could share my library and get feedback on it !
Thank you
~Klayr~
Last edited by klayr on Tue Dec 04, 2018 12:17 am, edited 2 times in total.
Re: World procedural generation library
I could donate an old grass and foilage planter (multithreaded) if you want
Not much use because its not GPGPU but oh well...
P.S. unless you do your world generation using GPGPU it doesn't really have a use case anywhere in 2018-2020, even on mobile.
Not much use because its not GPGPU but oh well...
P.S. unless you do your world generation using GPGPU it doesn't really have a use case anywhere in 2018-2020, even on mobile.
Re: World procedural generation library
I'm interested in taking a look at itdevsh wrote:I could donate an old grass and foilage planter (multithreaded) if you want
Not much use because its not GPGPU but oh well...
The aim of my library is not to achieve things faster than the other ones, but to provide an extensive set of tools and a nice architecture so that generating a world procedurally becomes easy.devsh wrote:P.S. unless you do your world generation using GPGPU it doesn't really have a use case anywhere in 2018-2020, even on mobile.
However I will surely implement GPGPU components, even if I haven't done that yet
Re: World procedural generation library
Just don't spend too much time optimizing the CPU side of things.
CPU level of detail algorithms are painful to implement and optimize and basic transform feedback geometry/tessellation shader loops outperform them, and you end up throwing away your precious CPU code that took long to debug and pretty up in to the transh.
A cool approach to terrain rendering and editing is clip-maps, which are like Cascaded Shadow Maps but for terrain texturing (you could also possibly paint into them).
Essentially you replace a 2D texture with mipmaps by a 2D array texture where each layer is taken to be a part of a concentric mipmap chain (i.e. layer 0 is a 1024x1024 window into mipmap layer 0, layer 7 would be a a kinda 128kx128k window of the texture but of actual 1024x1024 textures), then you replace your textureLod(origTex,tc,lod) call with two calls to texture(arrayTex,vec3(tc,floor(lod))) and texture(arrayTex,vec3(tc,ceil(lod))) followed by manual interpolation to do the trilinear filtering by hand in your shader (anisotropic would require a bit more magic - but is possible from just 2 texture taps).
Then only issue s that you have to stream the data to the mipap layers as you walk in and out of areas, but with texture wrapping you only need to update new parts of the texture and there's no need to shift the entire content of the texture.
You can do this by using pixel unpack buffers or by rendering to the texture array.
Its essentially like idTech megatexture but without the complicated cache algorithm, and it lets you have insane ground texture resolutions, theoretically with a 1GB VRAM footprint you could have an effective resolution of 1 teratexel by 1 teratexel (enough to view a terrain the size of the earth with 1 pixel per mm).
Then you have the matter of of displacement mapping, your heightmap could also be stored the same way (although at lower overall resolution) and this is where the tessellation shader comes in, because your tessellated triangle size could be tied to the mip map level.
CPU level of detail algorithms are painful to implement and optimize and basic transform feedback geometry/tessellation shader loops outperform them, and you end up throwing away your precious CPU code that took long to debug and pretty up in to the transh.
A cool approach to terrain rendering and editing is clip-maps, which are like Cascaded Shadow Maps but for terrain texturing (you could also possibly paint into them).
Essentially you replace a 2D texture with mipmaps by a 2D array texture where each layer is taken to be a part of a concentric mipmap chain (i.e. layer 0 is a 1024x1024 window into mipmap layer 0, layer 7 would be a a kinda 128kx128k window of the texture but of actual 1024x1024 textures), then you replace your textureLod(origTex,tc,lod) call with two calls to texture(arrayTex,vec3(tc,floor(lod))) and texture(arrayTex,vec3(tc,ceil(lod))) followed by manual interpolation to do the trilinear filtering by hand in your shader (anisotropic would require a bit more magic - but is possible from just 2 texture taps).
Then only issue s that you have to stream the data to the mipap layers as you walk in and out of areas, but with texture wrapping you only need to update new parts of the texture and there's no need to shift the entire content of the texture.
You can do this by using pixel unpack buffers or by rendering to the texture array.
Its essentially like idTech megatexture but without the complicated cache algorithm, and it lets you have insane ground texture resolutions, theoretically with a 1GB VRAM footprint you could have an effective resolution of 1 teratexel by 1 teratexel (enough to view a terrain the size of the earth with 1 pixel per mm).
Then you have the matter of of displacement mapping, your heightmap could also be stored the same way (although at lower overall resolution) and this is where the tessellation shader comes in, because your tessellated triangle size could be tied to the mip map level.
Re: World procedural generation library
Thanks for your advices, I think I'm gonna look at that !
Do you think gpu programs are also suitable to generate assets without rendering them?
Do you think gpu programs are also suitable to generate assets without rendering them?
Re: World procedural generation library
Yes, totally but to use OpenGL to do that you need to instantiate a window (like our convert2BAW tool does).
However you could use OpenCL, CUDA or Vulkan if you really needed a headless tool for asset generation (I'd advise OpenCL because it would still run if you didnt have a GPU).
However you could use OpenCL, CUDA or Vulkan if you really needed a headless tool for asset generation (I'd advise OpenCL because it would still run if you didnt have a GPU).
Re: World procedural generation library
All right ! I think I'll use openCL, I've already dealt a little bit with it.
Do you know any nice PCG community over the web where I can ask for advices on the latest procedural generation technologies ? I don't want to develop a lot of algorithms and then discover that what I've done is completely obsolete
Do you know any nice PCG community over the web where I can ask for advices on the latest procedural generation technologies ? I don't want to develop a lot of algorithms and then discover that what I've done is completely obsolete
Re: World procedural generation library
Most of this sacred knowledge is in publications, so read that... alternatively there's always gamedev.net, but you'll always get 5 or so self-conflicting opinions and you'll end up having to straight to the source (pubs again).
There is value in open source implementation of those recent papers and bundling different techniques into a single framework.
There is value in open source implementation of those recent papers and bundling different techniques into a single framework.
Re: World procedural generation library
Yeah, but doing it alone is a big load of work, and I have a lot to learn in this domain !
For the first release I'll let alone the optimisation, so it will be slow and thus pretty uncomfortable to use, because the features are mainly CPU-based...
But then I may start implementing moderns algorithms, and it would be cool to not make 5 attempts that happens to be trash... And this will eventually happen if I work alone in my corner...
So I hope I find at least some people to check what I'm doing and give me some feedback.
Anyway, do you have any interesting publications about things I could implement for a start ? I googled for clip maps, but I found article from 2006 or so...
For the first release I'll let alone the optimisation, so it will be slow and thus pretty uncomfortable to use, because the features are mainly CPU-based...
But then I may start implementing moderns algorithms, and it would be cool to not make 5 attempts that happens to be trash... And this will eventually happen if I work alone in my corner...
So I hope I find at least some people to check what I'm doing and give me some feedback.
Anyway, do you have any interesting publications about things I could implement for a start ? I googled for clip maps, but I found article from 2006 or so...
Re: World procedural generation library
https://twvideo01.ubm-us.net/o1/vault/G ... on_and.pdf
http://drivenbynostalgia.com/files/Text ... dering.pdf
http://www.zib.de/hege/pdf/Clasen_2007- ... thesis.pdf
I'll upload my old grass generator to github when I have the time.
(It's multithreaded but with transform feedback you could make it GPGPU on GL 3.3 hardware)
http://drivenbynostalgia.com/files/Text ... dering.pdf
http://www.zib.de/hege/pdf/Clasen_2007- ... thesis.pdf
I'll upload my old grass generator to github when I have the time.
(It's multithreaded but with transform feedback you could make it GPGPU on GL 3.3 hardware)
Re: World procedural generation library
Here you go:
https://github.com/devshgraphicsprogram ... sGenerator
I didn't realize how old it was, almost 8 years!
It implements dithering of the vegetation map since you know... whether a plant is there or not is kinda binary.
https://github.com/devshgraphicsprogram ... sGenerator
I didn't realize how old it was, almost 8 years!
It implements dithering of the vegetation map since you know... whether a plant is there or not is kinda binary.
Re: World procedural generation library
Thank you, I'll take a look !