PDA

View Full Version : Spectral colouring in Mentalray


Sully
03-22-2006, 09:14 AM
Hi ive recently been looking into various rendering softwares to see what new features are being used and ive come across this new feature called Spectral colouring...It seems very interesting and im keen to learn more about it so if anyone is willing to share there knowledge here I would very much appreciate it...As i understand from reading up on the maxwells homepage its all about colour space, heres a what ive read!!

"It is very usual, even standard nowadays, that most rendering engines perform calculations in a specific color space (typically RGB). However, this is physically incorrect and therefore Maxwell avoids this approach and considers real world behavior instead. In harmony with reality, Maxwell considers light as an electromagnetic wave defined by a frequency spectrum. Maxwell considers a spectrum which ranges from the Infrared to the Ultraviolet.

Once Maxwell has completed the rendering procedure, each pixel in the output image contains different amounts of spectral energy. This energy was sourced from the lights in the scene and arrives at the conceptual film/ccd of the virtual camera, or at the retina of the viewer. Maxwell stores this information in a new internal format called MXI. The pixel color which is generally the final desired result is an interpretation and sensation of the different frequencies which arrive at the film/ccd or the retina. Maxwell simulates this process and ultimately transforms the spectral measures into known color formats such as XYZ, RGB etc."

Do you know how I would go about setting this up in mentalray or is it integrated into the rendere engine and runs in the background without any user influence? I thought maybe you have to change the framebuffer to some other format other thatn rgb or something like that....HDR images obviously use this colour space as does fg ect but how do you output this info to your rendered image, .hdr or somthing like that?

playmesumch00ns
03-22-2006, 09:48 AM
Basically I'm afraid you're being blinded by the technobabble that is Maxwell's PR department...

The short answer is no, you can't do that in mental ray (at least not yet).

The long answer is that rendering using an RGB representation of colour is not wrong in the sense that Next Limit present it in that quote. If RGB is wrong, then Maxwell's method is also wrong.

As they do correctly point out, light is defined by a frequency spectrum. i.e. a continuous function over all wavelengths. You can't represent this very well in computer graphics, so most software just uses an RGB representation and has done with it.

You can think of this as represnting colour as three distinct samples in the spectrum, that roughly line up with the colour responses of the cone cells in our retinae.

Maxwell basically takes more samples of the spectrum to get a more accurate (but slower to calculate) description of colour. It's still wrong: just less wrong than the old-style RGB method.

To be honest, rendering with a spectral colour representation doesn't gain you that much in most situations. Where it does matter is for simulating things that are heavily wavelength-dependent, like the diffraction of light through a prism. These things just happen automatically when you use a spectral colour representation, but are impossible with an RGB renderer.

That said, there are shaders out there for mental ray that nicely simulate these effects by shooting more rays to represent different wavelengths, then returning the result as a standard RGB triplet. So you can have your cake and eat it too.

HDR images still just store RGB values, they can just represent a larger range of those RGB values than can an LDR image (although if you use an extensible format like TIFF or EXR there's no reason you couldn't store more channels in there). Similarly, internaly most renderers work in floating-point RGB. Notable exceptions are Maxwell, and the free raytracers indigo and metropolight (both of the last two are basically doing the exact same thing as maxwell).

Sully
03-22-2006, 10:02 AM
Heheh excellent playmesumch00ns youve just saved me alot of time there I was gonna spend this afternoon reasearching the subject but i guess its not worth it now...Thanks alot!!

francescaluce
03-22-2006, 05:49 PM
The short answer is no, you can't do that in mental ray (at least not yet).
you can already, with a bit of coding and imagination.
there're not shaders relesead and no dcc that support
this. but mentalray3.4 does spectral rendering and can
manage color spaces other than rgb. looking for next
release probably to have them documented and fully
implemented.

ciao
francesca

Sully
03-23-2006, 08:17 AM
Ive been reading the Rendering with Mentalray Handbook and apparently the box colour space is mentalrays most physically accurate method in 3.4, is this correct? (Cant be if it supports spectral colouring right...) I couldnt find anything about specral colouring though and as playmesumch00ns points out I could only find documentation about floating point colour spaces....Another question is if I can get mr to use the spectral colour space would it work with standard mr materials, im guessing not but would it change the rendered result if I used it with these materials? or are the designed to work with floating point rgb only?:surprised

Sully
03-23-2006, 08:28 AM
Also would it be the Mcolor.h filr we have to edit to change the colour space?:)

playmesumch00ns
03-23-2006, 09:41 AM
you can already, with a bit of coding and imagination.
there're not shaders relesead and no dcc that support
this. but mentalray3.4 does spectral rendering and can
manage color spaces other than rgb. looking for next
release probably to have them documented and fully
implemented.

ciao
francesca

I mentioned that you could do it yourself in my post.

Looking on mental images' website doesn't really turn up much information other than "spectral shaders". I love how you have to spend good money on the handbooks to actually get detailed information on the renderer. Most other companies would put that in the manual. But anyways...

As far as I am aware, the spectral rendering features they're talking about are raytracing and photon-mapping hacks similar to the dispersion and diffraction shaders already publicly available.

CGTalk Moderation
03-23-2006, 09:41 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.