Digital Art Zone

 
   
1 of 2
1
Create normal map from mesh with reduced-resolution mesh subtracted?
Posted: 10 February 2013 09:36 PM   [ Ignore ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

HI folks, I’m still pretty new at this, so maybe I don’t say it all correctly.  I made a grayscale hieght map from NASA topographic data and imported it into Carrara as a terrain. But the dataset is so huge it brought my computer to its knees.So instead, I first pulled up PhotosShop and made a normal map from the high-res satellite grayscale data.. Nvidia’s PhotoShop plugin for making normal maps went into lala land, so I installed xnormal, which worked a little clumsily, but it worked.

Then I exported the terrain from Carrara as an .obj file and mported it back in as a vertex object. I opened the vertex mesh in the Carrara editor. I decimated it and untrangulated it very carefully, as each mouse click took at least 10 mminutes. Finally I got the mesh down to a reasonable size, so now I have a lo-res mesh from the same data, and it’s really smooth:)

So then I imported the normal map I’d made in Photoshop from the high res data and put it on the low-res mesh as a bump map. Now the low-res mesh has high-res detail. BUT it’‘s overemphasized and jagged. What I need to do is ‘subtract’ the low-res terrain from the high-res terrain and make a normal map from ‘height difference.’ This must be something other folks do for other data, and itg should be easier with a terrain mesh, which at least has a flat bottom and exactly the same bottom corners.

Is ther a way to subtract one mesh from another and get the difference data in Carrrara?

