This is bugging me for a while now; I can't properly align color and displacement. What am I doing wrong and what can I do to fix it? The image here is for testing purposes but the same thing happens with rocks. Any help is apreciated.
Does this work for you, I turned of the World switch in the Transform shader.
This way it aligns perfectly but it gets warped. This is the part I don't understand. :o
Quote from: René on July 02, 2019, 10:15:12 AM
This way it aligns perfectly but it gets warped. This is the part I don't understand. :o
y got me there...no idea but someone will know...hang in there...they may be asleep at this time
Perhaps the terrain is warped before and it takes over that warp. If you say world postion it won't but disaligns. Perhaps a smallscale compute terrain or xyz shader before masking? Do displacement and color in same area of the line.
I have had a similar problem it's annoying to use world position if you have to do work with the shaders.
Quote from: Dune on July 02, 2019, 11:29:58 AM
Perhaps the terrain is warped before and it takes over that warp. If you say world postion it won't but disaligns. Perhaps a smallscale compute terrain or xyz shader before masking? Do displacement and color in same area of the line.
I'll try that. Thanks!
Quote from: WASasquatch on July 02, 2019, 11:48:48 AM
I have had a similar problem it's annoying to use world position if you have to do work with the shaders.
I have experienced something similar with fake stones in world position; the colours and the stones will not match each other well.
Quote from: Dune on July 02, 2019, 11:29:58 AM
Perhaps the terrain is warped before and it takes over that warp. If you say world postion it won't but disaligns. Perhaps a smallscale compute terrain or xyz shader before masking? Do displacement and color in same area of the line.
What puzzles me is that the colours and the displacement are controlled by the same image, but are still interpreted differently.
Could it be a matter of colour continuity? Meaning that the colour remains in the same place but the displacement is moving in a different direction.
It works with a small patch size and world position off. But indeed, the displacement could well move the skin out of the colored area, the colors 'staying at the basis of displacement'.
That's bad news. The reason I need it so much is that I want vegetation and stones in the crevices of the rocks. Thanks you for your feedback.
I've tested a PBR texture from the web in a default shader, through a transform shader to rotate 90/90/90, and that works alright. Using the AO invertedly fro crevices works too.
Does that PBR use a normal map? By "AO," you don't mean ambient occlusion, I suppose.
I do. I don't use normal maps.
You can't really see it, but this is a near vertical wall from a softish (smallest size 1m) basic terrain. I used an old Rome wall to displace and gloss, etc, but left the color (albedo) out. Oh yes and added some lichen.
And after having added some fake stones.
Well, what do you know! I've flipped the image along the y axis and it works. I still don't understand why it works in your case, so I have to do something wrong. Ah well, at least I can move on.
Thanks again!
Yeah, sometimes TG makes your mind twist in weird turns ;)
Quote from: Dune on July 03, 2019, 11:24:11 AM
Yeah, sometimes TG makes your mind twist in weird turns ;)
Well said....
Quote from: Dune on July 03, 2019, 05:24:11 AM
And after having added some fake stones.
So, to summarize, you are using the AO map provided by the PBR as a crevice mask?
To align the displacement with the colour, you need to let it use texture coordinates. If you enable "use world position" in a transform shader, the colour will use the final world position but this doesn't affect the displacement in the same way, so they become misaligned. The displacement will use whatever texture coordinates were last set in the chain of shaders above it. To produce alignment, both displacement and colour need to use a shared set of texture coordinates which are set by the "Compute Terrain" or "Tex Coords From XYZ" node.
Even when there is alignment the textures might be distorted. If this happens I would suggest adding a "Tex Coords From XYZ" node right before the shaders you are applying. This will update the texture coordinates to the current world position at that stage in the network.
Indeed, as I said earlier. I use the XYZ shader a lot of times for that purpose. Even as input for fake stones.
And yes, rightly summarized, WAS.
Thanks for the explanation. Something so simple and I didn't know it. I wonder how many other simple, Terragen-related things there are that I don't know. :-\
I'm going to rework everything and see what it leads to.
Thank goodness for these forums...
I have a similar problem where masking wasn't aligning, but I was using a XYZ after the displacements for the surface shader. It boggled my mind. I tried everything including piping the mask through the displacements shaders rather than straight from the SSS, but no go... than I tried world position, no go, so I unchecked it... than suddenly, it matched up... just with with the Transform input shader with no settings or world position checked... I don't get it. What does a Transform input shader do when nothing is checked, that would fix this?