PDA

View Full Version : Occlusion+displacement problem!


fantasi
09-19-2007, 02:38 PM
I'm trying to do a occlusion pass with some objects that's having displacement maps on. I have done a surface shader, assigned the displacement and occlusion-nodes. I end up with this resault. (there aren't any triangles in the model)
http://thirdimension.se/problem.jpg

If I turn on displace approx, the displacement won't work so I really need some help here! :) As you can see it works pretty nice up on the top where the faces are more planar but I don't want to smooth the whole model or anything like that, not very high-poly either.

Any suggestions?

/Camilla

Kako
09-19-2007, 07:41 PM
It's probably a matter of tweaking your approximation settings.
Just to make sure, this surface which you're displacing is a poly surface, right?
Assign a displacement approximation node to the geometry. Use the Fine View Low Quality preset to see how it works. If you need more details, then lower your length a bit.
Also, make sure you have hard edges in the displaced region.

Kako.

fantasi
09-19-2007, 08:05 PM
Thanks for your answer!

Yes, it's a poly-surface.
I've tried that and it didn't work but i never tried lower the length so i will try that the first thing tomorrow!

jupiterjazz
09-19-2007, 09:20 PM
I'm trying to do a occlusion pass with some objects that's having displacement maps on. I have done a surface shader, assigned the displacement and occlusion-nodes. I end up with this resault. (there aren't any triangles in the model)
http://thirdimension.se/problem.jpg

If I turn on displace approx, the displacement won't work so I really need some help here! :) As you can see it works pretty nice up on the top where the faces are more planar but I don't want to smooth the whole model or anything like that, not very high-poly either.

Any suggestions?

/Camilla

Displacement is an overkill in maya renderer and in mental ray.
Basically you should avoid displacing, *especially* IF displacing NURBS or SDS.
This is because of crappy tesselletion routines. this is valid especially for the raytracer and also, but a bit less (still critical), for the rasterizer.

Anyway.
Since you are using polygons, you can accept a small suffering and still use mental ray, but you must assign manually (Hello mental & AD: the approximation editor is pathetic...) the displace approximation.
Use:

fine view length 0 7 (0 5 is unoptimized), sharp 0

Note that in maya85 (dunno in 2008, but I can guess yes) sharp is exported regardless with a non-zero value to 0.83 (a mega bug...) so you always get some artifacts for free... just try to animate a camera zooming into a displaced geometry.

For any displacement shot I strongly suggest to use a renderman renderer.
Besides, IF your displacement is a low amount, like the small details of a surface, you do not need to use the displaced geometry for the occlusion computation, you can just use the underlying undisplaced geometry for that. Renderman renderers have a per-object option for that called "raytrace displacements".

That's enough for today's episode of 'rendering efficiently'. ;)

p

royter
09-20-2007, 03:24 AM
" Also, make sure you have hard edges in the displaced region. "

....never heard of this thing? what do you mean exactly?







rendering a descent displacements in MR is too hard to achieve.
yes, it can work but i takes hours and hours if your system doenst run out of memory.
i hope this MEGA IMPERFECTION will be fixed in Maya 2008.

jupiterjazz
09-20-2007, 07:01 AM
" Also, make sure you have hard edges in the displaced region. "

....never heard of this thing? what do you mean exactly?

rendering a descent displacements in MR is too hard to achieve.
yes, it can work but i takes hours and hours if your system doenst run out of memory.
i hope this MEGA IMPERFECTION will be fixed in Maya 2008.


Actually 99% of the times you do NOT want hard edges, and you want 'smooth' intepolated edges. That means sharp =0.
The integration (85 at least) always export sharp != 0 for some stupid reason.

So, besides the core-level inability of mental ray to perform efficiently displacement tessellation and its incapability to provide in decent time good visual quality, the situation is also worsened by a bug in the integration on sharp.

fantasi
09-20-2007, 07:34 AM
jupiterjazz & kako, i've tried it with your setting and it will just not work, i can see a little difference (with a microcope :P ), i've tried both lower and higher value on length and it doesn't make any bigger difference. and with hard edges..

any more suggestions?

jupiterjazz
09-20-2007, 07:51 AM
jupiterjazz & kako, i've tried it with your setting and it will just not work, i can see a little difference (with a microcope :P ), i've tried both lower and higher value on length and it doesn't make any bigger difference. and with hard edges..

any more suggestions?


1) Do NOT use hard edges. use sharp = 0.
It could be that EVEN IF you set 0 maya integration is bugged and still applies a different value (0.8.333 or something), you check this by exporting to .mi and searching the .mi ASCII file for 'displace approximation'.