Profile
 
 
Posted: 11 February 2013 08:08 AM   [ Ignore ]   [ # 1 ]
Power Member
RankRankRank
Total Posts:  1231
Joined  2004-11-07

Did you select “normal” rather then bump when you import the normal? They don’t interpose. A bump map’s lowest point is 0, all bump is added to that. A normal map has a mid point of 0 with low and high being +-. None the less there is a slider for adjusting how intense the bump is.

Profile
 
 
Posted: 11 February 2013 09:01 AM   [ Ignore ]   [ # 2 ]
Power Member
Avatar
RankRankRank
Total Posts:  1828
Joined  2004-08-24

HI emeyer smile

So then I imported the normal map I’d made in Photoshop from the high res data and put it on the low-res mesh as a bump map. Now the low-res mesh has high-res detail. BUT it’‘s overemphasized and jagged.

A Normal map, or Bump map,. creates a lighting effect on the surface, to make it look rough, but it doesn’t alter the geometry of the model.

What I need to do is ‘subtract’ the low-res terrain from the high-res terrain and make a normal map from ‘height difference.’

No,. that may not do what you imagine. since the geometry isn’t being changed by the normal map.

Pictures help a lot,. they show us, what you’re seeing, and doing, and help explain something which can sometimes be hard to explain.

If the Hi-res Normal map , made in photoshop, is over emphasised, then you can reduce the “bump” effect setting in the shader,.or reduce the brightness of the normal map in the shader, either method will reduce the perceived bump effect

Traditionally,. you would have a low polygon “base” object, then you’d add several levels of subdivision smoothing, which allow you to create finer surface details, to export the “High-res” normal map. but because subdivision smoothing can be “virtually” added, this allows you to go remove the sub-division smoothing and return to the original low polygon base model.

Is ther a way to subtract one mesh from another and get the difference data in Carrrara?

Yes,. most 3D programs (which handle modelling) have a “boolean” function, where one object can be added to, or subtracted from another, or the intersecting shape between both can be left,. or subtracted.

It can leave you with a mess of untidy vertices and edges which may need some care.

but, Boolean is used to cut one solid object from another,. like a sphere from a cube,.
What you’re thinking of doing would be cutting one deformed “Plane” from another deformed “Plane”.

Plane’s don’t have any depth ..unlike a cube,. so boolean “cutting” a sphere from a plane, with give you a plane with a hole.
it’s not easy to perform a boolean cut using two deformed planes, and get what you imagined the results would be..

I think adjusting the normal map levels and perhaps the scene lighting wil give you the effect you’re looking for.

Hope it helps smile

 

Profile
 
 
Posted: 11 February 2013 09:58 AM   [ Ignore ]   [ # 3 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

Well maybe I can explain a little more what puzzles me.. Just looking at a cross section of the mesh: suppose there is a small, flat island, ten feet above sea level. So the cross section of the low-res mesh has pixel points at 0ft, 10ft, 0ft.

The low-res mesh was made from the high-res mesh. which has pixels representing altitudes 0ft, 5ft, 10ft,  5ft, 0ft. When I make the normal map from the high-res mesh, the normal map contains tangential data representing heights of 0ft, 5ft, 10ft, 5ft, 0ft. Typically, this would be a applied to a flat surface, such as a plane, to create an apparent height of 0ft, 5ft, 10ft, 5ft, 0ft on the flat surface at render time. 

But I want to put the normal map on the low-res mesh rather than a flat surface, so I can replicate trees, draw rivers and roads, and so on, on the low-res mesh surface. But when I put the normal map on the low-res mesh, I get apparent heights of 0ft, 5ft, ***20ft***, 5ft, 0ft, right?

Image Attachments
Capture.PNG
Profile
 
 
Posted: 11 February 2013 10:15 AM   [ Ignore ]   [ # 4 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03

I noticed that the OP said he untriangulated and decimated the mesh.

A normal map or a bump map can’t put in large displaced detail.  To do displace a mesh needs displacement map.  What I mean is if the mesh has very deep valleys and high mountains, they will not be displaced with a normal or a bump map.

See the sphere on the right with displaced geometry.  Notice the low poly sphere on the left with a normal map - there is no displacement.


What I’m saying if you start with a displacement mesh with a map, then untriangulate and decimate it, you will not get the results you expect.

 

 

Image Attachments
low_and_high.jpg
Profile
 
 
Posted: 11 February 2013 10:28 AM   [ Ignore ]   [ # 5 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

Well yes, but in this case the mesh is terrain sized. I’d want to be inside that valley looking up at the mountains. In the low res mesh, I just removed coplanar surfaces and halved the number of points. I need the low-res mesh so, in the valleys one can look up and see the mountains. Hence I’m trying to make a bump map (well actually a normal map to better represent data at tangential angles)  that adds more detail to the low-res mesh from the original high-res mesh.

Profile
 
 
Posted: 11 February 2013 10:39 AM   [ Ignore ]   [ # 6 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

...then I’m overlaying a tile from the original high-res mesh where I’m zooming in from orbit…this shows what I’m doing….

When I add the normal map, the lower big map appears the same height as the little more detailed map, but the height appearance has to be exact, or it won’t look right. And that’s where I’m having problems )

Image Attachments
meshexample.jpg
Profile
 
 
Posted: 11 February 2013 10:41 AM   [ Ignore ]   [ # 7 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03
emeyer - 11 February 2013 10:28 AM

Well yes, but in this case the mesh is terrain sized. I’d want to be inside that valley looking up at the mountains. In the low res mesh, I just removed coplanar surfaces and halved the number of points. I need the low-res mesh so, in the valleys one can look up and see the mountains. Hence I’m trying to make a bump map (well actually a normal map to better represent data at tangential angles)  that adds more detail to the low-res mesh from the original high-res mesh.

Actually Bryce can import terrain maps from geo servers as I recall.

But, one can similate the same thing by converting the bump map in PShop to (black and white under the Layers function) and then export as a tiff map.

You can get results like what is seen below.
1.  Tiff map
2. Vertex Map (after smoothing)
Then, to make areas where you want trees, grasses, place buildings, you use PShop to make layers where the grasses, trees etc should be, make the other layers invisible, then use the surface replicator to insert the maps for trees, grass ets in the surface replicator.

If this is not your intentions, then I apologize, but this saves a lot of time and is more accurate if you start out with the terrain editor and a good map.

 

Image Attachments
terrain_map_small.jpgterrain_vertex_modeler.jpg
Profile
 
 
Posted: 11 February 2013 10:47 AM   [ Ignore ]   [ # 8 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

Yes, that’s exactly what I’m trying to do, and I find the terrain editor in Carrara better than in Bryce, maybe it’s just because I’ve become more familiar with its UI. But if I draw all the data at high res, it brings my computer to its knees, because as well as the terrains, I have a model of ancient Athens imported from Google Earth (due to the amazing Collada format), with V4 flirting with Michael. So altogether it’s just too much data, and that’s why I’m trying to merge meshes of different resolutions.

Image Attachments
meshexample2.jpg
Profile
 
 
Posted: 11 February 2013 10:59 AM   [ Ignore ]   [ # 9 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03
emeyer - 11 February 2013 10:47 AM

Yes, that’s exactly what I’m trying to do, and I find the terrain editor in Carrara better than in Bryce, maybe it’s just because I’ve become more familiar with its UI. But if I draw all the data at high res, it brings my computer to its knees, because as well as the terrains, I have a model of ancient Athens imported from Google Earth (due to the amazing Collada format), with V4 flirting with Michael. So altogether it’s just too much data, and that’s why I’m trying to merge meshes of different resolutions.

Yeah, that’s a lot of data for a regular pc to handle.

If you are comfortable with the terrain editor in Carrara, then I suggest make representational maps rather than digitally accurate maps.  That is, get the look and feel of the map, but then make overlay maps with the color, placement of trees, grass and objects with maps in photoshop, paint it to accuracy (not precision) and the make other layers invisible, export in a jpg or psd for carrara’s use. 

This way, you can precisely place your buildings and other objects using maps for the surface replicator.  Each type of object would probably require its own map for place.  One for buildings, one for trees and one for flora, then adjust.  It sounds like quite a project.

The infinite Skills series available in the store (paid tutorial) gives a very good explanation if this this process of making your own scenes with accuracy (not precision). 

For precision, you’re gonna need a super computer with dedicated software like Google Earth has. heh

or use Google Sketchup which is another purchase.

But, it can be done in Carrara with some effort and you are satisfied with accuracy, rather than precision.

Profile
 
 
Posted: 11 February 2013 11:00 AM   [ Ignore ]   [ # 10 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

Also I could add, I expect the mip mapping in 8.5 will help with moire, which does appear in texture maps of this size. But with the dataset size I’m not playing in the beta yet. At the moment I’m just trying to get accurate reprentation of height. Am I mistaken in thinking the normal map is exaggerating peaks, because I am drawing it on a low-res mesh of the same height data?

Profile
 
 
Posted: 11 February 2013 11:07 AM   [ Ignore ]   [ # 11 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03
emeyer - 11 February 2013 11:00 AM

Also I could add, I expect the mip mapping in 8.5 will help with moire, which does appear in texture maps of this size. But with the dataset size I’m not playing in the beta yet. At the moment I’m just trying to get accurate reprentation of height. Am I mistaken in thinking the normal map is exaggerating peaks, because I am drawing it on a low-res mesh of the same height data?

I’ve never used normal maps for precision.  You can get accuracy, but not precision. 

The only method I’ve used is make a map from a TIFF, importing that into the terrain editor. 
Caution:  Once smoothing is applied to get rid of the jaggies (for purposes of anti-aliasing) you will get ‘not so precise’ details.

The texture artists here probably can address the moire problem.  Of course, the higher resolution map you make, the better the render, but it will also bog down your system.  One can do 4K x 4K maps in Carrara without too much difficulty.

Profile
 
 
Posted: 11 February 2013 11:14 AM   [ Ignore ]   [ # 12 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19
Design Acrobat - 11 February 2013 10:59 AM

If you are comfortable with the terrain editor in Carrara, then I suggest make representational maps rather than digitally accurate maps.  That is, get the look and feel of the map, but then make overlay maps with the color, placement of trees, grass and objects with maps in photoshop, paint it to accuracy (not precision) and the make other layers invisible, export in a jpg or psd for carrara’s use.

Aha. Thank you yes, that is a way around the problem, but in this case it doesn’t work fo rthe opening scene, as I am animating a zoom and flying in, like in Vista Pro flight control….What I plan to do is invisibly morph V4 and M4 from humans into giant Gods in the sky, and zoom from them in their God morph in the sky to human-scaled figures on the ground.

What did occur to me is another workaround: there is some way of substituing low-res for high-res data via LOD controls depending on distance, so perhaps I could use the original high res meshes without decimation, then at low res, any loss in precision due to normal maps would not matter, and I substitute in the higher res data and use 2d backdrops for the ground scenes. But I’m not sure how to set it up…have you tried that?

Profile
 
 
Posted: 11 February 2013 11:23 AM   [ Ignore ]   [ # 13 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03
emeyer - 11 February 2013 11:14 AM
Design Acrobat - 11 February 2013 10:59 AM

If you are comfortable with the terrain editor in Carrara, then I suggest make representational maps rather than digitally accurate maps.  That is, get the look and feel of the map, but then make overlay maps with the color, placement of trees, grass and objects with maps in photoshop, paint it to accuracy (not precision) and the make other layers invisible, export in a jpg or psd for carrara’s use.

Aha. Thank you yes, that is a way around the problem, but in this case it doesn’t work fo rthe opening scene, as I am animating a zoom and flying in, like in Vista Pro flight control….What I plan to do is invisibly morph V4 and M4 from humans into giant Gods in the sky, and zoom from them in their God morph in the sky to human-scaled figures on the ground.

What did occur to me is another workaround: there is some way of substituing low-res for high-res data via LOD controls depending on distance, so perhaps I could use the original high res meshes without decimation, then at low res, any loss in precision due to normal maps would not matter, and I substitute in the higher res data and use 2d backdrops for the ground scenes. But I’m not sure how to set it up…have you tried that?

In the animation and working aspect of your project use target helpers as proxies for your meshes.  Make your meshes invisible and use the target helpers centered on the pivot points of the objects.  This will help with the ‘fly arounds’. 

 

Profile
 
 
Posted: 11 February 2013 11:30 AM   [ Ignore ]   [ # 14 ]
Member
Rank
Total Posts:  117
Joined  2005-02-19

Thank you. That could keep me going a bit longer before I get stuck again. Also I’m thinking Inagoni’s SWAP could help. I could assemble in low resolution and then swap in the high-res map for render, it works, it’s just REALLY SLOW!

...One person suggested I should use Max instead. If I were going for another app for this, I guess it would be Vue Infinite. But actually,  I don’t think the software makes much difference with datasets this size. More memory and a power graphics could help, but I’m reluctant to upgrade my Nvidia 470, it’s been so reliable unlike most other dozen graphics cards over the decades, I really hesitate to upgrade.

Profile
 
 
Posted: 11 February 2013 11:58 AM   [ Ignore ]   [ # 15 ]
Active Member
Avatar
RankRank
Total Posts:  335
Joined  2006-02-03
emeyer - 11 February 2013 11:30 AM

Thank you. That could keep me going a bit longer before I get stuck again. Also I’m thinking Inagoni’s SWAP could help. I could assemble in low resolution and then swap in the high-res map for render, it works, it’s just REALLY SLOW!

...One person suggested I should use Max instead. If I were going for another app for this, I guess it would be Vue Infinite. But actually,  I don’t think the software makes much difference with datasets this size. More memory and a power graphics could help, but I’m reluctant to upgrade my Nvidia 470, it’s been so reliable unlike most other dozen graphics cards over the decades, I really hesitate to upgrade.

Vue Infinite would be better for fly arounds imo.  But go with what you have I say.

Profile
 
 
   
1 of 2
1