PDA

View Full Version : Blender Displacement - Need Help Please!


BUZZFX
11-10-2009, 05:35 AM
I have been searching for a good Newbie Tutorial on creating Displacement maps in Blender. I have found bits and pieces, but not a thorough tutorial. Does anyone know of a good tutorial explaining how to import a model and use a displacement map in Blender?

dyf
11-10-2009, 03:18 PM
if by "use a displacement map", you mean just applying a map to a mesh, use the displacement modifier (http://wiki.blender.org/index.php/Doc:Manual/Modifiers/Mesh/Displace)..

fktt
11-10-2009, 08:01 PM
heres a quick 'demo' from matt ebb, hopefully it helps to shed some light on the displacement 'pipeline':
http://vimeo.com/4528144

its not a newbie tutorial, if you can even consider it a tutorial,
but coupled with all the info you can find in the blender wiki,
I think its quite helpful. :)

BUZZFX
11-10-2009, 08:02 PM
Thanks Felix, I watched the video and it's a little too fuzzy to see much but I decifered some things from it. I already have a displacment map and I just want to apply it to my model.

Thanks dyf. I read the link you posted and I am reading what I can to learn this. I imported my mesh with UV's into Blender and applied a "displacement modifier". I can see my UV map (circled in red) but now I am stuck. What do I do to get my displacement map to show up on my object? I read that if the "modifier Texture Box" is left empty, then the displacement won't work, but since I Imported an already UV's object do I still need a texture in the "Modifier texture" slot?

Also I selected the "Modifier Texture" box and I couldn't figure out how to add my Displacement map image. Can't you just click it and then browse to the image?

Thanks.

fktt
11-10-2009, 09:23 PM
Add a material to your object, and in one of the texture slots add your displacement map,
call the texture "displacement" if you wish(I would),
and then back in edit buttons enter "displacement" into the texture name slot. :)

Aand that should be it, really.

edit:

yeah, I'm not really sure why they have developed the modifier so you'd have to use a texture that needs to be in the material, but oh well, that's the way it (currently) is. :/

BUZZFX
11-10-2009, 10:20 PM
Add a material to your object, and in one of the texture slots add your displacement map,
call the texture "displacement" if you wish(I would),
and then back in edit buttons enter "displacement" into the texture name slot. :)
Aand that should be it, really.
yeah, I'm not really sure why they have developed the modifier so you'd have to use a texture that needs to be in the material, but oh well, that's the way it (currently) is. :/

OK, I did as you said and it worked! Thanks. The displacement is working but the problem I have now is trying to adjust the displacement to match what was in ZBrush. (see image) Are there some settings in Blender that will give me the detail I need?

handlebar
11-11-2009, 09:30 AM
Have you added a subsurf modifier and then taken a test render. Just increase the render subdivisions until you get what you want. Displacement is geometry based so you need the resolution to be there are render time.
Blender doesn't handle micro-poly displacement yet so sometimes you can get better results by combining displacement with normal maps.
Here's a nice zbrush, blender work-flow series by Canned Mushrooms.
http://www.youtube.com/user/cannedmushrooms#g/c/FC5D4CE810BFD242

BUZZFX
11-11-2009, 04:36 PM
Thanks Steve. Really appreciate the link to those videos. :) I come from Cinema 4D background. And like all major apps. Cinema/Max/Maya/Modo, essentially all you have to do is create a material, then in the materials settings go to "Displacement" and load you map. Bingo Done!

I see Blender takes so many steps to get your displacement maps. Do you know if using displacement maps has been simplified in Blender 2.5 and if Micro-poly Displacement has been added in 2.5? It would be nice if Blender displacement could work like most other apps.

handlebar
11-11-2009, 06:08 PM
Glad to help
I also come from a cinema 4d background and have found the way blender handles materials and textures the hardest thing to get my head around.
I'm not going to look at 2.5 until the official betas are released so i couldn't say if the displacement handling is being worked on or not.
One thing that helped me out is thinking of the modifier stack in blender to be akin to cinema's awesome outliner.

BUZZFX
11-16-2009, 05:42 PM
Have you added a subsurf modifier and then taken a test render. Just increase the render subdivisions until you get what you want. Displacement is geometry based so you need the resolution to be there are render time.
Blender doesn't handle micro-poly displacement yet so sometimes you can get better results by combining displacement with normal maps.
Here's a nice zbrush, blender work-flow series by Canned Mushrooms.
http://www.youtube.com/user/cannedmushrooms#g/c/FC5D4CE810BFD242


Steve, I followed the Canned Mushrooms Tutorial to the letter, then added a SubSurf Modifier. I still am not getting the image to look anything like the ZBrush Render. Any ideas what I might be missing?

