2011-01-17

The Re-run-run-run, the Re-run-run (FXPhd class on again!)

For those of you who missed my FXPHD course the other two times it was run... HERE SHE IS AGAIN!







More info in the posts below. Again - this is a re-run, so it is the exact same classes as before... but I will be available in the FXPHD forum for students to ask crazy questions.

See you on FXPHD!

/Z

2010-11-23

mental ray for C4D users!

Aloha folks, long time no post.

Sorry, Zap's been busy with .... stuff.

Also, some other guys than me have been busy and created this neat plugin for using mental ray AND iRay from within Cinema 4D:



It fully supports not only all the standard C4D materials, but also custom shaders in MetaSL, so this is some kick-butt powerful stuff!

Check out the website for more information, coz I must admit I am not an expert on C4D at all, and was not directly involved in this project, so I can't really answer much questions about it, sorry :)

But hey, C4D users - enjoy!

/Z

2010-08-23

More about MetaSL in 3ds Max 2011

Aloha again!

Sorry for not making a proper "post SIGGRAPH post", but I've been "post SIGGRAPH busy". And as always, me being Busy, means good things for you all.... in the future. :)



I've gotten a ton of questions about MetaSL in 3ds Max, and since the public beta mentioned in a previous post has now been discontinued (you can still use the 30 day trial if you like it will time out approximately the same time that the public beta would have timed out anyway), the interest in "what was the app actually doing and can I do it myself" has increased.

So let me explain the process 3ds Max uses to load/use a MetaSL shader:

Max uses configuration files located in the <3dsmax>\mentalimages\shaders_standard\MetaSL\Config directory to define how it works.


First there is a file in this directory named MaxMetaSLNodeTexmap.tbx. This file contains entries of which MetaSL shaders are shown in the MetaSL section in the Slate material editor.

By default, only a handful of shaders are actually in this file, but anyone can open up this file and add new entries for any of the standard MetaSL shaders that ship with max (and all the shaders in mental mill are included in this set).

So by adding a line like, for example


<palette_item type="node_class" node_class="generator_blend_ramp" image="conversion.bmp"/>


...will make the standard shader generator_blend_ramp visible in your Slate "MetaSL" toolbox! (NOTE: You must add it before the closing "<palette/>" line)



That's fine for "standard" shaders, but what about adding your OWN shader?

Well, when max is looking for a MetaSL shader name (technically, a MetaSL class name), it rummages through the file NodeToMsl_MappingTable.xml in that same directory.

This file contains entries similar to these:


<Item ClassName="Color_contrast" XMSLName="color_balance.xmsl"/>
<Item ClassName="Color_gamma" XMSLName="color_balance.xmsl"/>
<Item ClassName="Color_saturation" XMSLName="color_balance.xmsl"/>


This links a class name ("Color_contrast" for example) to a file that needs to be loaded to define that class name ("color_balance.xmsl" in that case).

If we further look into the file "color_balance.xmsl" (which lives in the <3dsmax>\mentalimages\shaders_standard\MetaSL\XMSL directory), we will find it consists only of this line:


<root>
<metasl_code file_name="color_balance.msl"/>
</root>


What we see is that this file simply loads the "color_balance.msl" file (which lives in the <3dsmax>\mentalimages\shaders_standard\MetaSL\MSL directory). Now this XMSL file could have defined a whole phenomena of it's own (of the desired class name), but in this case it didn't... it simply deffered to say "nah, to find that class, just load this MSL file, it will defined that class".

And if we were to open up "generator_blend_ramp.msl" we will find some shader code that indeed defines this shader.


So, to add our OWN shader, all we need to do are the following steps. Assume we have a simple shader that multiplies two colors, like this:
shader mul2colors {
  input:
    Color A;
    Color B;
  output:
    Color result;

  void main() {
    result = A * B;
  }
};

#1: We our shader code in a file in the <3dsmax>\mentalimages\shaders_standard\MetaSL\MSL directory in a file named multi_two_colors.MSL

#2: Create an XMSL file in the <3dsmax>\mentalimages\shaders_standard\MetaSL\MSL\mult_two_colors.xmsl that simply reffers to the MSL file, using the simple format above, e.g.

<root>
<metasl_code file_name="mult_two_colors.msl"/>
</root>


