Coloring a heightfield

Started by amandas, June 10, 2020, 06:40:57 am

Previous topic - Next topic

amandas

What is the most efficient way to put a diffuse color map on a heightfield? Currently I have 1 shader for getting heightfield displacement, which is fed into Compute Terrain. Now, the diffuse map I get via Image map shader, fed into Surface Layer. Now, if I need to position/scale/rotate the heightfield (read: always), I basically need to recreate the same translations for the image map (I use Transform Input shader for transforming HF displacement; Transform merge shader for HF color). I am sure my approach is suboptimal.

Best!
Artist / Developer
open for freelance / full project cycle
http://arturmandas.com

N-drju

Actually, this is just the way I'd do it. I wouldn't say it is not optimal.

If I had a rotatable heightfield and colour shader to cast on it, I'd use the transform shader because this is exactly the purpose of this node.

Note that in many cases you may also use just one transform shader to rotate the entire upstream network in unison! Be wary though - some features will not work well when confronted with the "Use world space" option.

In some cases, though, you could probably just rotate the POV camera or sun too, but I understand this is not a possibility here. :P
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"

amandas

Quote from: N-drju on June 10, 2020, 08:13:47 amActually, this is just the way I'd do it. I wouldn't say it is not optimal.

If I had a rotatable heightfield and colour shader to cast on it, I'd use the transform shader because this is exactly the purpose of this node.

Note that in many cases you may also use just one transform shader to rotate the entire upstream network in unison! Be wary though - some features will not work well when confronted with the "Use world space" option.

In some cases, though, you could probably just rotate the POV camera or sun too, but I understand this is not a possibility here. :P
Thanks! Suboptimal here I meant only in the context of using 2 transform nodes instead of 1  - but that is probably only me not knowing TG good enough yet, I came up with this setup by sheer drag and play.
Artist / Developer
open for freelance / full project cycle
http://arturmandas.com

N-drju

If you are ok with the entire network above the TIS being affected, you only need one node of that type. For instance, while I was making a procedural texture for my model, i used only one TIS to rotate five nodes at once.

Of course, if you need other transformations that should not be affected by the already existing ones (let's say an extra, scaled up image) you will need a surface layer with an image and TIS attached as a child.

examp.jpg
"This year - a factory of semiconductors. Next year - a factory of whole conductors!"