handlebar
11-16-2009, 07:05 PM
Have you tried adjusting the order of the displacement and subsurf modifiers in the modifier stack, i can't remember it that makes a difference or not, but worth a shot. I can't think of anything else other than did you remember to filp your map in zbrush before you exported it.

BUZZFX
11-16-2009, 07:37 PM
Steve, thanks for the reply. Yes I did flip my map in ZBrush and I moved the order of the displacement and subsurf modifiers.

blaize
11-16-2009, 08:30 PM
you should use the displace modifier (havent read the rest of the tread, so sorry if this has been said before)
check this wiki page for more info:

http://wiki.blender.org/index.php/Doc:Manual/Modifiers/Mesh/Displace

and for some more user results and info, check this topic on Blenderartists.org: http://blenderartists.org/forum/showthread.php?t=98760 you'll see they use openEXR to get the 16/32 bit displacement maps into Blender.

fktt
11-16-2009, 09:34 PM
in the material shading context, did you make sure that in the map input tab its on UV,
and not some other type of mapping coordinates? :)

BUZZFX
11-17-2009, 05:27 AM
in the material shading context, did you make sure that in the map input tab its on UV,
and not some other type of mapping coordinates? :)

Yes I had it on "UV".

BUZZFX
11-18-2009, 04:29 AM
I thought I'd try my mapping in Blender 2.5 to see how it worked. I am still not getting the results I want but my results are no worse than 2.49 so I will be sticking with 2.5 until my Blender render looks just as good as my ZBrush render.

The ZBrush Image is what it is supposed to look like
The Purple Image is my Blender Render
The Long image is my Blender 2.5 settings

I couldn't find the "Set Smooth" button in 2.5, so if someone could tell me where it is then I would appreciate it.

In the Blender Settings image Under #5 (Mapping > Layer > UVTex)
I actually changed "UVTex" to the name of my displacement map "sphere_disp.tif" then it would render. When I left it at UVTex Blender would not render but only crash. Please tell me if I was correct in using the name of my displacement map in this space?

If someone could look over my settings and tell me if I am doing this correctly I would appreciate it. Please offer any advice as to what to do so my Blender render looks like my ZBrush image.

Thanks

fktt
11-18-2009, 04:52 AM
If you dont mind could you share the last model & displacement map,
perhaps I can yeld some better results or find the problem trough some testing.. :)

blaize
11-18-2009, 06:12 AM
are you using the displacement modifier?

read the treads/links i poster above. they show info on getting things working!

CGIPadawan
11-18-2009, 07:19 AM
Hello Lorne,


First of all, I'd like to take the chance to say I saw a very early demo reel you did (It's the one with the cel-shaded car drive through a city and the stylized human talking for an educational video I think)... I really liked it.

Hehehe.

About the Displacement Maps, Blender's limitation is that the quality of a Projection from a normal and displacement map is directly connected to the quality of the mesh itself. Unfortunately you need to hit very high levels of Subsurfacing to get any really good result.

The good news is you can achieve something that is "screen-worthy" by using Blender's Multi-Res mode instead of SubSurf.

http://forums.cgsociety.org/showthread.php?f=91&t=796138&page=5

This was my own experiment with it. And if you want to read about the whole struggle just go back to Page 1.

If you're interested the thread also talks about how to bake a Multi-Res 6 Sculpted/Displaced model onto an SS2 model.

Good luck!

handlebar
11-18-2009, 11:02 AM
I couldn't find the "Set Smooth" button in 2.5, so if someone could tell me where it is then I would appreciate it.


Set smooth is now called smooth, you'll find it in the tools panel, keyboard 't'

Just out of curiosity how many levels of subdivision have you set in the subsuf modifiers render output?

handlebar
11-18-2009, 01:46 PM
Here's a little screenshot that might help you out.

BUZZFX
11-18-2009, 07:39 PM
If you dont mind could you share the last model & displacement map,
perhaps I can yeld some better results or find the problem trough some testing.. :)Yes, I would like it if someone more experienced could look at my settings and I will post them on a next test.

are you using the displacement modifier? read the treads/links i poster above. they show info on getting things working! Yes, I forgot to use the Modifiers earlier, but I have them in use now. Thanks Blaize

Hello Lorne, First of all, I'd like to take the chance to say I saw a very early demo reel you did (It's the one with the cel-shaded car drive through a city and the stylized human talking for an educational video I think)... I really liked it. Hehehe.
Sorry to say, but that demo reel wasn't mine. I will take the compliment though. :)


About the Displacement Maps, Blender's limitation is that the quality of a Projection from a normal and displacement map is directly connected to the quality of the mesh itself. Unfortunately you need to hit very high levels of Subsurfacing to get any really good result.
The good news is you can achieve something that is "screen-worthy" by using Blender's Multi-Res mode instead of SubSurf. http://forums.cgsociety.org/showthread.php?f=91&t=796138&page=5 This was my own experiment with it. And if you want to read about the whole struggle just go back to Page 1.

