Fake stones compute normal vs compute terrain

Started by FlynnAD, August 15, 2017, 08:38:24 PM

Previous topic - Next topic

FlynnAD

This should be easy, but I'm scratching my head.

I have one heightfield. I am trying to put fake stones on it.

If I plug the heightfield into a Compute Terrain (with either patch 20 or 1 size, it does not matter), I cannot get the fake stones to align their color.

If I plug the heightfield into a Compute Normal (with a patch size of 1), the fake stones align with their color.

However, with the Compute Normal, adjusting the pancake effect on the fake stones has no effect and the stones look like spiked pyramids. Comparatively, with the Compute Terrain, the pancake effect works, and the stones look both more rounded and flatter.

I thought Compute Terrain incorporated Compute Normal and further calculations (i.e. it was a better node to use in general, and for further downstream use). I would rather not use both (Compute Normal for fake stones, and Compute Terrain for altitude/ slope constrainments, populations) as I would think that using both would increase render time.

What is the correct way of getting color on pancaked fake stones? Is the improved Merge Shader/ Current Texture Space helpful here?

Attached is a node link of the two results.

Thanks,
Matt

Dune

The compute normal doesn't get its info from thin air, so your setup won't work correctly. There's nothing to compute, as there are no previous displacements. The XYZ shader does, so in some circumstances my posted setup works. In this case it's not needed, btw, for the same reason.
For fake stones of size X it's a good start to make the biggest size X as well, and the feature size maybe a quarter of it. Anyway, check this out.

René

Sometimes feeding the fake stones trough a transform shader (use world space enabled) gives better results.

FlynnAD

First, thanks for the replies.

Second, I should have been clearer in that the heightfield was plugged into both the Compute Terrain and Compute Normal nodes in the original image. I just did not include it in the image or tgc.

I tried the Texture XYZ but it did not link the color to the fake stone boundaries. Nor did any combination of Compute Terrain, Compute Normal, or Texture XYZ except when the Compute Normal is plugged into both the fake stones and the surface layer. However, that dual-Compute-Normal result gives pyramidal stones, not rounded, so it is not an answer either.

The only way I can get this to work is by NOT bothering to color the fake stones at all (since the coloring does not align), but plugging uncolored stones into a surface layer's main input and coloring that surface layer separately (which colors the entire planet), then using a Merge node with Highest (Raise) to merge the fake stones into my base Compute Terrain colored landscape. My hunch is that while this solution works, it would not allow for particular, nuanced coloration on the stones (such as if you wanted to color the stones on one of their sides, such as north moss growing).

Could anyone explain why the Compute Terrain does not work in aligning colors (when the Merge node is not used, as in the original examples at top), or why the Compute Normal node does align color but generates pyramidal, non-rounded stones? The more I understand the workings of how, why, and why not of TG, the better I'll be able to troubleshoot issues myself before they arise.

Thanks,
Matt

René

Compute terrain patch size 1 seems to be the only solution. It's probably the lateral displacement that causes the problem.

penboack

#5
Matt,

I also have had similar problems with this in the past.
I found that the solution was to plug the Fake Stone shader into the Child Layers input of a Surface Layer shader.
If you look at the network in Dune's example you will see that is how the nodes are connected up.

Just plug the Heightfield Terrain into Compute Terrain node with the default settings and then connect the Fake stones to the child input of a Surface Layer shader and see if that works.

Dune

I don't see the problem really.

René

The problem is that sometimes for some reason you get pyramid shaped stones. This can be corrected by feeding the stones shader through a transform shader, but then, as you can see in the middle image I posted, the colors won't align.
Compute terrain patch size 1 gives correct results but may cause other problems.