mentalray bump exploited

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  05 May 2005
mentalray bump exploited

Or: mentalray bump, demystified

Many people keep asking if anyone got the custom mentalray bump nodes to work. Because many people think custom mentalray bump nodes are waaay better than the maya's default bump2d nodes. Let's have a look.

First off we need to get the mr bump shading-network actually working. Here's a hypershade snapshot of the raw bump-vector generating part:



The connections are as follows:

mib_texture_vector2.outValue> mib_texture_remap2.input

mib_bump_basis2.u> mib_bump_map1.u

mib_bump_basis2.v> mib_bump_map1.v

mib_texture_remap2.outValue> mib_bump_map1.coord

mentalrayTexture2.message> mib_bump_map1.tex

Whereas the mentalrayTexture is being automagically created and connected when clicking on the checker button next to 'tex' in the mib_bump_map node.

Ok, but what should we do now with the created network? There are several things we could do:
We could plug it into the bump input of one of francesca luce's bumpCombiner, or we could plug it into the NormalCamera (Bump Mapping slot) of any standard maya shader - basically the mib_bump_map has the same output as a bump2d:





Did I say the same? Well, it's not quite the same as you can see. What did happen? I left all settings at default - that was a failure. It's the 'step' vector we need to adjust, just to give you a hint. But why, and more important: how? Here's an explanation:

http://www.cgtalk.com/showpost.php?...65&postcount=18

If you read through the above link, you know: we have to set our step value (the texture is tiled 1-1) to 1/2560, because it has a resolution of 2560*2560 pixels. If we had 2-2 tiles we would have to set it to 1/(2560*2), the formula is

step = 1/(textureResolution*tiles)

Let's see:



Looks better, doesnt it? Because 1/2560 is quite a small number (0.000390625) I decided to write an expression to not lose any precision:
mib_bump_map1.stepX = mib_bump_map1.stepY = mib_bump_map1.stepZ = 0.000390625

You probably ask yourself, how differntly than a bump2d this shaders actually work. Let's compare, here's a bump2d with default settings, I only set the Bump Depth to -0.010 because mr custom bump shaders bump in negative direction, and their factor acts different. Factor 1 is Bump Depth -0.010 in this example:



Bump Filter is 1, texture filter is Quadratic with Filter 1 - all default. Quite dull compared to a standard bump you might think. Let's remove all the filters; but dont set the Texture Filter to off, leave it at Mipmap - I only set the Filter under Effects to 0, as well as the Bump Filter of the bump2d node:



Hey, it's almost the same! Maybe we can assimilate it even more? We can, because apparently the step value of our mr custom bump needs to be 10 times lower and it's factor 10 times higher to compensate the differences - this is the adjusted mr custom bump:



Except a few pixels, the result is exactly the same as with a bump2d. Exciting, isnt it?!

Well... You probably ask yourself what the other available bump node, the mib_passthrough_bump_map is good for. It has the same effect, it is only connected differently to the shading network. Here's a snapshot of what I mean:



Ugh. What's that blendColors node doin there? Well, I guess the mentalray developers simply had a good idea to pass a bump vector through a shading network if you dont have a Bump Mapping slot around, as with all mr custom shaders like the Cook-Torrance or DGS for example. The blendColors color1 is the mib_passthrough_bump_map, and color2 is the lambert. It's Blender value is very low at 0.001, just as low to be non-zero, and the blendColors node itself goes into the mentalray material slot of your shading group. It's a trick of course. The result is the very same though (with adjusted step settings etc.):



So. What are the reasons to use custom mr bump shaders? If you ask me, I dont see any. The bump2d has, with all filters off and mipmap activated, the exact same output. As long as you dont use mr custom shaders plus as long as you dont have no bumpCombiner around, it's wasted time to build this networks (not in every case of course).

In reverse, the bump2d has some big bonus like the Bump Filter and the ability to use texture filters (quadratic etc.) to reduce texture artifacts.

NB: This is a rough comparison between the two methods to get mentalray bumping. It may, of course, not apply to all possible situations. And do try this at home!
__________________

Astro Man
!!!!!!!

Six Tuts On Light And Shade

Last edited by floze : 05 May 2005 at 03:27 PM.
 
  05 May 2005
Great

is there any difrent inn render speed between the two?
 
  05 May 2005
Originally Posted by Osaires: Great

is there any difrent inn render speed between the two?

Custom mr bumps rendered a bit faster in my very simple test. Dont know about complex scenes though. But naturally custom nodes should be faster - it's sometimes a trade between ease of workflow and rendering times.
__________________

Astro Man
!!!!!!!

Six Tuts On Light And Shade
 
  05 May 2005
Originally Posted by floze: Custom mr bumps rendered a bit faster in my very simple test. Dont know about complex scenes though. But naturally custom nodes should be faster - it's sometimes a trade between ease of workflow and rendering times.


shaders from the public libraries (base, physics, contour) were made just as examples for shader writers, to use as a reference. Also, these shaders accomplish very minimal tasks, so you need bunch of nodes to have the "equivalent" maya node. I remember I compared graphically, in one of my old masterclasses (must put those docs online actually), a maya blinn with all its features (reflect, refract...) with a 'base' blinn network matching the same features and a phenomenized version of the previous aka 1 image s better than 50 words.

Anyway, for user which have access to mayabase, the maya 2d/3d bumps are excellent and there is no reason that comes up to my mind to use mib_* shading networks for bump.

other shader such as mib_amb_occlusion are insted very useful for production work.
we will extend the mib_* library with the time, so expect other cool shaders in the future.

p
 
  05 May 2005
