Object and terrain interactions

Started by iaminonsiner, February 06, 2019, 02:03:58 pm

Previous topic - Next topic

iaminonsiner

Hello !

I have question about objects :

How can I link an object and the ground on which it is placed? I'm not sure how to illustrate this, but I'd like to do it in the future with buildings and pretend that the building is a "piece" of the terrain and not an object ON the terrain... In my mind, I want to see a building with the same colour / textures of the terrain ( not the effects like power fractal or twist, just the " surface ").

Image for illustrate :

[attachimg=1]


I think I've already seen this on the forum but I can't find the topics.

Thank you guys.

EDIT : as if I had made an "extrusion" from the ground and not an import from an external object

archonforest

Just connect the PF that covers the ground to the surface layer of the object. Then you will have the same coverage.
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

iaminonsiner

Quote from: archonforest on February 06, 2019, 02:20:13 pm
Just connect the PF that covers the ground to the surface layer of the object. Then you will have the same coverage.


How ? and what's the "PF" ?

iaminonsiner

February 06, 2019, 02:30:01 pm #3 Last Edit: February 06, 2019, 03:15:05 pm by iaminonsiner
I tried to connect the " base colour " of a default scene to the sphere object and I think it works.

Do you think can I do the same for the terrain geometry ?


[attachimg=1]

archonforest

Quote from: iaminonsiner on February 06, 2019, 02:27:28 pm
Quote from: archonforest on February 06, 2019, 02:20:13 pm
Just connect the PF that covers the ground to the surface layer of the object. Then you will have the same coverage.


How ? and what's the "PF" ?


Ahh...sorry. PF is the short version of Power fractal. Take a look of the attached file. Is this what u need?
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

iaminonsiner

Power fractal obviously and yes this is something like that.

Do you think can I do the same for the terrain geometry ? ( You can see the image above )



archonforest

Quote from: iaminonsiner on February 06, 2019, 03:40:18 pm
Power fractal obviously and yes this is something like that.

Do you think can I do the same for the terrain geometry ? ( You can see the image above )

I am not sure about the question...Can u explain?
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

iaminonsiner

February 06, 2019, 04:01:07 pm #7 Last Edit: February 06, 2019, 04:02:55 pm by iaminonsiner
Quote from: archonforest on February 06, 2019, 03:53:18 pm
Quote from: iaminonsiner on February 06, 2019, 03:40:18 pm
Power fractal obviously and yes this is something like that.

Do you think can I do the same for the terrain geometry ? ( You can see the image above )

I am not sure about the question...Can u explain?


On your image ( and mine ), I have the same color ( object and terrain ) but the object is too smooth and I was wondering if the geometry of the terrain could also "apply" to the object like color? Like an extrusion, like if the object IS the terrain and not just an imported object.

archonforest

Got it. Not sure if this is possible since the PF will look different on the small sphere. Perhaps you can just attach a PF to the sphere's displacement input and play with the setting until it looks more on less than on the planet...

I will think about this tomorrow. Perhaps someone will come up with a good idea. I am not a power TG user at all.
Dell T5500 with Dual Hexa Xeon CPU 3Ghz, 32Gb ram
Amiga 1200 8Mb ram, 8Gb ssd

Dune

If it's a low poly object, displacements won't work well. You'd have to set the object to 'force displacement' anyway. So you need objects with a high poly number, and feed your last terrain shader through a transform shader set to final/world position. But don't expect very much of it, especially not in terms of big displacements; the object will probably be torn apart.
For just a sphere, better use the internal sphere.

digitalguru

February 18, 2019, 07:25:56 pm #10 Last Edit: February 18, 2019, 07:59:24 pm by digitalguru
If you delete the UVs on your poly object it will shade any power fractals in the same space as the terrain.You won't see any scaling / texture placement differences and it will appear to blend in better.

You could also try to convert your mesh into a displacement map, (preferably a vector displacement map) and then use a displacement shader to place it on your terrain - it would look like it's growing out of the terrain.

some posts on a Blender forum:
https://blender.stackexchange.com/questions/1161/how-to-make-a-displacement-map-from-existing-3d-geometry

digitalguru

This works with a teapot stripped of UVs  :)
[attachimg=1]
[attachurl=3]




Dune

If you don't want to strip your object of UV's, it can be done with UV'd objects too, just pull your shaders through a transform shader set to world/final position.

digitalguru

February 19, 2019, 09:06:03 am #13 Last Edit: February 19, 2019, 09:14:24 am by digitalguru
If you have the professional version of Terragen, you can create a displacement map from an object:
Original geometry:
[attachimg=1]
Object shape displaced from terrain
[attachimg=2]

You can render the geo with an orthographic camera and output the tgSurfPos (surface position) as a Render Element. The green channel of the tgSurfPos is the vertical position, equivalent to displacement values (render as 32bit EXR). You can then pipe this onto your surface using a Displacement shader and a Green to Scalar to extract the vertical channel. The downside is that it won't work with complex geometry like the teapot in the previous example (that would need vector displacement) but for simple geo that has no undercuts it works quite well.

When you render the render element for the tgSurfPos file, make sure the object is on a flat undisplaced terrain or you'll get that baked into the map.

example TG scene:
https://www.dropbox.com/s/nnkgl0m204y1f6m/object_displacement.zip?dl=0

I did try a render with the teapot with UVs and the transform shader, but I get displacement cracks where the UV shells are:
[attachimg=3]

Dune

Strange. So the UV-mapping is really disturbing the displacement somehow. I wonder why that is so. In the default shader UV is automatically assigned, so maybe when using a surface shader it won't happen... Have to try that, as I can imagine people won't like to get their objects stripped of UV's. In fact I wouldn't know how to purge the UV mapping (unless in LW or so). I don't think you can delete UV's in Poseray.