Shader setup help

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

Previous topic - Next topic



I found the solution to move the textures with the built in cube in the Wiki:
Under the "Rotate" paragraph the procedure is described.

You have to use a "Transform input shader" after Textures and / or Displacements
and move them the same amount as the cube object in y. If you rotate the cube in
x and z then you have to do the rotation in the transform as well.

In the case of using the "Altitude Min-Max" settings in the "Surface Layer" you
have to subtract or add depending from the amount of translation in the "Transform input".

The cube object is animated and the "Transform input" in y as well.
Scene file, screenshot and animation attached.

Not ideal but also not too much hazzle for only a few objects, I guess.

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


Really loving all the new wiki pages. Kevin is doing an amazing job.

So it's the Y offset I was mentioning earlier primarily causing the issue. Translating the shaders is a bit weird. You'd think you'd use final space otherwise the 0,0,0 of texture space should follow the origin of the primitive.


QuoteReally loving all the new wiki pages. Kevin is doing an amazing job.
Second this. Updating those pages is a *lot* of work and it is much appreciated.


Translating textures to displacable objects indeed always needed the location of the object (either directly or through transform shader), like for a moon/planet spherical image projection.


If it is indeed a population, a final position displacement to scalar before the compute terrain should indeed push up the as needed. I may actually say you'd have better results with less hard warping doing a heightmap and smoothing it.  Than warp the distribution shader for maximums altitude. May need to negatively warp. I had to do that earlier with clouds though wasn't a terrain to scalar. Then final position that making network. For single populations the above described works fine for just setting the objects locations themselves.


I feel a little stupid now. I was gonna use this for a population, I just didn't think that mattered. I was just setting up the shaders for the model and testing them when I noticed the "issue". It works for populations, so I'm happy. Would still be nice with an option there that only is for "object" along "position in terrain/texture" and "final position" tho.

- Terje

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