Shader setup help

Started by sjefen, December 01, 2021, 06:53:49 PM

Previous topic - Next topic

sjefen

Hi,


I'm trying to setup a shader for some trees where there are two different shaders for the bark. One at the bottom that goes a few meter up and then the other one takes over, but I have no clue how to do this and make the textures respect the object and not the elevation (or whatever). It works fine if the trees are all at the same elevation, but if some of them are higher up a hill for example, the bottom texture disappear. I hope that makes sense. Can someone help me out?  ;D

As seen in the image of the trees, one of them are lifted from the ground, but the red texture stops at the same height as the other tree.



Stupid trees.jpg
stupid tree nodes.jpg

- Terje
ArtStation: https://www.artstation.com/royalt

AMD Ryzen Threadripper 1950X
128 GB RAM
GeForce RTX 3060 12GB

Dune

#1
It does work if you use position in terrain/texture and Y.

Hannes

Hmmm. Doesn't seem to work for me. I used other values for maximum altitude as well, even extreme ones, positive and negative, but I don't get the effect you had.
(In my image the foliage shaders are set to zero opacity).

Hannes

#3
I'm an idiot. In my example I used the RTP, but didn't enable shading... ::)

Nevertheless, I can't get the desired effect, even with other colors. (Edit: "Values" of course!!)

KlausK

Doesn`t seem to be as straightforward as one might think. I can`t get it to work either...
I use a elongated cube from TGs object list. Similar aproach/thinking as sjefen, I believe.
Gave up after trying to click together each and every combinations of surface shaders, merges, altitude limits and colour shading.

Btw what kind of object are you all using that can attach the shaders on the outside? I forgot how to do that.

CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

Kadri

#5

I tried it with your setup Klaus and it didn't work for me too.

But with a population it worked in this way (i used your nodes).

It is different for populations and moving separate single object maybe (Objects with UV's and without are an another consideration too...) ?

We have to use the translate node for moving objects maybe?

Kadri

Quote from: KlausK on December 02, 2021, 06:09:56 AMBtw what kind of object are you all using that can attach the shaders on the outside? I forgot how to do that.

CHeers, Klaus

You can right click in the internal node network on a node and assign any node that is in the outside.

KlausK

Thanks for testing my file, Kadri.
I had the same thought regarding the Transform Shader but every connection in the setup, every setting in the node did not help.
Maybe I did not do it correctly, of course.

So that is maybe why Ulcos setup worked. Looks like he used populations too.
But if this works with a population it only makes things more complicated.
I would like to be able to use this on single objects with each its own shader setup.
To me it is like sjefen wrote: some sort of a "object space" would be needed, like in 3d programs.
Wht the animation shows is "world space" Lightwave style - as far as I know and remember it.

Fiddling on....

CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

Dune

#8
Strange that it doesn't work for you guys. But perhaps there's also a way to use the displacement to scalar from terrain and warp a level (terrain, not final) by it over Y and use that as mask (though transform at world.
\

EDIT: I had another look. This works. You just need a gradient (image map) and use the UV. By resizing the map, and adjusting Y you can play with the extent of the mask on the bark.

Kadri


For populations it works Ulco. But for the single moving object in Klaus's example not.

Klaus your scene works with an OBJ that had UV's with the setup you see below.

But why it works only in this way i don't know. Maybe because of The UV's like in your example Ulco.

Kadri

I tried an OBJ without UV's and that didn't work with that setup. You need UV's to get that setup to work as it looks.

WAS

#11
An objects space doesn't align with world space, just like a cloud doesn't unless in final. Probably the issue. Your mask is probably far below the object.

Depending on the objects location on Y the actual "0" of Y is offseted.

For me when I set a level, without it being final position, I can move a single object and the surface layer remains in position.

It's good to note that the scale of the altitudes seems to be somehow related to the object, and not world space. For example. The tree is only lifted 1 meter in this example. And the tree is only a little over 4m, but the altitude settings, as you can see, do not relate to these dimensions. The cut-off is 10 meters high, with a 5 meter fuzzy zone.


sboerner


KlausK

Quote from: sboerner on December 02, 2021, 04:11:01 PMInteresting thread!
Yep!

Thanks for the file Kadri.
And WASs example shows what I found trying to use the Altitude Min-Max.

So, built in objects in TG like the cube I used do not carry UVs then?
I somehow always assumed they did, in a way...

CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

WAS

#14
Quote from: KlausK on December 02, 2021, 05:13:55 PM
Quote from: sboerner on December 02, 2021, 04:11:01 PMInteresting thread!

So, built in objects in TG like the cube I used do not carry UVs then?
I somehow always assumed they did, in a way...

They do, so I'm not sure what that's about. I've always used UV projections with textures for them. Even the planet has UV.

That being said, it would be cool if TG shipped with a UV grid for them (for other programs to align textures) or able to export UV grids.