Heightfield matching away from the origin

Started by old_blaggard, September 06, 2009, 03:41:35 PM

Previous topic - Next topic

old_blaggard

I'm working on a technique that involves generating a heightfield from a shader, and then dropping that heightfield right back down, so that the location of the features of the generated heightfield match those of the shader.

This works fine when I'm at (0,0,0). However, the camera position in the scene that I'm working on is a few kilometers away from the origin along the x- and z-axes. When this technique is applied there, the features don't match up at all. I also noticed that the heightfield bounding box is hovering about 2.7 meters above the ground because of the slight curvature of the planet, and it is impossible to adjust the y-position of the heightfield.

If anyone has any ideas on how to make the heightfield and the shader match properly, they would be much appreciated.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.

choronr

Quote from: old_blaggard on September 06, 2009, 03:41:35 PM
I'm working on a technique that involves generating a heightfield from a shader, and then dropping that heightfield right back down, so that the location of the features of the generated heightfield match those of the shader.

This works fine when I'm at (0,0,0). However, the camera position in the scene that I'm working on is a few kilometers away from the origin along the x- and z-axes. When this technique is applied there, the features don't match up at all. I also noticed that the heightfield bounding box is hovering about 2.7 meters above the ground because of the slight curvature of the planet, and it is impossible to adjust the y-position of the heightfield.

If anyone has any ideas on how to make the heightfield and the shader match properly, they would be much appreciated.
If you get this to work, it seems that you may get rid of that dreaded horizontal line between the distant heightfield and the base terrain. I've given up on my current scene and resorted to PS to blur and clone stamp the horizontal line out of prominence.

Henry Blewer

Would using the get position in coordinates function help? Or Get position in x,y,z?
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

cyphyr

I'm sure I saw a solution to this a while back ... my brief search turned up squat :(
try looking under BigBens posts, or it may have been a reply he gave ...
Sorry not much help.
Good luck
Richard
www.richardfraservfx.com
https://www.facebook.com/RichardFraserVFX/
/|\

Ryzen 9 5950X OC@4Ghz, 64Gb (TG4 benchmark 4:13)

old_blaggard

Hmm... looking through BigBen's posts, looks like Matt had considered working on a solution to this very problem, but I don't think it ever got implemented (http://forums.planetside.co.uk/index.php?topic=2045.msg20091#msg20091). Hopefully I can convince Matt to implement that ;). In the meantime, there are a couple of other ideas I can try.
http://www.terragen.org - A great Terragen resource with models, contests, galleries, and forums.