PDA

View Full Version : Multi-wavelength rendering in C4D?


Lovas
05-01-2005, 10:03 AM
I appologize if this subject has been addressed before, I couldn't find it. I'd like to achieve multi-wavelength refraction effect in Cinema 4D. In real physics, every wavelength of light has got different refraction index, so when light refracts through transparent object, some multicolored "effects" appear.

My basic idea is to simply create three separate files of the same scene and then change the colors of all light sources and refraction indices of all transparent materials in each scene accordingly: in the "red" file turn off blue and green colours for all of the lights on the scene and set separate refraction index for all tranparent materials, and do the similar procedure in "green" and "blue" files. After rendering I'd have three images (red, green and blue) that can be used as layers in raster/compositing software and effectively joined using the Screen function.

The above procedure would supposedly give the real multi-wavelength look to every C4D effect, including accurate spectral difraction with caustics etc. But it is a rather time-consuming and error-prone procedure. In case of using a hdri light source, it also involves changing the hdri textures used.

So the question is: is there another, faster way to achieve that using C4D renderer? External renderers are out of the question - I want a solution that will work equally efficiently for every c4d scene, not just ones especially prepared for a particular external renderer. Also I'd prefer a solution that does not involve use of commercial plugins.

Ernest Burden
05-01-2005, 02:18 PM
Have you done a simple test of this? Your idea sounds workable, essentially creating the three channels of an RGB image.

Do you know what the spectral IR deviations are to put into each file?

No, I cannot think of another way besides what you said. You should test it first, see what you get.

c-montesano
05-01-2005, 02:28 PM
That technique was brought up here: http://www.cgtalk.com/showthread.php?t=226376
Also another method using scene motion blur and animating transparent color/IORs i think.

If I may ask, why would you have to change HDRI textures?

-chris

Lovas
05-01-2005, 02:44 PM
No, haven't tested the idea yet, I'm currently working on a project and haven't got time to try it. I'll do it soon.

That's why I posted the question here - in order not to invent hot water in case that there's already an easier solution that I do not know of... And also to hear different opinions or maybe a better idea.

I'm also thinking of a possibility to do it in a single, three-frame animation c4d file, animating light colours and refraction indices - thus simplifying the task a little bit... (arrgh... I miss so much a simple mel-like scripting language in C4D!)

I'll publish the results of my first tests in this thread later, when they are done. If there are some of you who had conducted such tests before, I'll be glad to hear your experiences and see the resulting renders.

As for refraction indices for three elementary colors - it can be calculated from the Snell's Law (see http://www.answers.com/main/ntquery;jsessionid=4ndwtea5mcbsp?method=4&dsid=2222&dekey=Snell%27s+law&gwp=8&curtab=2222_1&sbid=lc04a ) - but for first experiments I don't need such a precision - we could say that IR for white light passing from air to glass and vice versa is between 1.43 and 1.47 - so first value can be used for red and the latter for blue and one in-between for green.

Lovas
05-01-2005, 02:49 PM
That technique was brought up here: http://www.cgtalk.com/showthread.php?t=226376
Also another method using scene motion blur and animating transparent color/IORs i think.

If I may ask, why would you have to change HDRI textures?

-chris

thanks for the link I'll check it out right now! You're right, i forgot: the light from HDR textures is ignored by the cebas advanced renderer when calculating caustics. That makes the task even simpler.

ADDED LATER:
extracting channels from rgb images is much simpler than changing colours of all the light sources, of course. Excellent! So the whole process is much easier to automate. Thank you for the info so far!

Lovas
05-02-2005, 01:44 PM
Well here's the result of the first test render:


http://freeweb.siol.net/impact/dlovas/joined_00.jpg

And here's the same scene as it appears without the processing - ordinary render:

http://freeweb.siol.net/impact/dlovas/ref.jpg

I must tell I'm rather satisfied with the effect achieved. I used the following values:

RI glass, red light: 1.43
RI glass, green light: 1.45
RI glass, blue light: 1.47

RI water, red light: 1.30
RI water, green light: 1.32
RI water, blue light: 1.35

I simply animated the refraction indices in a 3-frame animation, rendered the frames into separate images and then extracted the appropriate channels and joined them to form the final image.

If there's anybody still following this I'll be glad for any comment or suggestion.

Byla
05-02-2005, 02:21 PM
jeez, you have time to burn dear Mr.Big:thumbsup:

Lovas
05-02-2005, 02:46 PM
jeez, you have time to burn dear Mr.Big

....says the man with over 500 posts on this Forum:twisted:

(glad to hear from you, dear Mr. Byla :thumbsup: )

Actually I'm using an already prepared simple scene with the glass for such tests - so I just animated the RI's in the two materials (a couple of minutes) this morning before going to sleep and after a couple of hours when I woke up it was there. Another couple of minutes in PaintShopPro...

(Spanje je drugače zguba časa, stari...:) Danes pa sem si prvič med prazniki vzel en dan za vse mogoče bedarije... oz. eno dopoldne, ki pa se je zavleklo... Še celo planiram presenetit punco z večerjo:) )

Byla
05-02-2005, 05:19 PM
hehe, good luck with the dinner :)

CGTalk Moderation
05-02-2005, 05:19 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.