#3: Add an entry in the <3dsmax>\mentalimages\shaders_standard\MetaSL\Config\NodeToMSL_MappingTable.xml file for the new class, mapping the shader name ("mul2colors") to the .xmsl file name ("mult_two_colors.xmsl")

<Item ClassName="mul2color" XMSLName="mult_two_colors.xmsl"/>


#4: Finally, make it visible by adding it to the 3ds Max MetaSL Slate toolbox by adding a line to the <3dsmax>\mentalimages\shaders_standard\MetaSL\Config\MaxMetaSLNodeTexmap.tbx file (prior to the closing "<palette/>" line:
<palette_item type="node_class" node_class="mul2colors" image="conversion.bmp"/>

Note: The name of the bitmap isn't important since 3ds Max creates it's own bitmaps by actually running the shader w. it's default parameters to generate the toolbox icon.


Hope this makes sense?

ALSO, DO NOT FORGET that my FXPHD class is still running... we're in the week 5 "break week" currently. There is still time to sign up (FXPHD allows signups up until the 8:th class week). So be there, or be hexagonal! ;)


/Z

2010-07-23

Heading off to SIGGRAPH 2010

A quick note: Heading off to SIGGRAPH right... now.

Those who want to follow me do it most easily on twitter, and I may post some neat stuff on QiK once in a while:

twitter.com/MasterZap

facebook.com/MasterZap

qik.com/MasterZap

Enjoy

/Z

2010-07-02

MRY201 mental ray FXPHD course to be RE-RUN for July 2010 term

For those of you who missed my FXPHD course back in January, fear not, because it is being run AGAIN this upcoming July term!







Scroll down to my previous postings about the course for more info! Now, this is a re-run, so it is the same classes as before (with some minor updates and corrections, especially to Class #1), but I will still be available in the FXPHD forum for the new students to ask their questions!

For more info about the course click here or just go to www.fxphd.com

For now, though, I'm off on some vacation, coming back in time for SIGGRAPH 2010 in Los Angeles! More about that in a later post!

/Z

2010-06-22

MetaSL in 3ds Max 2011 - demo

After posting my last post, I've gotten a lot of questions around the MetaSL implementation in 3ds Max 2011 and the Mental Mill SE 1.1 beta. Well... to demonstrate this, I've made a little video presentation (actually a shortened version of what I showed at the EUE event mentioned two posts back).

So click here to check out the video, it's 15 minutes of me rambling....




The presentation shows my MetaSL "eye" shader (to be posted soon) run in mental mill, mental ray, 3ds Max viewport, and the Quicksilver renderer.

Enjoy! :)

/Z

2010-05-27

mental mill 1.1 Standard Edition public beta 2

Notice: There is a new public beta of mental mill 1.1 Standard Edition


One particular neat feature with this beta is an exporter I built for it that exports MetaSL shaders to 3ds Max 2011 directly from inside the mill.

The workflow is basically this:

  • Build your shader tree in mental mill
  • Select the root node
  • Go to File->Export
  • Choose the "Autodesk 3ds Max 2011 (Slate Extension)" exporter
  • (First time only: Select your 3ds max installation directory)
  • Hit "Export" button.
  • Start Max

Now you will see the shader in the Slate material editor "MetaSL" category.
These shaders now...

  • ...work in the 3ds Max viewport
  • ...render in mental ray
  • ...render in Quicksilver
  • ...and any other MetaSL compatible renderer!
And the coolest part is that it works even with your own custom made MetaSL shaders, in all above renderers! This is different than the MetaSL support in Max 2010 that was locked to the shader set shipping with it. Not so in Max 2011, you can build your own shaders. They compile automatically in the back and "just work". Even raytracing calls in the shaders get converted to the automatically generate cube reflection maps for Quicksliver, which is quite neat :)





Expect lots and lots of posts on this topic coming soon - for those that are curious about this workflow and want to see it up close, and see me debug some shaders live, pop up in Utrecht, Netherlands, next week (June 3-4, 2010) at www.EndUserEvent.com (see previous post)


