Help - Search - Members - Calendar
Full Version: Using height maps to deform a grid?
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rendering, Compositing and Special Effects > Materials Laboratory
ericsh6
I have a greyscale height map of some mountains generated from a satellite. I don't want to use the terrain plugin because it is limited to a square grid that has to be very high resolution for the mountains to look good. The picture I attached below shows how I make my own mesh that conforms to the contours of the mountains. It doesn't take long to make this 2D mesh and huge mountain ranges can be created this way with reasonable patch count and the mountains look very nice. All I want to do now is use the height map to displace the control points in the Y direction. I used to do this in V11 by exporting to .PLY and then importing the .PLY file back into a new model. But I don't know if that is what .PLY is designed for and it doesn't seem to work that way in V13. Does anyone have a nifty way of using a grey scale image to permanently deform a mesh?
ZPiDER
you could use the map as a displacement map.
but i think what you have there is not a real height map as it shows shadows (dark spots in a height map would normally be valleys), so i'm not quite sure it if will produce a good result.
ericsh6
QUOTE
you could use the map as a displacement map.


Oh, the image I attached above is rotoscope greyscale satellite image of the mountains - I only use it to know where to make the mesh. I have another decal that is in fact a height map.
When you say "the map" do you mean the decal with the displacement percentage set? But I need to deform the mesh.
ZPiDER
yes, apply the displayement bitmap as a decal to your modeled surface (stamp from top view).
ericsh6
QUOTE(ZPiDER @ Jun 21 2006, 06:02 AM) *

yes, apply the displayement bitmap as a decal to your modeled surface (stamp from top view).


Yes, but this won't deform the CPs. The mesh appears deformed only at rendertime with Pixel displacement (which I am very pleased with) but I need the mesh deformed into mountains at realtime display so I can put trees, rocks, etc.
Rodney
QUOTE
I used to do this in V11 by exporting to .PLY and then importing the .PLY file back into a new model. But I don't know if that is what .PLY is designed for and it doesn't seem to work that way in V13.


Eric,

I think the easiest way to get at what you want (within the workflow you specify) is to reinstall v11 (or whatever version worked best with deforming meshes with height maps) and then bring forward the resulting mesh to v13.

Older versions of A:M can still be quite useful.




ericsh6
QUOTE
I think the easiest way to get at what you want (within the workflow you specify) is to reinstall v11


I did reinstall v11 and I used the export .ply then import .ply but the the mesh gets altered even when you export as 1 poly per patch. I don't know how I did it two years ago.
John Bigboote
I think Rodney meant to displace it in V11 and import it to V13 as a .mdl file...

THIS brings up an interesting point and a possible feature request...maybe if you 'shift' as you pick displacement you get the old style mapping...linda like if you 'shift' while picking a hair material you get the old hair...
ericsh6
QUOTE
you get the old style mapping


I would never go back to the old displacement mapping. The new displacement mapping in V13 is very powerful and only requires minimal patches to produce much displacement detail.

But what I am doing is different. I want to permanently deform a mesh based on height map for mountain terrains. This is so I can add trees, rocks, etc.
ZPiDER
QUOTE(ericsh6 @ Jun 22 2006, 07:28 AM) *

But what I am doing is different. I want to permanently deform a mesh based on height map for mountain terrains. This is so I can add trees, rocks, etc.


which is ecactly what the old style displacement did. sorry, i wasnt aware of it being changed in v13, just saw it in hash's upgrade offer e-mail today.

there is one way to do it automated, but it will require my conform plugin:
- create a dense elevated grid with the grid plugin
- model your geometry (flat) above that grid
- use conform to fit your model to the grid
- delete the grid

but seeing how in your screenshot you only have a few cps, i think you'd be better off by pushing those cps by hand if you dont need ecact results ..
someawfulbridge
I know I'm the ignurnt neophyte here, but in the Jeff Paries v8 book he discusses a feature that would create a grid based on downloadable survey information. I've not tinkered with it, and the links in the book to download these survey results files are outdated, but wouldn't this be what ericsh6 is talking about?

QUOTE(ZPiDER @ Jun 23 2006, 03:21 AM) *

QUOTE(ericsh6 @ Jun 22 2006, 07:28 AM) *

But what I am doing is different. I want to permanently deform a mesh based on height map for mountain terrains. This is so I can add trees, rocks, etc.


which is ecactly what the old style displacement did. sorry, i wasnt aware of it being changed in v13, just saw it in hash's upgrade offer e-mail today.

