Author Topic: Fake stones compute normal vs compute terrain  (Read 330 times)

Offline FlynnAD

  • Member
  • *
  • Posts: 71
Fake stones compute normal vs compute terrain
« on: August 16, 2017, 12:38:24 AM »
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

Offline Dune

  • Member
  • *
  • Posts: 12552
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Fake stones compute normal vs compute terrain
« Reply #1 on: August 16, 2017, 05:44:55 AM »
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.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline René

  • Member
  • *
  • Posts: 280
Re: Fake stones compute normal vs compute terrain
« Reply #2 on: August 16, 2017, 09:56:34 AM »
Sometimes feeding the fake stones trough a transform shader (use world space enabled) gives better results.

Offline FlynnAD

  • Member
  • *
  • Posts: 71
Re: Fake stones compute normal vs compute terrain
« Reply #3 on: August 16, 2017, 04:34:11 PM »
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

Offline René

  • Member
  • *
  • Posts: 280
Re: Fake stones compute normal vs compute terrain
« Reply #4 on: August 16, 2017, 05:54:11 PM »
Compute terrain patch size 1 seems to be the only solution. It's probably the lateral displacement that causes the problem.

Offline penboack

  • Member
  • *
  • Posts: 131
Re: Fake stones compute normal vs compute terrain
« Reply #5 on: August 17, 2017, 12:07:00 AM »
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.
« Last Edit: August 17, 2017, 12:21:32 AM by penboack »

Offline Dune

  • Member
  • *
  • Posts: 12552
  • Corkscrew Bird
    • www.ulco-art.nl
Re: Fake stones compute normal vs compute terrain
« Reply #6 on: August 17, 2017, 06:53:38 AM »
I don't see the problem really.
In case you still haven't seen enough of my work: www.ulco-art.nl

Offline René

  • Member
  • *
  • Posts: 280
Re: Fake stones compute normal vs compute terrain
« Reply #7 on: August 17, 2017, 03:55:35 PM »
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.

 

anything