Known Issues:

  • There are some known issues with the Lookup_Texture_2d node not showing in the viewport with gamma correction enabled, but I hear this should be fixed in a 3ds Max service pack (hopefully). It still works in mental ray / Quicksilver.
  • If Texture2d inputs exist inside a phenomena in your mill graph but are not exposed to the interface of the Phoneomenon, they will not get properly filled in when loaded into 3ds Max. To fix this, simply expose the "Texture2d" to the interface of the Phenomenon.
Find the download for mental mill 1.1 Standard Edition here

Have fun!

/Z

2010-04-25

End User Event, Jun 3-4 2010, Utrecht / Netherlands

A heads up:

On June 3/4, my good friend Joep van der Steen, author of "rendering with mental ray & 3ds Max" will be - again - hold the "End User Event".

Imagine it as a very tiny and very European and very personal mini-version of Siggraph. There are two days filled with lectures and talks and mingling, and, yeah... it's held in a bar. :) (Well, a bar with conference rooms on the sides)

Sign up now if you want to join in on the fun. I'll be speaking there about MetaSL in 3ds Max 2011 and some other mental-ray-y things.... see you there.

www.EndUserEvent.com

/Z

2010-04-09

FXPHD, closed, done, complete, over. PHEW



Well, that was an interesting ride of 10 weeks of doing FXPHD. And while I really enjoyed doing it, well, it was quite a lot of work (since I'm such a nerdy perfectionist and want to embellish everything to the border of insanity) so I won't be doing it again any time soon....

I have not heard if the FXPHD guys plan to re-run the course, at least it is not being re-run immediately for the current April term starting up in the next few weeks. And of course, if/when it is re-run, it's the same classes run again, so all I have to do then is to hang around in the forums for questions, which is much easier....

It was quite fun to see the progress of the students and I saw quite a few nice renders done by them. I think I made several people see the light of linear rendering... :)



I'll let you guys know when more similar stuff happens. Next up is EUE (more in a future post)

Also, expect some trickle-down effect for the blog. I created some nifty Phenomena for the FXPhd course that I will post here after some polish.... stay tuned!

/Z

2010-03-06

mental ray in Round 6

Check out this awesome short film by Snowball Studios called "Round 6". You may think it is a game cinematic, but it's actually a short film intentionally made in the style of a game cinematic:

Round 6 from Snowball Studios on Vimeo.



This is, of course, mental ray in all it's glory, and what I found most interesting about this is that they have a very cool production blog over at http://round6construction.blogspot.com/ where you can read many more details of the project.

Great work guys!

/Z

2010-02-04

FXPHD update/FAQ - it's still on!

Hello!

Some updates bout my FXPHD class:

I just released Class #4 of my FXPHD course 'production rendering techniques with mental ray'. We are currently having fun doing SteamPunk Robots in a real SteamPunk location:



Perhaps you want to Join the Fun?

The questions I get most often about the FXPHD classes are:

Is it too late to join now?



No. The term may be called "January10", but it is not until 8:th week of the class (sometime in early March) is it actually "too late".

Classes are released once a week over 11 weeks (there's a break week in there), and you can download them at your leisure... however, the advantage of taking the class "live" is the interaction in the forum between the teacher (me) and the students (you, and many others).


Will this class be "Max Only"



NO. As a matter of fact, beggining Class 4 I've taken steps to include explicit information for both Maya and Softimage users, as well as amended one of the earlier classes with specific Maya and Softimage info.

I still do run the major demos in Max, though.

Will there be a lot of button pushing in Max that I will not have use of in Softimage or Maya



Not really. There will be some, but I spend a lot of the time in the class teaching theory and the why of things. How you see the world, why you need to do X, Y and Z. The actual mechanics of doing X, Y and Z is also shown - but frankly, that's in the manual! UNDERSTANDING WHY you do X, Y and Z, and UNDERSTANDING when not to do Y but Q, is where the real information lies. THAT is what I teach.

I had students that doesn't even use mental ray take the class (poor lost souls... just kidding) and enjoy it!

What does it cost me? This isn't free, right?



FXPHD has nice introductory information on their site, but here's the short Zaptronic description of how it works:

FXPHD supplies 41 courses this term (called "January10", even though it stretches over three+ months). One of these courses is my course, "production rendering techniques with mental ray".

To join a term, you pay $330. For this money you get to pick 3 courses freely out of the 41 available, plus are given on mandatory "Background Fundamentals" course, so four courses in all.

Each course has, as said, 10 classes, each class being a 30-60 minute video that you can download when you want (i.e. the class itself is not "live" per se). What is "live" is the FXPHD forum behind the class where studends (you) and the teacher (me) interact and discuss the classes.

Also, on top of your 4 * 10 classes you have chosen, you get access to the first two classes in ALL courses (so you can make up your mind before you choose the 3 you want to take). So that's 37 * 2 EXTRA classes that you get thrown in.

I once computed that this alone is actually 3 solid 24 hour days of video content! Not too shabby :)


