Hello everyone,
I am working on a research project for my university and have been fiddling with Terragen for the past few months now. Admittedly, my project is quite weird and may not fit the software's standard usage: I am trying to generate a dataset of realistic pictures of Mars to train a neural network for terrain features detection.
I didn't want to spam the forum with beginner questions, and I think I now have a fair understanding of how Terragen works; still, I am now hitting big roadblocks on several fronts, and I hope you could help me solve them (or at least tell me if I am wasting my time trying to fit a square peg in a round hole!).
For a neural network to train successfully, you need to provide it with "solved" exercises: in this case, I need to give my NN standard pictures of terrain, but also those same pictures rendered differently in a way which explicits what the AI is supposed to look for. This is called a "ground truth". For example, if I were to train my network to detect rocks, I would give it images of this type:
Along with a ground truth of this type (this one I made by hand):
For this to work, I need to be able to render the scene with some elements in starkly different colors; if possible, with completely flat lighting, no shadows, no nothing. Just rocks in red and the rest in green.
Thus my first question: is this possible with Terragen? The closest I have gotten has been luminous surface shaders fed to my fake stones, but even then, no dice, there's still some (pretty!) shadowy effects.
Note that I
could still do this with post-treatment of the images and identifying which zones are more red than green or black. This is however not the case for more complicated data; namely, I would like to train my NN to identify slopes. Thus my next question: is it possible to give the terrain a gradient of color (say, from blue to green) which would represent its inclination? For example, flat parts of the ground would be blue, while parts at, let's say, a 45° angle would be green, and parts at 22.5° would be cyan. I think I can achieve an unprecise version of this effect by merging surface shaders with different slope conditions, but I would ideally prefer having a continuous spectrum of color... And if slopes are not possible, altitude (not relative to the normals but to the Y axis) would be a good compromise too. I have been trying to achieve those effects with getAltitude shaders and a few math functions to emulate a linear interpolation, but no dice so far...
And so those are my three questions:
- Are fully flat colours with not lighting achievable in Terragen?
- Can you colour terrain according to its slope in a linear manner, using the aforementioned flat lighting?
- Alternatively, is this possible in regards to the height of the terrain?
Apologies for the wall of text and for any mistakes in my English. Have a good day!