If you're interested the thread also talks about how to bake a Multi-Res 6 Sculpted/Displaced model onto an SS2 model. Good luck!Thanks I will definitely check that out! :)

Set smooth is now called smooth, you'll find it in the tools panel, keyboard 't' Just out of curiosity how many levels of subdivision have you set in the subsuf modifiers render output?That screenshot was definitely a lot of help! Thanks:)
Also, I pressed the "Smooth" button but it didn't seem to do anything. Is this still something I should use?
_____________________________________________________________________________

Awesome, I've made my first small success in Blender. Just baby steps still but thanks to everyone here for your patience.:buttrock: Your help has helped me make some valuable progress. Here are a couple of problems I am still trying to work out.

1) My Blender render caves in instead of pushing out like the ZBrush render and I am not sure why?

2) there are horizontal lines in the blender render that shouldn't be there. What might be causing these?

handlebar
11-18-2009, 08:31 PM
Set smooth doesn't seem to make much difference because the model has high subdivision levels at render time, much like zbrush when you go up in levels the model looks smoother.

Did you unwrap your model in blender first or use auv tiles? You also might want to check your normals are facing the correct way.

BUZZFX
11-18-2009, 09:03 PM
Set smooth doesn't seem to make much difference because the model has high subdivision levels at render time, much like zbrush when you go up in levels the model looks smoother.

Did you unwrap your model in blender first or use auv tiles? You also might want to check your normals are facing the correct way.

I unwrapped my model in ZBrush and used PUV tiles. It produces better maps than AUV and GUV. I created the base mesh in Cinema 4D and aligned the normals in there before exporting the .obj and importing it into ZBrush. Is that what you think is causing the geometry to push in instead of out. Any ideas what may be causing the horizontal lines?

OK, here's the .blend file with a low res displacement map. It still rendered like the original even though the map is low res. If someone could set it up correctly and then reupload it I would appreciate it. I am using Blender 2.5 (mac) so please use a mac unless Blender opens both mac and PC. Also please save the files to the same folder named "Test" so the links aren't broken. Thanks :)

CGIPadawan
11-18-2009, 10:35 PM
I got my result by using 4,096 x 4,096 maps. It's possible zbrush can extract a result with something smaller.

As for the black artifacts, I don't think those should be appearing. These can be corrected sometimes with GIMP/Photoshop work on the map and maybe recalculating all the normals (Ctrl+N).

But definitely your latest render shows progress.

:beer:

handlebar
11-18-2009, 10:45 PM
Don't use guv, auv tiles for anything outside of zbrush, unwrap your model the traditional way first then import the object into zbrush, i suspect that's what's causing the sharp edge artifacts.
I would import your cinema obj into blender, unwrap it there, then jump into zbrush.

I'm on a pc so i can't help with the file.

BUZZFX
11-19-2009, 05:37 AM
Thanks guys. I've had no problem using the ZBrush maps (PUV) in Cinema but I agree it's best to use something else. I use 3DCoat for unwrapping most of the time rather than doing it in ZBrush.

Actually I remember now I opened the disp map from ZBrush and adjusted the levels in Photoshop (darkened it) so that might be why the dark lines. I will try and re-export it ut and see if that helps. :)

handlebar
11-19-2009, 01:48 PM
Strike my last statement about AUV tiles not working in blender, did some experimenting today and they work fine. Just make sure your map is flipped correctly.
I could never get it to work in cinema and assumed the same thing with blender but here's the proof.

fktt
11-19-2009, 02:00 PM
Seems to be working for me using r24264,
I only changed the modifier order and re-leaded the texture image
(after reloading it in the shaders texture stack,
I also made sure to reload the datablock in the disp. modifier)... :/

oh and cranked up the preview field on the subsurf.

http://i48.tinypic.com/2e3rfrk.jpg

http://sites.google.com/site/tetriusdimensionisgraphicus/resources/sphere.zip

So I guess the PUV's work fine, mind you the blend(in the zip)
might need its disp texture reloaded again,
as my file system paths are different from macs.

apparently 2.5 doesn't yet do relative path's...

edit: took too long... :D

edit2:
forgot to mention don't use the displacement map as a bump map.
rather bake a real normalmap.

Yecire
11-19-2009, 04:13 PM
Your file pretty much worked out of the box for me too. I did as fktt did in rearranging the modifiers, and adjusted the material settings. The pink was due to the fact that your normal (bump) map was set to affect Color instead of Normals. Never saw the lines dividing the map as shown in your render.

Checking the differences between your original and the modified version should help ... if you don't get similar results, may be a bug in the Mac build? (I could only check in Linux and Win)