Hope this straightens out some ?'s that people may have!


/Z

Softimage defaults issue

Hello!

While teaching my FXPHD course, I stumbled upon a problem I have not seen before. The error is in Softimage 2010 and (I guess) all earlier version that has the mia_material (known as "Architectural" in Softimage) integrated.

The bug is in the default values for the Ambient Occlusion settings.

You will find that the defaults for two values are flopped: AO Shadow Color is black, and "AO Ambient" is set to a 20% gray (0.2 0.2 0.2). The proper defaults are the reverse!! Also, the AO detail enhancement is off (0).

If you use the defaults as-shipped in Softimage 2010, you get an undesired 20% ambient contribution, and your AO will only apply to that light - not your indirect bounce light.



Fixing the default will give you the proper result, and not give you a sudden 20% light coming from nowhere in particular which you probably never wanted, AND will let you use the AO to enhance the detail of your indirect illumination, as the Lord* intended.

Hope this helps!

/Z

* = That would be me in this case ;)

2010-01-01

Introducing - my FXPHD Course - 10 weeks of mental ray training

Welcome to the new year, I hope the holidays were nice to you all....

...so. I have some news:

It has been in discussion for some time (I think I may have mentioned it before), but now, it has finally come to pass:

In the January term of FXPHD, I will be teaching a mental ray course named "Production oriented rendering techniques with mental ray". Yay!

