View Full Version : Normal and Displacement Mapping
04 April 2004, 12:05 AM
As we see the advent of zbrush and displacement mapping, how bout we start a thread on whats the best way to setup once you have the maps and model ready??
04 April 2004, 10:06 AM
Iīve started to use ORB (http://www.soclab.bth.se/practices/orb.html) in order to extract normal and displacement information.
But although I can use displacement in a really simple way, I donīt know how to use normal maps (in tangent space) in my shader, how must I connect that funny normal map I retrieved?
Any lucky guy?
Thankīs in advance.
04 April 2004, 04:08 PM
yeah I believe you connect out color to normal
04 April 2004, 06:21 PM
This is going to be an area of intense R&D I imagine. I was over at the Spiraloid forums and Bay Raitt posted a link to an interesting Maya shader that uses normal and displacement information in rendering. It's actually really cool how it works. The only issues I have are 1) is only works with Maya SubD, I want it to work with polys and 2) it dosn't work with Mental Ray. I've tried to get things working the way I want, but alas, I lack the intellectual power :D
Here's the link:
04 April 2004, 07:53 AM
ok here we go for now i am researching MR and Displacements...
here`s a small test.... I seem to be loosing a lot of detail I think this is becasue I choose adaptive displacament map...
so far so good though, a question for you guys...
whats the difference between surface tesselation approximation and displacement tesselation approximation , I mean its obvious but are they used together? can I just use a displacement approx? and I played with both a little but i didn`t see much difference when using displacement approx setting in maya
04 April 2004, 08:11 AM
do game engines use normal maps? it seems like you can get immense amounts of detail with suprisingly low poly meshes... and with these high tech games (with 7000 poly main characters) that in conjunction with a normal map, would make something that would seem subdivided in realtime! :surprised
04 April 2004, 09:00 PM
Normal maps can be used in game engines, it just depends on the engine and if it is developed to handle them. I think you might be confusing what a Normal map does in comparison to a bump or a displacement map. Normal maps do no create geometry, they preterb normals based on a per pixel value. So instead of perterbing a single normal per face (as bump maps do) they can preterb a normal at the pixel level, obviously generating much more color information comparitvely to a bump. Basically Normal maps are what bump maps should have been. If you look closely at low res characters with normal maps you can still see the outline of the polys. Normal maps can be used in conjuction with displacement maps over low res characters thus making them appear to be very high res and leaving the strain of that high res at render time and not in the viewport while working on it.
04 April 2004, 09:04 PM
emmortal can i get a little help on approximations...?
I am wondering do i need to have a displacement approx as well as a surface approximation?
wich will overide, or take control?
I i do add a displacement one with it subdivide my mesh even further? Since I get decent displacements from just surface approx
04 April 2004, 02:09 AM
squeige: To really fine tune your surface that is using a displacement map, youll want to use a conjunction of both. Remember that mental ray uses Maya's tessellation settings if no surface approximation is declared for that surface. Of course by creating a surface approximation for that surface, mental ray will use this information to tessellate the corresponding surface that the approximation is assigned to. If said surface has a displacement map assigned to it, then you'll want to add a displacement approximation to the surface to control the extra triangles generated by the displacement. You can lower the surface approximations settings generally because the surface before displacement won't need a tremendous amount of triangles, unless of course it's very complex. Once the surface approximation is queried, the displacement approximation will kick in and add any additional triangles specified according to your approximation settings.
One thing I always do to help tweak my mental ray scenes, is to change the Warning Messages to Progress Messages. You can do this in the Render Globals under Translation. This will output a more detailed description of your scene to the Output Window. Here you can see tessellation results, bsp information, render time, etc. This can be a great help when tweaking out displacements, as with just one wrong setting you can send your render time through the roof.
04 April 2004, 04:35 AM
ok almost got it down to the t... ill be making a tut soon emmanuel one more question plese (thanxs for all you help so far so good..)
Zbrush does positive and negative displacements
how do i mimick this behavior in the displacement shader?
should i be using the MR displacement shader or can i use maya`s?
thanxs in advance
04 April 2004, 06:11 PM
You can get the same effect that ZBrush produces by painting over a 50% grey for the displacement, then paint your displacement with black and white as you normally would, and then adjust the Alpha Offset value in the Color Balance section of the texture file for your displacement. The offset is by default at 0, this means that the displacement will occur at 0 units from the surface. If you increase this value to 1 then the displacement will occur at a value of 1 unit off of the surface. By default, it would be 1 centimeter (1 grid unit). If you paint a 50% grey value (128 128 128 for RGB) and change the value to say .5 for the Offset, then you can cause the displacement to go in a negative value instead of displaceing in a positive value.
You can use either Maya's displacement or mental rays, I would use mental ray as it is much faster than Maya's displacement. Of course assign a displacement and surface approximation to it and set it accordingly to your surface needs. If you are going to going use Maya's tessellation features, then make sure you adjust your Feature Displacement settings in order as to not over triangulate the displacement. The Extra Sample Rate value should be adjusted accordingly, a value of 1 or 2 is fine in majority of cases.
One thing that you should do with your displacement map in Photoshop as well, is to only displace the area that you need displacement in. So if I was displaceing some wrinkles around an eye. I would mask out that area for the wrinkles in a slightly large circle around it (I'll tell you why in a a minute), and then flood the surrounding area outside the circle with black (no displacement). Then with the eraser, lower you opacity down and pick a brush with smooth edges, slowly wipe away the edges so you get a nice gradiant toward the area that you want displaced. If you have a sharp edge, then the displacement will show that, which is not what you want. I'd then paint in my wrinkles or if I was using a photo reference, just clone them in and make sure they are in a greyscale value of course. Once this is done, you will notice that there are quite a few variations in pixels. When this happens, you are going to get over displacement for each of those pixels. So to fix this, just use the smudge tool over the entire area to smooth those pixels out, keeping the wrinkles and major areas that you need still defined of course.
Hope that helps.
04 April 2004, 06:17 PM
All this information is very good, but what about normal maps?, I donīt have a clue on how to use them, tangential ones are the ones Iīm interested in.
04 April 2004, 03:45 AM
Well I will get to researching those in a moment.. first i need to learn how to apply disp.. will be getting out some tutorials on it as well soon
04 April 2004, 10:03 PM
I myself have had very limited sucess with getthing normal maps (tangent space as well) to work in maya. I am close but am missing something. Could someone who has some sucess please share the secret.
I am multiplying the normal map channels (RGB) by 2, and then subtracting 1 from all three channels, effectively getting -1 to 1 values for each RGB. So, where do I hook this? Do I need to transform into a different space (?!) or just hook into the material normalCamera attribute (which doesn't seem to work).
Any insignt would be appreciated. Thanks in advance.
04 April 2004, 03:31 PM
Iīve success with absolute space normal maps, itīs as easy as connecting each color RGB to XYZ normal camera channel of a shader.
But, of course, absolute space normal maps are useless if you want the object to be rotated or scaled, wich is, of course again, every object youīll create.
Any more lucky man?
04 April 2004, 05:50 PM
04 April 2004, 10:08 AM
thanks Beaker. I have been over this site a few times. And someone please correct me if i am wrong, but the shader network on the sight converts a normal map from object space to camera space. I have a normal map in tangent space and need to get it to camera space. For fear of digging into my old linear algebra books, does someone have a shading network in maya that does this?
I may be missing the point entirely, and if someone could even tell me that, I would be greatful.
The space change utility on drone.org does the transformation (tangent space to camera space) that I am looking for, but the site does not have the latest maya 5.0 version of the utility. However, that can be found on highend3d under spaceChange v5.0:
a note that Oliver mentions on his site and I will reiterate here is that the spaceChange node is not translated by mayatoMr, so it doesn't work with mental rays. He does have a shader network for download towards the bottom of this page:
just getting ready to try it with MR.
04 April 2004, 04:55 PM
Thank you very much deepsea, now itīs time to make a little tutorial for it? (am I asking for so much?).
04 April 2004, 12:50 PM
Iīm messing with this..., I want to use tangential normal maps and donīt know how to do it, Olivier doesnīt explain how to use space change utility nor where to connect it (I supose it must be connected to "normalCamera" attribute, but not sure).
Does anyone got to work this stuff?, I mean normal maps (any kind of) and changeUtility node all together?.
Thank you very much, all the help is kindly appreciated.
01 January 2006, 11:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.