Fake stones on a heightfield issue

Started by dhenry2112, January 16, 2017, 02:57:04 PM

Previous topic - Next topic

dhenry2112

I am running into an issue that is new to me. I have a fractal terrain to which I have imported a height field map from world machine and then applied height field erode and then added a strata and outcrops shader.
Beyond that, I have added several surface layers for colors only.
I am trying to add a layer of fake stones which should sit ON TOP of the surface layers but no matter what approach I take, my stones are showing up as displacement to the terrain and are not properly textured. I have tried both a direct fake stone shader node link as well as plugging the stones in as a child to an additional surface layer (this is what I want anyway because I plan to merge multiple stones layers).
The only culprit I can think of is that its an issue with the height field because without one, my fake stones function as intended.
In the image im just using the fake stones color option to color them white and have no further displacement on them. As you can see, the white color is only appearing on the tops of the stones and the other surface layers are bleeding into them.
Its almost as if the slope constraints in the surface layer which are intended to limit the stones are also somehow limiting the texture of the stones themselves?

Am I missing something here that needs to go after my height field possibly? I tried adding a compute terrain and/or compute normals after the chain of surface layers but that had no effect. Do I need to merge all those surface layers for colors down into one?

If anyone can clue me in on what I might be missing and actually explain how to correct the problem in a way that can be understood by someone who is still learning I would be most grateful lol.
Thanks in advance.
Included a render image, node connections, .tgd and height map (Could not load the .tiff height map as its too big. Just revert it back to a .tiff)

fleetwood

In the fake stones shader don't check the box where it says "Apply color". You had it set on and to pure white. If you uncheck it the planet surface colors will be used on the stones.


A couple other things jump out. Only the final Compute Terrain is needed. The extra one will slow things down and isn't needed.
Several of your surface layers are using power fractals with both high and low color turned on. When blending layers, better to only turn on the high layer. Having both high and low active tends to overwrite the previous layer and almost completely wipes out any earlier layers.

Also if you want to blend surface layers don't set the surface layer coverage slider all the way to 1.  Keeping the coverage slider near the middle allows better blending and also works more effectively on fractal breakup.   

dhenry2112

#2
Thank you very much for the info Fleetwood.

"In the image im just using the fake stones color option to color them white and have no further displacement on them. As you can see, the white color is only appearing on the tops of the stones and the other surface layers are bleeding into them."

I had the apply color checked to show how the color does not cover the entire stones. The other surface layers bleed over onto them. I dont want the planet shaders on my rocks. The issue is that I want to color the rocks independently and neither the fake stones apply color, nor using a power fractal as a color input for the fake stones solves the issue.
I have a lot of surface layers. Are the rocks picking up all of them?

In other projects I've never had an issue with being able to texture my stones independently using power fractals, regardless of how many surface layers I used. The only difference with this project is that this is the first time Ive used an imported height field map. (Just got world machine a couple weeks ago).




fleetwood

Well if you want independent color or displacement on the fake stones you would connect the colors to the fake stone input that is labeled "surface layer".
A big part of the problem is your masking set up.  In the distribution shader you have the slope limited to 30 degrees or less. Use Planet/object normal as the slope key instead of Final normal. What is happening with using final normal in your set up is that slope is being applied to slope of each stone so the planet colors are being restricted to the less than 30 degrees or less which is the under part of the stones and the white applied color is showing on the top parts.

A useful way to set up fake stones is to make them the child of a surface layer that has its color unchecked. This isolates the stones color from the planet better and you can then use the altitude and slope restrictions of the surface layer itself so you don't need a separate distribution shader mask just for that. You should still use Planet/object normal as the slope key to have the colors appear all over the stones.   

Here is an example of what I mean.

fleetwood

One additional thing. The erode heightfield is out of place in your terrain section.
When you want to erode a heightfield, you connect the erode after the heightfield you have loaded and then run the erode by clicking "erode now". It will take some time (seconds to many minutes depending on the strength) for the erode to run. Putting the erode first means it is receiving no input to work on.

dhenry2112

Many thanks my friend. You have enlightened me to many things I was unaware of but make total sense.
I had suspected the fake stones texture issue was something to do with the slope constraints in the surface layer they were plugged into.
I'm reading up on slope key settings in order to better understand how it works.
Will be working with your suggested approach this afternoon.

Makes total sense as well that the erosion needs to be after the heightfield otherwise its applying erosion to nothing.

I think in many cases on my projects Im off to the right start but there are simple things which I either overlook or dont quite yet fully understand and its nice to have people like you whom I can show my files to and find out where I'm making mistakes.
Thanks again for your help and I'll be sure and share a render when it done! Now on to clouds and atmosphere so I can start formulating more questions :)