FXPHD is an online training site run by Mike Seymour, John Montgomery, Jeff Heusser and friends (who also are the people behind FXGUIDE, a VFX oriented news site I suggest you also check out if you havn't already)

Note that these courses are not free, but they are not extremely expensive either - and considering the classes run for ten weeks with full participation of the professor (that's me, in this case) in the forums for questions about the class, it's really a pretty good bargain, IMHO.

The standard FXPHD deal is that you pay for a package where you get to sign up for three of their courses. But the cool thing is that you get to see the first two classes of each course anyway, so you can spend your first two weeks of the term browsing around before you make up your mind to pick a (set of) class(es). Also, a freebie "Background Fundamentals" class is always included, with all sorts of topics.

(If you sign up as a new user, and there is a refferal field, fill in "MasterZap".

Here's my teaser clip for the class:





(If you want the FULL FXPHD orientation video (from which the above is my "segment"), it can be downloaded here.)

This course will teach techniques and concepts for rendering realistic, physically based CG elements in a visual effects context (i.e. for integration into live action shots). As it is a hands-on course in using Mental Ray to do these things, it will start with a fundamental treatment of everything from light and pixels through to cameras, response curves and compositing, as well as "learning to see". The course will be performed using the 3ds Max application, but most things apply to Maya and Softimage as well.

The ten classes will be rougly divided like this (subject to change based on feedback):

Class 1:
Pixels vs. Light - What is a pixel? The units of light, and how they map to the RGB values we encounter every day. Shows how the math we apply to pixels can break, and how, if we are not careful, two plus two can end up ten.

Class 2:
Lighting - Understanding the quality and quantity of light. Understanding how real-world lights map to computer graphics lights. Understanding how light gathers and reflects off a surface.

Class 3:
Cameras - Understanding how a real world cameras function map to their computer graphics counterparts. Understanding what film and digital cameras do to the image before you even see it.

Class 4:
Materials I - Using the physically based Arch&Design material to simulate real world surfaces. Learning to see the world, so that one can translate it to CG.

Class 5:
Materials II - More about materials. Using the mental ray skin shader for realistic characters.

Class 6:
Interaction between CG and the Real World - Using the production library shaders to seamlessly integrate CG objects in real-world background plates with reflections, bounce light, shadows, etc.

Class 7:
What Not To Do - Computer Graphics is full of old "traditional" techniques that has stuck around for many years, but that are in conflict with proper physical rendering, and should be avoided. Just because the button is still there doesn't mean you should push it.

Class 8:
Compositing - How stuff that comes out of the renderer goes together, and what can (and should) and can't (and shouldn't) be delegated to compositing.

Class 9:
Technical topics such as sampling, flicker elimination, memory management. These classes may also adress issues that has come up in the forum as needed.

Class 10:
Continuation of class 09



Check it out! I am very excited to do this class, and I welcome you all to join FXPHD!

/Z

2009-12-23

Merry Christmas Everybody



Another year is coming to an end. The next year will kick off with... something fun. But for now - Merry X-mas and a Happy new year!

I will leave you all with a thing I did 10 years ago; I used to have a band called Beat Symphony together with a guy called Michael Gilboe from the US (yes, I used to be into music - crazy, innit?). The whole idea was that we were "100 years retro", and we did a form of 19:th century Baroque-techno.

This was our Christmas Song:





You can see it in higher quality in the original flash version here, (although none of the links at the end work anymore).

Hope the new year will treat y'all nicely, and that 2010 will be the Year of Greatness for everyone!

/Z

2009-11-13

Fire and Ice - rendering Diamonds and Gems in mental ray



They say Diamonds are a Girls Best Friend, but they can be a poor rendering guys worst nightmare.

One of the reasons is the characteristic property of fine diamonds known in the gem business as "fire" - the nice "pretty colors".
These stem from the fact that Diamond is a material with very high dispersion. It is also coupled with the fact that the "cut" of a diamond is specifically made to enhance the "fire" (dispersion) and "brilliance" (ability to reflect light back to the viewer) as much as possible.

But even before we get to the actual dispersion part of things, lets try to see what it takes to render realistic gem's without it first.

Setting up a scene for Gem rendering




We start with a ridicolously simple 3D model. Since I can't model worth crap, I downloaded a diamond cut according to the classic "round brilliant" from here, and made this supercomplex scene:



First, make sure you have your gamma correction enabled, diamonds, like all physical things, should be rendered linearily.





Not gamma corrected - ugly

Gamma corrected - good

Now we need some decent lighting. We need to follow physics as much as possible. Especially we want to avoid nonphysical "hacks" like specular-only lights, lights without shadows, and other things. We really want to light this in the same way a real photographer would light his scene, with realistic lights with all their realistic effects.

In 3ds Max the easiest way to do this is to use the Photometric lights. This will become especially important later when we get to the caustics, because the Photometric lights automatically gives us the proper photon energy for free. That is a little bit more work to achieve in Maya or Softimage (XSI) because you have to set the photon energy up manually.



A key point here is that we make them Target Lights (i.e. spotlights). This is so we get the most efficient distribution of photons. If we didn't give them a direction to shine, our photon emission phase would be much slower because so many photons would get lost in empty space. Make sure you aim the lights where they are needed - this is especially true with caustics.


Since we are using photometric lights, this also requires us to use an exposure control. We will be using the mr Photographic Exposure control, and we need to make sure to check the "Process Environment and Background" checkbox:



We also want to make sure they are area lights. This gives us the nice soft shadows and "soft" lighting that you would use for an artsy product render like this:




Point lights - hard shadows

Area lights - soft shadows

So we enable area lights:



Now these two arealights are not enough, we need indirect light, and to light the scene from the environment as well. To do this we need turn on Final Gathering.

In Maya and Softimage, the very act of doing this will implicitly light the scene from the environment. This doesn't happen in 3ds Max unless we put in a "Skylight". So we add one of those to the scene, and very importantly, set it's option to "Use Scene Environment".




Now we have a little more light:



We are using a default Arch&Design (mia_material) on the gems.
Let us make it more gem-like by a) turning our diffuse to 0.0,
and b) turning our transpacenty to 1.0:




Diffuse = 0.0

Transparency = 1.0

The automatic energy conservation of Arch&Design (mia_material) already makes this a decent looking transparent looking thing... transparency is complete, but still "overridden" by reflections, and the reflections do depend on angle, just like on real dielectric materials. However, by default it is not basing it on the index of refraction, but a custom curve. We need to fix that by setting it to IOR mode!



