Planetside Software Forums

General => Image Sharing => Topic started by: blattacker on June 20, 2019, 04:17:29 AM

Title: Advanced Coloring Techniques?
Post by: blattacker on June 20, 2019, 04:17:29 AM
Hey there! So I've been working in Terragen on and off for around 6 or 7 years, I think, but I want to start taking it a bit more seriously. To that end, I was wondering if anyone had any pointers, or links to references/tutorials on more advanced/realistic shader techniques? I've included my latest project as kind of a reference of where I'm at now (there's clouds in the final project, but they were left out on this render for faster times, I'm working with a computer that was built in 2009). Most of my current technique is just several surface layers of a base color, then child layers for each individual component with variations on the color. I'm starting to work a bit more with different masks, but it's not immediately clear how to get the result I want.

I build my heightmaps in World Machine, export (in this case at 16k) to a .ter file, then bring it in to Terragen.
Title: Re: Advanced Coloring Techniques?
Post by: blattacker on June 20, 2019, 04:51:26 AM
A quick search has taught me about the use of the Color Function input on nodes, which has been very helpful, and probably a bit obvious. Are there any other functions that may be obvious to people who know what they're looking for, but maybe a bit less obvious to those who've only casually played around with the program?
Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 20, 2019, 03:47:51 PM
You pretty much got it all. You can also create "difference" colours with a merge shader, which can give you different levels of complementary colours to your mix.

Here I've attached a basic example of some complex colour shading in Terragen.

Additionally take a look through my Stratified Rock Colours TGC.
Title: Re: Advanced Coloring Techniques?
Post by: Oshyan on June 21, 2019, 03:36:28 PM
Take a look at the Resources page on our website as well as the Free Downloads for examples to look at, take apart, and understand. Also the GeekAtPlay tutorials (on the Resources page as well).
https://planetside.co.uk/terragen-resources/
https://planetside.co.uk/free-downloads/

- Oshyan
Title: Re: Advanced Coloring Techniques?
Post by: blattacker on June 23, 2019, 06:27:40 AM
Oshyan: The resources page I'd seen, though I haven't quite finished going through them. I can't believe I didn't know about the free downloads page though, I'll have a ton of fun picking apart some of those files!

WASasquatch: I'll have to check those out, definitely! The merge shader is a new one for me, so I'm excited to see how that one works!

I'm not gonna lie, when I first started doing 3D in general, even before Terragen, I hated node-based systems, but the more I use Terragen, the more I wish everything was node-based!
Title: Re: Advanced Coloring Techniques?
Post by: René on June 23, 2019, 08:01:16 AM
The easiest way for me is to create patches for each texture group which is easy to visualize via the test color in the surface shader. You can divide these patches into subpatches if necessary. A masked color adjust shader at the end of the shader tree can provide even more variation. Distort by normal in the power fractal shader makes the textures even more complex but this requires some experimentation to get a feel for it.
The attached example is over the top but shows what is possible in this way.

Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 23, 2019, 12:32:20 PM
Thanks for sharing some wisdom Rene. Nice surfaces distribution.
Title: Re: Advanced Coloring Techniques?
Post by: René on June 23, 2019, 03:35:19 PM
I forgot to mention that distort by normal can really work wonders if you use it wisely. Set color roughness low to 1 or 0 and the power fractal conforms to the previous displacements.
Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 23, 2019, 04:30:29 PM
That's how you are doing the colour working with lateral displacement! Great share thanks!
Title: Re: Advanced Coloring Techniques?
Post by: René on June 24, 2019, 03:08:42 AM
Usually I feed the power fractal through a tranform shader, 'use world space' enabled.
Title: Re: Advanced Coloring Techniques?
Post by: bobbystahr on June 24, 2019, 08:21:28 AM
Brilliant solve there René...noted....
Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 25, 2019, 05:30:12 PM
Been playing around with the technique a bit, and it is a bit of a trial and error getting scale of normal right without things looking too broken up, but can make for really interesting shading.
Title: Re: Advanced Coloring Techniques?
Post by: René on June 26, 2019, 09:02:51 AM
You're on the right track, by the looks of it.  High values of roughness and distord by normal only result in shapeless noise; it depends on the size of the power fractal and the underlying structures. It is indeed trial and error. The only downside is that it sometimes gives the appearance of glossiness in places where you wouldn't expect that.
Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 26, 2019, 12:31:11 PM
Quote from: René on June 26, 2019, 09:02:51 AM
You're on the right track, by the looks of it.  High values of roughness and distord by normal only result in shapeless noise; it depends on the size of the power fractal and the underlying structures. It is indeed trial and error. The only downside is that it sometimes gives the appearance of glossiness in places where you wouldn't expect that.