there is one way to do it automated, but it will require my conform plugin:
- create a dense elevated grid with the grid plugin
- model your geometry (flat) above that grid
- use conform to fit your model to the grid
- delete the grid

but seeing how in your screenshot you only have a few cps, i think you'd be better off by pushing those cps by hand if you dont need ecact results ..

ericsh6
QUOTE
but seeing how in your screenshot you only have a few cps, i think you'd be better off by pushing those cps by hand if you dont need ecact results ..


In the screenshot I only show the splines that fit the general contour of the cliffs. Then I use the splitpatch plugin by Steffen to refine the mesh. I do want exact results so I need to deform the mesh based on the satellite height map. I would use your conform plugin but the mesh of the mountains will have over 40,000 patches. I am working on a plugin in the SDK forum that will hopefully deform a mesh based on a decal. I am trying to figure out how to extract the greyscale RGB value of the decal at a CP location right now. I hope the SDK allows this access.

QUOTE
the Jeff Paries v8 book he discusses a feature that would create a grid based on downloadable survey information.


This is the terrain plugin that Marcel mentioned above.
ZPiDER
> over 40000 patches

but you wouldnt need it for long, so i dont think that will be an issue.
ericsh6
QUOTE(ZPiDER @ Jun 24 2006, 01:51 AM) *

> over 40000 patches

but you wouldnt need it for long, so i dont think that will be an issue.


Marcel,
I tried using the terrain wizzard to make a displaced mesh so that I could use the conform plugin but the terrain wizzard mesh is just too dense to pick up all the cliffs and other details over my 20mile x 20 mile mountain terrain. The computer runs out of memory. I have a forum thread in the SDK development area:

http://www.hash.com/forums/index.php?showtopic=22423

All I need is the code to extract the greyscale value from the decal at each CP location.
aaver
QUOTE(ericsh6 @ Jun 24 2006, 08:59 PM) *
I tried using the terrain wizzard[...] The computer runs out of memory. I have a forum thread in the SDK development area:[...]
All I need is the code to extract the greyscale value from the decal at each CP location.


I obviously don't understand what you are trying to do since I don't see why your approach will need less memory than the Terrain Wizard.



EDIT:

Ok, now I think I understand...



So you are building a terrain proxy and then you are going to use the new displacement map for final render. Am I close?



yoda64
The only way I see , is to dynamically subdivide patches , where this is needed .
So you can start with a low density grid .
But , that is not simple .....

And ericsh6 , is A:M Terraform not a solution for this job?
ericsh6
QUOTE
So you are building a terrain proxy and then you are going to use the new displacement map for final render. Am I close?


Not exactly. I build a mesh by hand over the entire mountain range. I conform the mesh to the contours of the land. I use the powerful 5-point patches and hook patches to transition from circular to linear meshes and transition from dense to coarse meshes. I use the splitpatch plugin to refine the mesh where my camera will shoot and where the terrain is especially rugged. So far everything is done in 2D with a rotoscope. Now I want to use the satellite image height map to raise and lower the CPs to the correct altitude. Now I have the entire mountain range for arial shots but with regions of higher resolution for more interesting closeup shots. Here is a link to an animation I recently did. It is getting closer to what I want but I can do way better once I can deform my mesh with a decal.

Example of closeup and far away terrain shots

After creating the mountain, I can add bump decals for errosion patterns and rocks.


QUOTE
And ericsh6 , is A:M Terraform not a solution for this job?

I tried using A:M Terraform but it still uses the square grid approach, I need splines that follow the contours of the landscape.

Steffen, SDK question. Is there a way get the decal image greyscale value at a CP location? So with that code you wrote to grab all the CPs into an array, then I can modify the Z position of each CP from the corresponding decal image pixel value?



ZPiDER
QUOTE(ericsh6 @ Jun 25 2006, 06:37 AM) *

Steffen, SDK question. Is there a way get the decal image greyscale value at a CP location?


with BitMapPlus i used this function for the bitmap access:

HClipProperty *m_clipTile;
BOOL hit = m_clipTile->ReadBitmap( x, y, &color, &opacity, texinfo->GetPixelWidth());

but you'd have to align the x/y coordinates to your decal manually

to do exactly what you want, i think you'll have to use the stamp of the decal, but i'm quite sure this will get hairy.
ericsh6
QUOTE
to do exactly what you want, i think you'll have to use the stamp of the decal, but i'm quite sure this will get hairy.


Thanks for the "HClipProperty *m_clipTile" option. I am using the stamp of the decal and it is a bit hairy but hopefully it will work.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.