This makes our transparency a bit "clearer":




Curve mode

IOR mode

The scene is still looking rather dull with the gray background. Diamonds (like metals) are not so interesting looking in-and-of themselves, but area all about reflections and very very bright "pings" of light. Some people may be tempted to cheat this with a bunch of specular only lights, but why cheat when there is a real reason for such effect - reflections of Bright Things.

And what's the easiest way to get some Bright Things, if not an HDR environment map? Lets slap in some interesting HDR environment map. In 3ds Max you do this by adding a Bitmap to your Environment slot, and make sure to set it to a spherical environment: (Note: When doing this you may need to play with the Physical Scale to avoid having the environment map render dark, see here)



This should give us something much more interesting to look at. And note how the background lighting changed in tone to match the environment? This is because Final Gathering is picking up the new environment and getting it's lighting from there:



Actually FG is even picking up some of the concentrated bright spots and creating a form of "faux caustics". We will get to real caustics later, but for now it is looking pretty.

To make our image look nice, we are using the mr Photographic Exposure control. To make it even nicer we are going to do some modifications.

First, images like this, where we want to focus on some nice center object, always benefit from a bit of vignetting (darkening of edges):



Secondly, since these are diamond renders, and we truly want strong "pings" of light, we should turn up the highlights, to make the really bright bits be really really bright:



These are the knobs we used to do this:



And here comes a final little subtlety. This is really hardly a visible change, but I like it. The model is made with absolutely perfectly sharp edges. And a Jeweller will want to sell you on the idea that his diamond is perfectly flat with totally sharp edges.

But reality have no such thing as 100% sharp edges, so I love to throw in a teeny bit of edge rounding, which will make edges catch "glints" and look more realistic. Cue the mental ray render time round corners shader thingy, and you will get...



...this. Yeah, not such a big difference, I know. It does more on other shaped Gem's than the round Brilliant cut, though, so I still suggest you use it.

Taking a shortcut



Another way to quickly get to the place we are now with the material, and be certain that all the settings make sense, is to base it on the Physical Glass preset. All we need to do is to load the preset, and set enable the corner rounding feature (which is off in this preset), to get a very quick and decent result:



However, we are using the default index of refraction of glass, which is 1.5.

The IOR of diamond is 2.42 - so let's change that:



To really make sure we get every single nice "glint" and "ping" of the material, we will disable a speed optimization in the material intended to skip "unnecessary" reflections on the inside of glass objects, which tend to be very weak. But we don't want to loose any light, so we turn that feature off.



Color Gems



Now these gems look a tad blue. This is because the "Physical Glass" preset introduces some blue. Before we go further with the diamonds, lets discussed coloring our gems for a moment.

The quick and "obvious" way is to reach for the transparency color swatch, and set this to a color. While this gives something (which can look pretty nice), it is not physically accurate:



This is because it modifies the color of the ray "at the surface" of the object, whereas real colored transparent object modify the color of the ray gradually as it travels through the medium.

Looking at the gems above (rubies, perhaps?), the small ones are just as deeply red as the big one, and the tip of the big one is just as deeply red as the thickest part of it. That doesn't look... correct.

What we need to do is to enable attenuation through the medium instead. To do this we need to set our transparency color back to white (basically, treat the surface itself as completely transparent), and move to the falloff settings within the material:



We can use the same color as before, but we just have to set up a distance; at how thick a piece of material would you expect to see that color? Thinner than this will be less colored, thicker will be more deeply colored.

NOTE: It is important that this color has no component of 100%, and no component of 0%. If you were to set it to 1,0,0 red, it would be just as bad as the nonphysical setting. A better "red" would be something like 0.9,0.1,0.1, meaning, it lets through a lot (but not all) red, and very little (but not zero) of the other colors.

Here is our result:



But ideal diamonds are pretty much completely transparent, so for our excercise we will turn this falloff inside the mateial off completely! Uncheck the "Max Distance" and get:



We are getting somewhere. One further thing to ensure the largest amount of nice shiny "pings" in our material is to set our area lights to be "visible". Because most glints in a diamond is a reflection of an actual light. Turning this option on will render the area lights as superbright surfaces, that will then be seen refracted through our diamonds.