Originally Posted by /*jupiter jazz*/: shaders from the public libraries (base, physics, contour) were made just as examples for shader writers, to use as a reference. Also, these shaders accomplish very minimal tasks, so you need bunch of nodes to have the "equivalent" maya node. I remember I compared graphically, in one of my old masterclasses (must put those docs online actually), a maya blinn with all its features (reflect, refract...) with a 'base' blinn network matching the same features and a phenomenized version of the previous aka 1 image s better than 50 words.

Anyway, for user which have access to mayabase, the maya 2d/3d bumps are excellent and there is no reason that comes up to my mind to use mib_* shading networks for bump.

other shader such as mib_amb_occlusion are insted very useful for production work.
we will extend the mib_* library with the time, so expect other cool shaders in the future.

p

Thanks for confirming me in that question, Paolo. I'd love to see the masterclasses you mentioned being online!
__________________

Astro Man
!!!!!!!

Six Tuts On Light And Shade
 
  05 May 2005
I can only see one reason to use that bump shading network, to use it with DGS, for me is the only one.

Cheers.
__________________
3D Animator and TD at www.vortice3d.com

"Don´t trust on affemeral things, only love will last..."

Visit my BLOG: 3djoie.blogspot.com
 
  05 May 2005
Originally Posted by joie: I can only see one reason to use that bump shading network, to use it with DGS, for me is the only one.

Cheers.


yeah, that can be a reason, but again if you have access to mayabase you can obtain blurred reflections/refractions with any specular material shader (there are attributes for that in the mental ray tab of the AE: reflection/refraction blur and relative oversampling).
I have no idea in other OEMs.

p
 
  05 May 2005
Hi floze et all,

Is it possible to plug this MR bump into bump combiner?*

The reason I ask is that with really large .map files (converted with the –r tag) the normal maya file/2dplacement doesn’t work – the image is all skewed and broken.

Using MR texture/remap/vector cures this problem.

Using the MR version of a bump combiner will mean I can use massive .map file for bump and use the region feature of the .map format.

The problem (I have) with the maya file setup is that the .map are reported as being to big and the preview take ages to load (MR textures don’t have a preview .

I want to change all material and set ups to MR and eventually remove all Maya setups.

Big shout to floze for doing all this research, it really it great to read and very inspiring


M

*
Originally Posted by floze: We could plug it into the bump input of one of francesca luce's bumpCombiner, or we could plug it into the NormalCamera (Bump Mapping slot) of any standard maya shader - basically the mib_bump_map has the same output as a bump2d


Doh!

Last edited by MarkAW : 05 May 2005 at 03:00 PM.
 
  05 May 2005
Originally Posted by MarkAW: Hi floze et all,
The reason I ask is that with really large .map files (converted with the –r tag) the normal maya file/2dplacement doesn’t work – the image is all skewed and broken.


wait, do you mean that for smaller file it works fine? - r rearranges pixels in tiles rather than scanlines.
can you quantify "large"? Like 20K? Do you have any conversion problem when running imf_copy? Which version of mr are you using?


p
 
  05 May 2005
Originally Posted by /*jupiter jazz*/: wait, do you mean that for smaller file it works fine? - r rearranges pixels in tiles rather than scanlines.
can you quantify "large"? Like 20K? Do you have any conversion problem when running imf_copy? Which version of mr are you using?


Apologies, I meant I am using really large .map files, I didn’t mean to imply that is worked for small images!

Moving on, will the MR bump a la floze work with this and the bumpcombiner without issues?
__________________
______________________________
____________________________.M
 
  05 May 2005
Originally Posted by MarkAW: Apologies, I meant I am using really large .map files, I didn’t mean to imply that is worked for small images!
Moving on, will the MR bump a la floze work with this and the bumpcombiner without issues?


I don't know, have you tried?

Anyway, if you have enough memory you can use non-tiled textures (imf_copy -p), which are always memory mapped but non-tiled (scanline) and faster to access than tiled ones (which on the other hand have better cache efficiency).


paolo
 
  05 May 2005
Originally Posted by /*jupiter jazz*/: I don't know, have you tried?

Yep, works a treat.

Originally Posted by /*jupiter jazz*/: Anyway, if you have enough memory you can use non-tiled textures (imf_copy -p), which are always memory mapped but non-tiled (scanline) and faster to access than tiled ones (which on the other hand have better cache efficiency).

I’m trying to keep the memory foot print down so MR doesn’t get too upset (also scanline turned off!).

Hmm, does that make any difference?

M
__________________
______________________________
____________________________.M
 
  05 May 2005
Originally Posted by MarkAW: Yep, works a treat.
I’m trying to keep the memory foot print down so MR doesn’t get too upset (also scanline turned off!).
Hmm, does that make any difference?
M


what do you mean scaline turned off? that you are rendering also 1st generation rays
(eye rays) with the raytracer?

paolo
 
  05 May 2005
Originally Posted by /*jupiter jazz*/: what do you mean scaline turned off? that you are rendering also 1st generation rays
(eye rays) with the raytracer?

Scanline in Render Globals, set to off…

I now have a feeling I’m being dense?

Have I got this all wrong?

M
__________________
______________________________
____________________________.M
 
  05 May 2005
Originally Posted by MarkAW: Scanline in Render Globals, set to off…
I now have a feeling I’m being dense?
Have I got this all wrong?
M


relying on raytracing eye rays will slow down rendering
except if you have a very good motivation...
only one I can think of is in some scenes where very small task sizes are required (which is useful if you are doing massive parallell rendering), in that case the overhead of initializing the scanline algorithm could be spared...

I have no idea what you are rendering though...


paolo
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:47 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.