Feature Request: Heightfield generate Use shader Improvements

Started by D.A. Bentley (SuddenPlanet), February 26, 2021, 09:08:17 PM

Previous topic - Next topic

digitalguru

I had a chance to look at it in more detail and I think it seems like either a bug in the Displacement to scalar shader or default behavior - if Matt is reading this, he could confirm :)
The displacement to scalar shader only seems to work as you'd expect if you put it before the compute terrain node. I don't know why that should be, and it does limit options of where to sample the node tree.
But the workaround is to connect a Y to scalar after a Displacement to vector to get a heightfield rather than a VDM - see the attached TGD.

QuoteOn another note, I still don't understand how a VDM works.
Think of it as 3 scalar maps or heightfields combined in one file- the green channel is the standard Y displacement equivalent to a heightfield, so yes you can just isolate that channel in a VDM to get a regular heightfield. The red and blue channels then push the displacement in X and Z coords.
QuoteHow can the map do the offset for more than one surface
Not sure what you mean, but VDM can handle quite extreme overhangs like this:
overhangs.jpg
Good point though, check out the attached TGD, which is exporting from a simple scene created from a heightfield - render the Vector_DIsplacement render node and look at the red and blue channels - there's no information in there, as the scene is derived from a heightfield itself which is only displacing upward in Y.
It would be different if you add something like fake stones (which are vector displacements in themselves) then the VDM would have those extra channels populated.

So as you are basically upscaling and merging DEM files in your Terragen scene, you can just export a standard scalar heightfield and save some disk space.
QuoteI am exporting different terrains when I run multiple instances of Terragen.
I think a height field render will work reliably now - you could bypass your multiple instances of Terragen and set up a queue of renders. You can grab a copy of Deadline (https://www.awsthinkbox.com/deadline) which is free if you have three machines or less, and set up a queue to render overnight - it has a prebuilt set up for Terragen and for this use is quite easy to setup.


QuoteI am exporting different terrains when I run multiple instances of Terragen.
I'm currently writing a script for Terragen to Maya that includes a renamer for a linear image sequence to the Mudbox file naming convention, looks like the World Machine naming is similar and should be easy to write a renamer for that too. I'll probably make a standalone version of the renamer to work outside Maya.

terragen_export_displacement_v01_01.tgd

WAS

Yeah compute terrain to scalar doesn't work right, at least using it alone. i think if you stick a texture coordinates followed by other surface disp it works strangely. Also when I was doing clouds with altitude offset the compute terrain to scalar did weird things there. I think it simplifies how other shaders see the scalar information, for its patch sizes. Higher patch sizes produces larger intersections, and subtler disp effects applied afterwards (higher octave stuff has a hard time showing through in certain geometry).

This is actually the main reason fake stones both pop out wrong from the surface and have less surface detail when piped a high octave shader. You can lower patch size like 1-5 for a better effect on terrain and surface detail.

digitalguru


WAS

I think inherent for detail control, see my added comment to last post

Update: These lower patch sizes offer better geometry and shader coverage at the cost of render time.

D.A. Bentley (SuddenPlanet)

Quote from: undefinedI think a height field render will work reliably now - you could bypass your multiple instances of Terragen and set up a queue of renders. You can grab a copy of Deadline (https://www.awsthinkbox.com/deadline) which is free if you have three machines or less, and set up a queue to render overnight - it has a prebuilt set up for Terragen and for this use is quite easy to setup.
Great Tip!  I Downloaded it and will try soon.  I have been wanting a way to do Batch Rendering for a long time.

Dune

Quote from: digitalguru on March 09, 2021, 04:09:29 PMThe red and green channels then push the displacement in X and Z coords.
You mean of course the red and blue channels.

KlausK

Quote from: SuddenPlanet on March 09, 2021, 04:22:57 PM
Quote from: undefinedI think a height field render will work reliably now - you could bypass your multiple instances of Terragen and set up a queue of renders. You can grab a copy of Deadline (https://www.awsthinkbox.com/deadline) which is free if you have three machines or less, and set up a queue to render overnight - it has a prebuilt set up for Terragen and for this use is quite easy to setup.
Great Tip!  I Downloaded it and will try soon.  I have been wanting a way to do Batch Rendering for a long time.
Sorry for the slightly off-topic here but, since you said you downloaded Deadline I wanted to ask, how?
I only see the option "Login with your AMAZON account" when I go to the download page.
Is that what you need to have? Is there no other way to download on that site?
CHeers, Klaus
/ ASUS WS Mainboard / Dual XEON E5-2640v3 / 64GB RAM / NVIDIA GeForce GTX 1070 TI / Win7 Ultimate . . . still (||-:-||)

D.A. Bentley (SuddenPlanet)

QuoteSorry for the slightly off-topic here but, since you said you downloaded Deadline I wanted to ask, how?
I only see the option "Login with your AMAZON account" when I go to the download page.
Is that what you need to have? Is there no other way to download on that site?
CHeers, Klaus
Yea, that seems to be what you must do.  I guess they assume everyone has an Amazon Account these days.

It probably has something to do with Deadline using AWS (Amazon Web Services).

KlausK

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

D.A. Bentley (SuddenPlanet)

One other observation I had regarding Heightfield Generate From Shader is the speed at which the heightfield is generated varies depending on the size/area of capture.
Considering the following two examples, one will generate faster than the other:

1. You are generating a terrain at 32k (32768 x 32768 points/pixels) and you set the size (area of capture) at exactly 32768m x 32768m (32km x 32km); this would give you a 32km square terrain with 1 pixel per meter (the same as a 1m DEM).

2.  You are generating a terrain at 32k (32768 x 32768 points/pixels) and you set the size (area of capture) at exactly 262144m x 262144m (262km x 262km); this would give you a 262km square terrain with 1 pixel per 8 meters.

What I discovered is while keeping the resolution (pixels/points) the same in both examples and varying the capture area (size) the heightfield captured from a smaller area finished first.  In this case the 32km square heightfield was generated 2-3 hours faster than the 262km heightfield (both 32768 x 32768).

Pretty interesting I thought.  :)

Derek

digitalguru


digitalguru

Quote from: SuddenPlanet on March 10, 2021, 11:52:20 AMConsidering the following two examples, one will generate faster than the other:
That is interesting.

This is a guess, but maybe it's to do with the fact the displacement to vector shader is sampling over a bigger curvature of the planet.