penboack

Very interesting, thanks for posting.

What does the 'Tex coords from XYZ 01" do in the shader network?
http://www.planetside.co.uk/wiki/index.php?title=Tex_Coords_From_XYZ

fleetwood

Quote from: penboack on January 17, 2017, 03:16:38 PM
Very interesting, thanks for posting.

What does the 'Tex coords from XYZ 01" do in the shader network?
http://www.planetside.co.uk/wiki/index.php?title=Tex_Coords_From_XYZ

It ensures that world space is being used on the stone colors. It isn't necessary in this example but I just forgot to remove it. Kind of like wearing a belt and suspenders.

penboack


bobbystahr

Quote from: fleetwood on January 17, 2017, 04:41:23 PM
Quote from: penboack on January 17, 2017, 03:16:38 PM
Very interesting, thanks for posting.

What does the 'Tex coords from XYZ 01" do in the shader network?
http://www.planetside.co.uk/wiki/index.php?title=Tex_Coords_From_XYZ

Kind of like wearing a belt and suspenders.

hee hee hee, good analogy
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

dhenry2112

Ok, another quick question here...

I'm working on my rocks and river gulley but the problem Im running into now is that I am finding I need to apply smoothing to my surface layer that is the parent to all my merged fake stones shaders in order to have them function properly. However, this is having unwanted effects because it is applying smoothing to my height field and killing my erosion and strata features.
Is there a way around this by applying smoothing to the parent surface layers further up in the chain before the merge shaders?
I can limit the altitude of the smoothing in the surface layer which helps to some degree but I really don't want to lose my lower altitude features either.

I've included an updated file in which I have corrected all the mistakes which you previously pointed out.
It's my "experimental" version of the file.

fleetwood

The smoothing used in surface layers is based off the Compute Terrain and the patch size used there. If the default patch of 20 meters is resulting in too much smoothing, you can try lowering the patch size to 10 or 5 or 1 and see if that helps out. Try to avoid inserting any new Compute Terrains or Compute normal nodes as they make the render slow down.

In your new file you have fractal breakup attached to your fake stone surface layers. IMO Fake stones don't need or even look good with fractal breakup applied to the layer, it's just an extra complication so unless it gives some special effect I would not use the breakup fractals at all, I would just disconnect and delete them.

Your largest 3.5 meter stones aren't showing up at all due to having both a restricted minimum altitude setting and then sending them to the merge highest. The multiple restrictions just eliminate them altogether.
 
Generally I think there are too many separate stone restrictions which gets very "fiddly". Merge highest shaders by themselves keep stones from landing on each other and in my opinion setting the altitude and/or slope in the last surface layer where all the stones are combined is usually enough to look natural. Too many interacting restrictions obviously can get out of control because what we visualize doesn't always match what goes on when the shaders are processed at render time.

dhenry2112

When using the parent surface layer as the sole method of controlling the slope and altitude of the stones, those settings also constrain the smoothing effect. Could I plug in another surface layer above the parent layer for the fake stones and have it do nothing but apply smoothing so that it is unconstrained?

fleetwood


Without knowing what look you want or don't want it's hard to say much  :)

You could put a compute normal right after the last merge shader of your stones and then that becomes the closest recent terrain calculation so it will be used. But again the patch size will determine what changes happen to the stones and the terrain they sit on. Large sizes making things smoother and small making them rougher.

If by chance you are looking to get rounder stones the extra compute normal is not the way to go as it can jump the render time way up.

For rounder stones add some displacement offsets in the displacement tab of the stones color fractals. Think of the stones as little footballs and the offsets are like pumping air in to them. A negative offset will shrink them and positive offsets will inflate them. You can play with the amounts and the spike and roughness settings.

dhenry2112

#14
Ill post some more renders and explain in greater detail tomorrow what my overall project is all about but it's late and I gotta sleep. I have mentioned it in other posts in the past but I am doing an animated video and I will be doing both fly through scenes as well as close up shots which will be composited in After Effects with character animations rendered in 3D Max.

Here is an early example:
https://www.youtube.com/watch?v=SeY3z7CjtNE

I'm getting close to what I want in this render but first of all, I do not like the strata and outcrops being applied after the height field erosion. I tried DK's erosion plugin and I think it works on a scale too large for what I need as I could not find any parameters that didn't almost flatten my height field. I'm looking to get a more natural gradient in the strata that doesn't look so "minecraft".
I would also like the larger rocks to cluster more around the bottom slopes of the mountains, with smaller sizes of rocks as you get deeper into the gully. ie: big rocks break off, then smaller rocks from them etc and then you have the finest rocks in the deepest areas due to past water flow.