Yeah, sun angle kinda influences the effect a bit too. At the wrong angle (like in my scene) the sun is facing the plaster-like brown roughness, which like you said, almost looks like highlights rather than texturing. Looks good in shadow though--

Additional advise, you can also "target" influence your PFs by feeding their main input different aspects of your terrain geometry down the chain. For example, if your final lateral displacement have too much detail, you can use underlying shape geometry before detailing.

If you use colour shading like I do with functions, you won't have to worry about displacement feeding through your colour chain into the child node, or you can just feed into the Surface Layer colour tab. The distort by normal will now follow the displacement you fed it in all your PFs. This can also be used for masks. When using as a mask, it seemns to effect the noise with lots of half tones, black, and some white, giving you a great mixing mask where half-tones will be semi-transparent allowing extra detail from down the line to show through and not be completely masked.
Title: Re: Advanced Coloring Techniques?
Post by: René on June 27, 2019, 05:17:38 AM
And it's also a great way to distribute vegetation – real or fake – in interesting ways.
Title: Re: Advanced Coloring Techniques?
Post by: René on June 27, 2019, 08:56:12 AM
Forgot to post the TGD of the previous post.
Title: Re: Advanced Coloring Techniques?
Post by: bobbystahr on June 27, 2019, 07:55:53 PM
Quote from: René on June 27, 2019, 08:56:12 AM
Forgot to post the TGD of the previous post.

thanks...will be handy.
Title: Re: Advanced Coloring Techniques?
Post by: Dune on June 28, 2019, 01:10:57 AM
Adding a bit more info to René's file; there's actually no need for the compute fed into Power fractal shader v3 01, and neither for displacement in that PF. Outcome is the same and it only seems more complicated.
Title: Re: Advanced Coloring Techniques?
Post by: René on June 28, 2019, 02:55:58 AM
Indeed, and it renders slightly faster.
Title: Re: Advanced Coloring Techniques?
Post by: Dune on June 28, 2019, 09:23:15 AM
Yes, and that's why I also strive to not use any compute terrain. But not always possible, like in your file.
Title: Re: Advanced Coloring Techniques?
Post by: bobbystahr on June 28, 2019, 10:33:14 AM
Quote from: Dune on June 28, 2019, 09:23:15 AM
Yes, and that's why I also strive to not use any compute terrain. But not always possible, like in your file.

I almost never add Compute Terrain except at the bottom of the shader stack to have a landing spot for populations that takes into consideration all displacements after the Terrain editor.
Title: Re: Advanced Coloring Techniques?
Post by: Dune on June 28, 2019, 11:48:13 AM
On a loose line, I hope!
Title: Re: Advanced Coloring Techniques?
Post by: bobbystahr on June 28, 2019, 12:23:34 PM
Quote from: Dune on June 28, 2019, 11:48:13 AM
On a loose line, I hope!

yup a dangler, I think you turned me on to this valuable tip.
Title: Re: Advanced Coloring Techniques?
Post by: WAS on June 28, 2019, 03:14:24 PM
Quote from: bobbystahr on June 28, 2019, 10:33:14 AM
Quote from: Dune on June 28, 2019, 09:23:15 AM
Yes, and that's why I also strive to not use any compute terrain. But not always possible, like in your file.

I almost never add Compute Terrain except at the bottom of the shader stack to have a landing spot for populations that takes into consideration all displacements after the Terrain editor.

I always use a compute terrain since I'm always doing lateral work. Even on a shader level I tend to use compute normal for additional lateral/normalizing work. An example would be the Power Sand Shader, just using a PF with noise set to Billow, and uniform settings, than a compute normal at 0.001 or what is appropriate for your scale, and than a duplicated PF, same settings, except using a small offset of 0.005 or so with some displacement for detail, and boom, dense sand grains/gravel without fiddling with exploded fake stones.