2) use fine view dependent displacement, length 1 or lower, subdivs 0 5 (bugged in ray core) or 0 7 (optimized in ray core).


3) don't expect to get good displacement with mental ray anyway. if you can use renderman renderers.


p

Kako
09-20-2007, 12:22 PM
Also, make sure you have hard edges in the displaced region.
Kako.
Sorry, everybody!
I was in a hurry and forgot about the word "DON'T". :banghead:
At first, I thought that the problem could be with the hard edges because that tend to make your faces separate when using displacements. So I wanted to tell you NOT to use hard edges, as Paolo already advised you.

jupiterjazz & kako, i've tried it with your setting and it will just not work, i can see a little difference (with a microcope :P ), i've tried both lower and higher value on length and it doesn't make any bigger difference. and with hard edges..

any more suggestions?
Is Feature Displacement ON in your objects shape node?!
It must be ON when you're using displacement approximation with mr. If it is off, you won't see the changes you make in your approximation node. It's kind of weird. You keep getting the results of the last settings you had when Feature Displacement was on. That may be what's causing you problems.

Sorry again for the "hard edges" mistake.

Kako.

fantasi
09-20-2007, 03:43 PM
It feels like i've tried everything now and it doesn't work, i don't have more time because of my deadline but thanks a lot for all your help!

And.. i hate displacement :P

jupiterjazz
09-20-2007, 04:01 PM
It feels like i've tried everything now and it doesn't work, i don't have more time because of my deadline but thanks a lot for all your help!

And.. i hate displacement :P

Don't worry, it is not your fault, a good renderer should handle these tasks for you.

Expecting an artist to tweak tessellation settings for trying to get out acceptable displacement - and rarely succeeding even if you are an expert - should be seen only on the sci-fi channel (or should it be the horror channel? ;) )


p

Kako
09-20-2007, 06:22 PM
Don't worry, it is not your fault, a good renderer should handle these tasks for you.

Expecting an artist to tweak tessellation settings for trying to get out acceptable displacement with rarely succeeding even if you are an expert should be seen only on the sci-fi channel (or should it be the horror channel? ;) )
p
Totally agree!
Is this a bad mental ray for maya implementation or is it the renderer's fault? I used to think it was an implementation problem. I'm not familiar with other renderers, so I can't compare them.
Either way, one thing is for sure: displacements in mr for maya is a very badly documented subject! I had a hard time learning the little I know about it, mostly by doing lots of tests by myself to figure out things that should already be clearly written somewhere. And consider that I'm a lot into the theory side, so I don't mind that much to go deeper to understand what's going on under the hood. But I do mind digging up bad docs.
For example, now and then I see someone asking whether they should use a displacement approximation or a subdivision approximation when displacing a poly object. And should Feature Displacement be on or off? Does it make a difference? How can one have a negative displacement? And why are the original polygon faces being separated?
Consider the Feature Displacement thing. Once I spent around two hours trying to figure out what was the problem with my displacement, and it was just that single option, which should be overriden by my disp approx node by default. And it wasn't easy to see what was going on because turning it off and re-rendering wouldn't change anything. It looked like it wasn't making any difference, like if it were overriden. But in fact, it wasn't! The changes I made in my approximation node from that moment on were prevented from having an effect.
And what about the subdivisions limit? When using the fine style, you can set your max to 1, but have your polys subdivided 7 times! This one I don't think is a bad implementation issue because the limits are indeed exported to the .mi file.
Let's hope we have a mr for maya docs revolution. We started to see some good texts since 8.5 and the mia_material. Probably thanks to Master Zap. If we had always had docs like that for every part of mental ray, things would have been much easier.

Kako.