Caustics



Finally, it is time for those elusive Caustic effects. First we must make sure the material is set up to actually do caustics, since Arch&Design (mia_material) has an explicit option to NOT do that. If we used the "Physical Glass" preset, this will already be set up for us, but lets make sure:



Also we must make sure that caustics are turned on in the render itself. To get nicer "sharp" caustics, I tend to lower the number of photons per sample, and set the filter to "cone".

Generally, the Multiplier should always be 1.0, but we can allow ourselves some artistic licence here and turn it up a tad. But in general, since we are using the photometric lights, we should be getting the physically correct caustic brightness out-of-the-box. If they seem to weak, its probably beacuse people intuition of how bright they "should" be tend to be very overestimated.

We get this image:



Notice how the shadows actually became darker? This is because they were previously faked by simply attenuating the light a little bit, bit now the light is properly concentrated in the caustic effect instead. So this is correct.

A final touch on this image is to apply some glare.

Both real world cameras and human eyes perceive a "glow" around superbright objects, partially due to scattering in the atmostphere, but actually much more due to scattering in the light path (lenses) and the imaging surface itself (the film, the CCD, or our retina).

When adding the "Glare" output shader, we get the following image:



Notice how it looks much brighter without actually being any brighter at all. That's psycho-optics at work. A white pixel just looks white. A white pixel with a glow around it, and you'll be reaching for your sunglasses.... :)

And now - finally - time for Dispersion



Dispersion is when different wavelengths refract differently. I guess the most obvious case of this is a rainbow.

Real sunlight is a spectra containing basically an infinite number of wavelengths at once, and each of the different wavelengths will refract slightly differently... i.e. when a sunray hits a surface, one would (in principle) need to trace an infinite amount of rays around the scene to get the "real" effect.

Computers aren't very fond of doing an infinite number of things - at least not if you want them to ever finish. So there are several ways to simulate this w. various techniques.

The technique we will be using here is a very low-tech one - we simply render the scene multiple times with slightly different IOR's, colorize each of the renderings based roughly on the "color" of that wavelength, and combine the result. Et voila, we have a dispersive render.

To aid in this I slapped together a little piece of maxscript. Go to your Maxscript menu and choose "Run Script". A small dialog will pop up with some options.

Simply put, the script will render your image multiple times, while modifying the IOR of your material. But to do this, it needs to know what "your material" is.

It tries to be clever and find any material named "Diamond", but if it doesn't find it, you will have to click the "pick material" button, and choose the material from the scene that you are using (in Instance mode).

Then you need to set the IOR you want it to use, and how the amount of "dispersion". In gemology "dispersion" is pretty much defined as the change in IOR across the visible spectrum, so I tried to mimic this in the script, but it's a bit hacky and probably not accurate at all, so take it for what it is.

When you are done setting up, you can hit the "Do Dispersion Render" button. (Note: The script does not save the image, you will need to do that yourself from the image window)

The "3 bands" mode does three renders, one each for red, green and blue, and looks like this:



The "6 bands" mode does six renders, for red, yellow, green, cyan, blue and magenta, and is a more subtle effect, but more likely to yeild a "nicer" looking rainbow effect:



And as a final pièce de résistance, we can enabled depth of field on the camera.

In 3ds Max, this is done by using a 'multi pass render effect' on the camera. This is a bit of a misnomer because it isn't really a "multi pass" effect at all, but it re-uses the UI concept of other 3ds Max "multi pass" effects, so that's where you'll find it. Sorry, it wasn't me who put it there :)

You simply set the f-stop of the camera, and you will get the physically correct depth of field assuming that

  • your scene units are properly set up, AND
  • your Aperture Width (in the render dialog) makes sense.


That will give you this "ultimate" render - and we are pretty much done:



Of course, we can exaggerate the dispersion effect for arts sake (simply turn up "Dispersion" a bit):



Finally, the script also supports a somewhat hacky "chromatic abberation" mode, where it introduces the Lume "Distortion" lens shader, and modifies the pincushion/barrel distortion slightly for each of the colored renders, if you want to go really Crazee. This is one result of that:



Hope this was helpful.

Unfortunately, you can't cash these diamonds in a bank, nor sell them on eBay...

/Z