For populations, I also use a Compute Normal, as it's default patch size is 1, and more appropriate for populations, such as grass and leaning to terrain normals.
Title: Re: Advanced Coloring Techniques?
Post by: blattacker on July 15, 2019, 11:01:30 PM
So I've been hard at work, checking out tutorials and files and such, and this is about where I'm at now (smaller image file for quicker renders), and I have a few questions.

So far for strata layer coloring, I've been using the strata and outcrops shader piped into a displacement shader to vector node, and using that as a mask to define where the texture is applied. I did recently discover the contour shader, which I've found can be used to create the same effect without the use of the conversion node in the mix. However, with both methods, when trying to warp the mask to give slight variations to the layers (or at the very least, make it less of a hard, obviously digital, line), the nodes do not seem to respond to any kind of warping or transforming. Does anyone have any tips or explanations on this? I've even tried just putting a fractal warp node as the final shader, and it seems to affect every other shader in the tree, but not the contour or strata/outcrops shaders. Is there something I'm missing, or just not understanding about this process?

In a similar vein, I'm using World Machine to create the heightmaps for my images; is there any way that anyone knows of to have Terragen "see" the terraces that are output and color them accordingly, or am I stuck with using max/min slope constraints? I can't seem to find a way in World Machine to just output a heightmap/mask of just the terrace slopes.

I thought I had more questions, but I guess that's all I can think of for now. Thanks for everyone's help so far, and I look forward to more input!
Title: Re: Advanced Coloring Techniques?
Post by: Matt on July 21, 2019, 06:13:54 PM
Contours are derived from the shape of the terrain. They are not based on texture coordinates, and that's the reason they can't be warped. I was thinking you might be able to work around that by adding more displacements after the Compute Terrain, but I tried and unfortunately that doesn't work either.

Something you could try is a stretched fractal. Fractals with XYZ stretch factors of something like (100, 1, 100) should work. And with less extreme values like (10, 1, 10) you can get lots of variation across the landscape. Additional displacements applied after the Compute Terrain will displace these patterns because they will stick to the 3D texture space generated by the Compute Terrain. And if you want to warp them separately you can do that with a Warp Input Shader or Warp Merge Shader whose "warper" is some displacement. The Fractal Warp Shader probably won't help much because it warps laterally, when I guess you want to warp it vertically, so just warp it with a fractal displacement which will apply along the normal by default (although you might want to try changing that to Along Vertical).

Matt
Title: Re: Advanced Coloring Techniques?
Post by: WAS on July 21, 2019, 06:33:25 PM
Quote from: Matt on July 21, 2019, 06:13:54 PM
Contours are derived from the shape of the terrain. They are not based on texture coordinates, and that's the reason they can't be warped. I was thinking you might be able to work around that by adding more displacements after the Compute Terrain, but I tried and unfortunately that doesn't work either.

Something you could try is a stretched fractal. Fractals with XYZ stretch factors of something like (100, 1, 100) should work. And with less extreme values like (10, 1, 10) you can get lots of variation across the landscape. Additional displacements applied after the Compute Terrain will displace these patterns because they will stick to the 3D texture space generated by the Compute Terrain. And if you want to warp them separately you can do that with a Warp Input Shader or Warp Merge Shader whose "warper" is some displacement. The Fractal Warp Shader probably won't help much because it warps laterally, when I guess you want to warp it vertically, so just warp it with a fractal displacement which will apply along the normal by default (although you might want to try changing that to Along Vertical).

Matt

Would converting the terrain displacement to scalar in a separate chain, modifying it however one would one, and than feeding that back through displacement and contour work? You'd have essentially have a duplicate base terrain to use for the contour.
Title: Re: Advanced Coloring Techniques?
Post by: Matt on July 21, 2019, 06:40:59 PM
I'm not sure, you'd have to try it.
Title: Re: Advanced Coloring Techniques?
Post by: WAS on July 21, 2019, 06:51:23 PM
Quote from: Matt on July 21, 2019, 06:40:59 PM
I'm not sure, you'd have to try it.


It... seems to act very bizarrely. For example. You can disable all the shaders leading to the contour and it will still contour the terrain. But if you enable them, you get a completely different contour in the 3D preview of the shader itself, but what's applied, is the same contour that exists with disabled input.

It seems the surface shader could read what's being displayed by the shader itself, but it goes by the base terrain altitude rather than new input.