Kako
09-20-2007, 06:28 PM
It feels like i've tried everything now and it doesn't work, i don't have more time because of my deadline but thanks a lot for all your help!

And.. i hate displacement :P
fantasi, I'm sorry that your problem couldn't be solved.
Feel free if you'd like to share your scene with us so that we can test it.

Kako.

reptil
09-20-2007, 07:35 PM
Totally agree!
Is this a bad mental ray for maya implementation or is it the renderer's fault?
Kako.

it's the very bad implementation in maya !! in Xsi you can make good displacement with only one or 2 click
i have testing today 3delight with displacement lol the renderer make displacement so fast than bump lol renderman is very far away than mr for displace and it become very interessting for me:wise:

jupiterjazz
09-20-2007, 10:46 PM
Totally agree!
Is this a bad mental ray for maya implementation or is it the renderer's fault? I used to think it was an implementation problem. I'm not familiar with other renderers, so I can't compare them.


Both.
Integration wise Maya has several bugs and horrible workflows compared to XSI (and even 3dsmax).

Then the renderer itself just cannot handle well displacement due to the intrinsic algorithms involved.

renderman renderers outperform mental ray when displacement is involved up to 2 orders of magnitude on production scenes, and keep memory requirements very low. Not to mention that the visual quality is another world.




Either way, one thing is for sure: displacements in mr for maya is a very badly documented subject! I had a hard time learning the little I know about it, mostly by doing lots of tests by myself to figure out things that should already be clearly written somewhere. And consider that I'm a lot into the theory side, so I don't mind that much to go deeper to understand what's going on under the hood. But I do mind digging up bad docs.
For example, now and then I see someone asking whether they should use a displacement approximation or a subdivision approximation when displacing a poly object.


That's just bad design most of the times due to the fact that who develops the software has low production experience or simply does not use its software.

Anyway, if you have a poly mesh to render as a sds with disp you should use 'subdiv approx', if the mesh does not need to be approximated as a sds before disp, then just 'disp approx'. Nice eh? ;)


And should Feature Displacement be on or off? Does it make a difference?


Bad design again due to the choice to emulate the maya renderer style (which had horrible displacement itself, so in a way the target is accomplished :) )
It makes a difference and furthermore turning it off involves a bug on the export, so leave it ON.


How can one have a negative displacement?


That's just the values in the textures.


And why are the original polygon faces being separated?


bug in the workflow, you can avoid this by tweaking.



Consider the Feature Displacement thing. Once I spent around two hours trying to figure out what was the problem with my displacement, and it was just that single option, which should be overriden by my disp approx node by default. And it wasn't easy to see what was going on because turning it off and re-rendering wouldn't change anything. It looked like it wasn't making any difference, like if it were overriden. But in fact, it wasn't! The changes I made in my approximation node from that moment on were prevented from having an effect.


You are right.
Just use a renderer that works, there are free tools that can do the job way better.


And what about the subdivisions limit? When using the fine style, you can set your max to 1, but have your polys subdivided 7 times! This one I don't think is a bad implementation issue because the limits are indeed exported to the .mi file.


It's not, as I said it is a core problem.
max subdiv is the max number of time you split a microtriangle edge recursively if the length threshold is not reached.
Even if you get decent quality after a lot of tuning, try to animate the camera, deform the geometry and zoom near the object. Artifacts town. Then add 3D motion blur (and even occlusion): rendertime and memory will go to town...

So the rule of thumb:

- need displacement? use renderman.
- you have only / know only mental ray? use bump.




Let's hope we have a mr for maya docs revolution. We started to see some good texts since 8.5 and the mia_material. Probably thanks to Master Zap. If we had always had docs like that for every part of mental ray, things would have been much easier.
Kako.

Kako
09-21-2007, 12:48 PM
Paolo,
First of all, thank you for taking your time and effort to contribute so much to the rendering community. We appreciate it very much. And thanks for the great resource TR4K is.

It's sad to see mr stands behind other renderers when it comes to displacement. I think displacements are a feature of great importance and should have some priority in a renderer development. I hope mental images and autodesk do something about it.
Maybe I should give renderman a try.

Thanks again,
Kako.

CGTalk Moderation
09-21-2007, 12:48 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.