Here's a render with a 'red-clay' material:
http://s2.postimage.org/1H_Bs0.jpg (http://www.postimage.org/image.php?v=Ts1H_Bs0)

Here's what this material looks like in the 3D View with GLSL:
http://s2.postimage.org/1H_QpS.jpg (http://www.postimage.org/image.php?v=Ts1H_QpS)
(shows where to enable GLSL and SSS also)

CGIPadawan
11-19-2009, 10:22 PM
Yeah, everybody here is correct about the correct ordering of modifiers. I think Displacement should be bottom-most modifier or at least beneath sub-surf.

At least that's what I found out in my experiment.

And yes again, the displacement map should not be made to affect color. My personal method is to leave the Displacement Texture unchecked (ie: unused) and only used by the Disp Modifier.

Anyways, Lorne should be very happy when he comes back and sees the latest results.
:bounce: Another happy customer he will be.

BUZZFX
11-20-2009, 12:59 AM
Anyways, Lorne should be very happy when he comes back and sees the latest results.:bounce: Another happy customer he will be.Wow you weren't kidding! What a surprise to see this after work today. :bounce::bounce: I still haven't found time to look things over but this was a great surprise. Thank You so very much Steve, Felix, Eric & Giancarlo and everyone else who has helped with this.

Been real busy, but will try and post some updates next week. :)

CGIPadawan
11-20-2009, 02:35 AM
Hehehe. I was also relieved to see it worked so beautifully.. Looks quite a lot like the Zbrush result, eh?

Well, the next stage in this game is "Spot The Difference"... There will be minor differences in the file you were working on to the file these Good Samaritans have just sent back to you.

Blender (circa 2.49B) is a bit like a Super Mario level because some things are hidden in places that you least expect and you need to kind of find them out.

Usually the differences occur in the following:

1) The "Map To" panel.
2) The Texture Map List panel (sometimes you can choose to uncheck a Texture Map here so that it affects nothing until called upon by Displacement Modifier).
3) The Modifier "Ordering" (Blender applies Modifiers one at a time, so the order in which they appear in the Modifiers panel will affect things. My personal experience is "Displacement Below SubSurf" but you should go have fun and see what it does when you move things up or down)

Blender can only get better from here. :)

BUZZFX
11-30-2009, 05:10 PM
I used the same settings as before and applied them to my cube. The problem I am having is in the Blender file the corners are "rounded" when they should look like the ZBrush image.

Does anyone know how I can get the edges to be sharp (not rounded) like the ZBrush image? Are the edges not staying sharp because there is not enough geometry (subdivisions) around the edges or is there setting that controls the edges in Blender?

Ian Jones
11-30-2009, 06:32 PM
What does your base geometry look like in Blender? and does it have subsurf?

BUZZFX
11-30-2009, 06:40 PM
What does your base geometry look like in Blender? and does it have subsurf?

You can see an image of the base geometry inset in the above image. I didn't know how to render the wireframe so that's the best I could do.

Yes, I used a subsurf modifier at the top of the stack above the displace modifier.

fktt
11-30-2009, 07:30 PM
how about trying with the simple subdivision scheme (selectable on the subsurf modifier):
http://i48.tinypic.com/r7q9hs.png

As a matter of fact, you could try adding a lvl 2 simple subdiv (don't forget also to limit the rendering level) and another modifier right after it with Catmul Clark lvl 2+ :)

Ian Jones
11-30-2009, 07:59 PM
As suggested above... select 'Simple Subdiv', because currently it looks like it is being rounded by 'Catmull-Clark'

BUZZFX
11-30-2009, 08:27 PM
Thanks Felix, I changed the SubSurf modifier to "Simple" and it squared the edges off but it also made the large poly shapes visible. Maybe I didn't understand you correctly. Do you think my low poly base mesh needs to be subdivided more? How do I subdivide the mesh in Blender.

Ian Jones
11-30-2009, 09:28 PM
Yes, the low poly base mesh needs to be subdivided more. This is because of displacement which needs a high-res mesh to produce high-res results. Using a subsurf modifier set to 'simple subdivision' allows you to increase the levels of subdivision without modifying the base mesh.

handlebar
11-30-2009, 09:50 PM
It's your base mesh that is wrong, you need to add supporting edge loops to create the sharp edges. These links might help
http://www.gorillacg.com/home/3d-polygon-modeling/subdivision-surfaces-overview
http://www.gorillacg.com/home/3d-polygon-modeling/subdivision-topology-artifacts

BUZZFX
12-01-2009, 04:50 AM
Thanks Ian & Steve. I'll subdivide the edges more, then give it another go! :)

CGTalk Moderation
12-01-2009, 04:50 AM
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.