I'm fairly new to Terragen and still trying to get my head around all the nodes and how they interact.
Is it possible to create a small, *level* area on a heightfield? My heightfield is based on a DEM, and I'm using a bitmap to create the shape for the level area. The bitmap is projected with an image shader onto the heightfield.
The result I want is a flat, level space for buildings and other structures. In effect, I'm trying to use a projected bitmap to stamp a flat space in the DEM.
I've tried several combinations of heightfield, merge, and image shaders and the best I can do is create a depression that follows the contours of the DEM. I'm sure this is a straightforward problem with a simple solution but I'm stumped.
Schematic of what I need and a rendering what I'm getting attached. Any suggestions would be much appreciated. Thanks!
SB
Quote from: sboerner on April 02, 2016, 05:51:50 PM
I'm fairly new to Terragen and still trying to get my head around all the nodes and how they interact.
Is it possible to create a small, *level* area on a heightfield? My heightfield is based on a DEM, and I'm using a bitmap to create the shape for the level area. The bitmap is projected with an image shader onto the heightfield.
The result I want is a flat, level space for buildings and other structures. In effect, I'm trying to use a projected bitmap to stamp a flat space in the DEM.
I've tried several combinations of heightfield, merge, and image shaders and the best I can do is create a depression that follows the contours of the DEM. I'm sure this is a straightforward problem with a simple solution but I'm stumped.
Schematic of what I need and a rendering what I'm getting attached. Any suggestions would be much appreciated. Thanks!
SB
check this thread
http://www.planetside.co.uk/forums/index.php/topic,3830.msg39741.html#msg39741
If it's only one area, you can map it, import it through image map shader (or use some simple shapes), get the location right, and add it as a mask to a surface shader after the terrain. Invert the mask, set smoothing to enabled and the area will drop down to zero. Use the offset of the displacement tab of the surface shader to raise or lower it to the right level.
And you can do that for several areas of course, on different heights, with more surface shaders in line.
Heh heh, that too...I knew you'd pop in with a less confusing explanation than I'd have written. I just searched terrain flatten and recalled using the Richard Solution with success.
Yeah, Richard's solution won't be adequate here ;)
Brilliant, thank you. It worked exactly as you said:
[attach=2]
In the meantime I had come up with a more complicated solution that involves dividing the output from the heightfield into two branches. One branch displaces the surface and the second is piped through a heightfield clip node to define the floor of the excavation. Each branch can have different amounts of fractal detail applied:
[attach=1]
Your solution is more elegant and natural looking, perhaps best for earthworks. Mine might work for artificial structures like concrete walls and floors.
I've been building shading networks for years in programs like Maya, but Terragen's approach is fundamentally different. Can't quite visualize how the data flows yet. Getting there, and I appreciate your help.
Bobby, thanks for the link. Not quite what I need at the moment but a cool idea that I'll file for future reference.
SB
Nicely solved twixt the 2 of you...would you consider posting a .tgd or .tgc of your technique? sounds like something to learn there as well.
Well, it looks like I spoke too soon. Appearances can be deceiving . . . after placing the structures I found that the floor of the displacement varies a few meters from side to side. It's still following the general profile of the DEM.
The floor needs to be perfectly level. Apparently I'm doing something wrong or this isn't possible with a single surface. Need to get moving on this project so for now I'm using a disk placed slightly above the floor of the displacement.
SB
Try using another heightfield shader. The default mode for heightfield shaders is to replace heights rather than offset them, so it's really easy to flatten an area by applying a heightfield that is flat. You can mask the heightfield shader using another shader (e.g. your projected bitmap), and you can control the height with a Heightfield Adjust Vertical node.
Matt
Matt, thanks for the suggestion. It's similar to the setup I was using, but I used a heightfield clip node instead of a separate heightfield and adjust node. Both setups worked fine when I tested them in empty documents, then didn't work in the actual scene.
I think I see what's happening – the setups work fine at the origin but not so well at a distance.
The planet in the working scene is rotated so the apex is at the center of the DEM. But it's a large DEM, and the rendered location is about 32 km from the apex. It's also at a very high altitude, over 4,000 meters.
Here is a flat heightfield 1 km on each side, positioned 32 km from the apex and raised to 4,000 meters with a heightfield adjust node:
[attach=1]
When the mask is applied the heightfield sometimes disappears from the rendered view entirely:
[attach=2]
At the scene origin the same masked heightfield renders OK:
[attach=3]
Could the distance from the origin cause this? I can send a TGD file if that would help.
SB
Those rendering problems are due to the extreme displacement in that test, but once you have your real scene set up it should render OK.
To address the planet curvature issue, the "flatten surface first" option in the heightfield shader has a few different options, and the one you want is called "to Y = 0". As in this screenshot:
[attach=1]
Matt
OK, good to know, thank you. I'll be sure to use your recommended setting.
The location is Puebla, Mexico and the DEM is from the USGS Earth Explorer (GMTED2010 series). The scene will be used for a magazine infographic about the HAWC gamma ray observatory near Pico de Orizaba, the tallest volcano in Mexico. It's a perfect project for Terragen. If it works out at all I will post images later.
Thanks again to all for your help.
SB
Quote from: sboerner on April 06, 2016, 11:25:42 AM
OK, good to know, thank you. I'll be sure to use your recommended setting.
The location is Puebla, Mexico and the DEM is from the USGS Earth Explorer (GMTED2010 series). The scene will be used for a magazine infographic about the HAWC gamma ray observatory near Pico de Orizaba, the tallest volcano in Mexico. It's a perfect project for Terragen. If it works out at all I will post images later.
Thanks again to all for your help.
SB
Please do, always good to see TG being used in the real world...good luck with the project.
OK, I think I've stumbled upon a solution. I've been using the wrong approach all along. It's just a simple math problem. Subtract the current altitude from the desired altitude of the displacement, and use that as the displacement value. Pipe it into a surface layer shader as a displacement function, then use another surface layer to combine that with the main heightfield:
[attach=1]
Here is the result using a generated heightfield and a simple shape shader as a mask:
[attach=2]
And here it is applied to the heightfield loader in my project:
[attach=3]
For some reason there's a discrepancy between the specified and actual heights of the displacement floor, but it's easy to take into account. And the result appears to be flat and level. Whew.
[attachurl=4]
SB
Brilliant, been trying to achieve that since for ever...well done and nice to have another Blue Node wizard in the forum...
And reviewing your posts it seems no one has welcomed you to the forum so allow me to be the first to say welcome mate.
I still don't understand why this didn't work for you ???
Quote from: Dune on April 07, 2016, 11:55:58 AM
I still don't understand why this didn't work for you ???
for starters he's in a hole and your solution has a "cliff' at one edge and I believe he's using an imported image not a SS shader.
I can't explain it. Could it be the large size of the scene and extreme displacement? The altitude is around 4,000 meters.
[attach=1]
I'm pretty sure everything is set up correctly. When I have time later I'll try it with a smaller, simpler scene.
Thanks for the welcome, Bobby. Nice to be here.
SB
Dune, I owe you a beer or something. I tried that again with a smaller file and it worked immediately, then was able to apply it to the working file. Not sure what my mistake was before, but seeing the large displacement offset value in your screenshot made things click.
On the positive side, the process helped me better understand this amazing application. We learn by doing.
A beer would be nice ;)
Heineken? Or maybe one of our excellent upstate New York microbrew IPAs . . .
:) Btw; why can't I find your site? There's nothing there.....
Quote from: Dune on April 09, 2016, 01:59:34 AM
:) Btw; why can't I find your site? There's nothing there.....
here?
http://www.steveboerner.com/
and with TG input:
http://www.steveboerner.com/ev-nautilus
Thanks, now it's working.
Maybe not the final render, but hopefully getting close. (Deadline rapidly approaching.) This will be the background plate for an informational graphic. Callouts and other images will be overlaid to explain how the observatory works. (It detects gamma rays.)
[attach=1]
Impressive, glad this worked out for you.
Looks pretty good. Thanks for showing this!
Thank you for your help and encouragement! I can see by the many examples on this forum that I have much to learn. Looking forward to the journey!
Quote from: sboerner on April 18, 2016, 12:57:08 PM
Looking forward to the journey!
It's a real fun trip for sure.
That looks really great, and welcome to the forum, Steve!
Nice image and welcome to the forum.
Thanks! Nice to be here. I'm sure I'll have a few questions in the months (and years) to come. Learning a lot just by scrolling through existing threads. Many experienced users and a lot of good info here. Maybe some day I'll have a few insights to contribute . . .
Steve