Procedural Object Populator Shader?

Started by PabloMack, March 02, 2013, 11:17:53 AM

Previous topic - Next topic

PabloMack

My focus has been to see what I can do in Terragen only on a global scale. I have been experimenting and getting pleasing results from the "Fake Stones Shader" fractal generator. My mind has been going wild imagining what I could do if there was a shader that was a procedural populator to place variations of an object of my choosing, especially plants, planet-wide on its surface. The procedural would use noise to decide where to place an instance of the object of choice much as the Fake Stones Shader does with rocks. Of course its node would need to have some controls especially density and variation such as size and maturity. Have you guys at Planetside given much thought about implementing such a thing? If the software had this then the potential of Terragen would launch into orbit. If there is already a way to do this, I would like to know. Perhaps there is already a plugin.

Of course, when placing plants on a global scale, there is a general rule in climate/ecology to consider. Species ranges would tougue-out much as do sedimentary formations in geology but the rule is much simpler than that. This is taken from Wikipedia:

"Therefore, moving up 100 meters on a mountain is roughly equivalent to moving 80 kilometers (45 miles or 0.75° of latitude) towards the pole."

Of course this effect doesn't much kick in until you get beyond the tropic lines (i.e. north of Tropic of Cancer or south of Tropic of Capricorn). One could use a trig function that might do a better job relating sine of the angle above/below the equator to lowering the "life zone" of the species as you go toward the poles.

jo

Hi,

There is the Populator node. There is a guide for using it here:

http://www.planetside.co.uk/wiki/index.php?title=Populator_Guide

and the reference for the node is here:

http://www.planetside.co.uk/wiki/index.php?title=Populator_v3

I'm pretty sure that does most of what you want it to do.

Regards,

Jo


Oshyan

Realistic plant density combined with global scale (the latter in particular) is going to be your big issue here. I believe there are systems that dynamically "populate" instances that can handle this, in realtime engines, but I'm not aware of any software like Terragen that can actually explicitly populate/instance objects on a global scale. I've gone up to nearly 17 million objects, at a low-orbit view, but that was already pushing the limit of 12GB of RAM, and the density from the ground would not have been anywhere near sufficient. http://planetside.co.uk/index.php?option=com_content&view=article&id=2:23-released&catid=7:news
Basically, right now you need to keep the entire population in memory, so the more instances, the more memory is needed. If you have e.g. 32GB of RAM you *might* be able to do a single population planet-wide at a semi-realistic density. Literally billions of instances. It would take probably 24 hours just to populate. I honestly don't think it's worth it. It's nice to be able to explore randomly generated and plant-populated areas on a planet, but since the vast majority of the planet will never be visited, it's kind of a waste of resources. One idea then would be to use "clip to camera" on your populator(s); they would end up smaller but still take ages to calculate, I think.

Honestly if you want to play with something like this, the realtime engines might serve you better, though of course ultimate render quality will not be as high. Examples include Outerra and Unigen.

- Oshyan

PabloMack

#3
I have something of an understanding of the way your current populator works. It has to explicitly store instances of the object. As you say, this takes a lot of memory to explicitly populate and store them. On the other hand, the Fake Stones Shader doesn't have to store instances of stones. It uses a fractal generator with noise, some logic and controlling constraints to decide where each stone is, how big it is etc. The planet I have been working on the past few days probably has many billions of stones lying on its surface (perhaps trillions). These are not stored but computed using procedurals. I am suggesting extending this technique to loadable objects. My post is a request for a future feature. I guess I should have been more clear about that. If I could replace each fake stone with a plant of my choice, I would pretty much have what I am talking about. Of course, objects need to be automatically aligned to normal and such things as that. Perhaps a rule that decides on the probability of their heading. The Fake Stones Shader already has some useful controls such as density and slope minium/maximum etc. I do not need to have the ability to individually reposition and tweak objects generated this way. But there does need to be some reasonable rules to control where and how they appear.

Thanks for the information, though. I will do some more research.

Oshyan

The Fake Stones shader is not populating objects though, it works using the displacement system that already works well planet-wide. So while that fact doesn't change the nature of your feature request, it does mean that the technology to make it possible is not already in Terragen as you had thought, and so it would certainly take more work to develop than to simply adapt an already existing feature.

- Oshyan

Tangled-Universe

Quote from: Oshyan on March 03, 2013, 12:17:13 AM
The Fake Stones shader is not populating objects though, it works using the displacement system that already works well planet-wide. So while that fact doesn't change the nature of your feature request, it does mean that the technology to make it possible is not already in Terragen as you had thought, and so it would certainly take more work to develop than to simply adapt an already existing feature.

- Oshyan

Honestly I think it could be better to say it's unfeasible to have such features in the future?
The way I read this feature request is to have a system pretty similar to Inigo Quilez' procedural vegetation system which he created for Pixar's Brave.
There vegetation isn't made up my imported models, but only consist of code and sets of rules where each of type of vegetation is allowed to grow.
It's an extremely impressive succesful effort, but seeing this in TG2? I don't see that happen or even see it's reasonable to expect.

Oshyan

Wow, Inigo did that stuff? I had no idea, hehe. Awesome.

Yes, I think you're right that what is being requested is pretty unrealistic. Perhaps I should have been more clear that such a feature is unlikely to be included any time in the foreseeable future. The cost/benefit ratio is just not good enough as it would take significant work to make it a reality, and the number of users who actually need it is fairly low (most people work with specific scenes in mind, a "set" if you will, even if the "set" is a giant mountain range).

- Oshyan