MAXON CINEMA 4D: Cinema 4D Forum Adobe After Effects Forum

Coloured transitions within transparent objects

COW Forums : Maxon Cinema 4D

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
John McMullin
Coloured transitions within transparent objects
on Jun 18, 2018 at 8:44:02 am

Hi everyone,

What I'm trying to achieve is to simulate a gel-like object with 3 dimensional, soft transitions in the colour within it. I've tried to achieve this effect by placing a differently coloured object within a larger object but the refractive index always shows a hard transition between the colours. This happens even if the two objects have the same refractive index or if the inner one has an index of 1 (which wouldn't normally show refraction outside of another object).

I thought that maybe there is a way to kill refraction for a single object and put in transparency and an absorption colour. But I don't know how to do that.

Many thanks if anyone knows how to achieve this.

John


Return to posts index

Steve Bentley
Re: Coloured transitions within transparent objects
on Jun 18, 2018 at 7:41:10 pm

So like a Jello mold with the core being deep red and that fades to the outer color of green? (how festive!)

I haven't tried any of these but...

1) What if you apply a fresnel effect to the transparency of the inner object so that its edge just sort of fades away. If you make both the outer object and inner object the same RI you shouldn't sere that transition (I haven't tried this but it would work in a physical sense in the real world)

2) What if instead of doing it with the color of the material you do it with light. Put a light in the center of the object that has a distance fall off that is not quite the edge of the object and have that light red, and then have lights surrounding the object that are green with fall offs that don't reach the core. You could make all these non specular lights (so you don't get a bunch of highlights) and then do some studio lighting with just spec hilight lights where you want them. These studio lights would not add to the brightness of the object, just the highlight.
If this creates an object that is too evenly lit you could use additional white lights with negative values to reduce light in some areas.

3) I haven't tried using the subsurface scattering effect with a transparent object but that might work as well using a modified version of idea #2

4) You could try a 3D noise with a really big scale and a blob of one color of the noise being the size of the core and the rest of the noise being the other color. So mapped to a flat the noise would look like a grad from one color to the other.

5) What about a pyrocluster shader but invert the puffy gradient so edges are sharp. And use two different colors within that "puff".

6) Depending on shape of object, you can often put a card behind the object that is a grad of the colors you want and have the gel object refract the card through it. The card would always face camera and always be on the back side of the object. We use this trick to get just the right look to full coke bottles. Sometimes you can put a compositing tag on the card and have it not be seen by the camera and only be the refraction and transparency.



Return to posts index

John McMullin
Re: Coloured transitions within transparent objects
on Jun 19, 2018 at 11:04:04 am

Thanks Steve,

Point 1 is something I'd tried but I was having the RI showing both the objects bending the light even though they have the same RI. Maybe it's something I'm missing but it doesn't seem to work like the real world in this regard.

Point 2, visible light idea is good, but you can't make area lights linked to objects visible so you just get spheres or planes. I was hoping to have tendrils of colour in my gel material.

Ideas 3 to 4 I'll give these a try.

The other thing that occurred to me is that it might be a two-pass thing. Render out two different objects and then comp. them in After Effects. But I was really asking this question to find a quick and easy method. Seems to me the problem is due to trying to look through two different transparent objects without the light exiting to air first. And C4D isn't set up to do that.


Return to posts index


Brian Jones
Re: Coloured transitions within transparent objects
on Jun 19, 2018 at 2:44:56 pm

your internal object should have Total Internal Reflection and Exit Reflections turned off in Transparency and there should be no Reflectance at all. If you turn those things off you can play with IOR


Return to posts index

Steve Bentley
Re: Coloured transitions within transparent objects
on Jun 19, 2018 at 6:32:26 pm

I guess another thing we need to know is how are you rendering. With GI? With another render engine?
Should the gel be luminous or not?
For the tendrils you could do that with particles or a cloner or the hair engine.



Return to posts index

John McMullin
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 4:19:18 pm

Hi Brian. I tried turning off total internal reflection and exit reflections and it hasn't made a difference.

Here is a link to an example. It's just two glass balls, one inside the other. Not what I'm actually doing but just testing the concept. I'm aiming to have the inner ball appear as transparent (with a red colour) without additional bending of the light.

12462_glassball.c4d.zip

Thanks a lot. Sure it's something simple I'm doing wrong.

John


Return to posts index


Steve Bentley
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 4:59:29 pm

after playing with this for a bit it seems that the refraction of the inner object is added after any kind of feathering done - whether that be in the alpha channel or the trani channel (I've tried both grads and fresnel). And that refraction will always have an edge because the refracting geometry does. ( I haven't tried a pyrocluster shader yet)

If you put the refraction index to 1 (no refraction) it works well but that removes any of the sexy glass effects. So you might have to dual pass this effect. One pass will be everything except the refraction and then composite the refraction elements on top. And even then the inner objects refraction will have to be rendered on its own with a supporting alpha to feather it.
I thought setting the refraction to 1 on just the inner object would work (with a fresnel fade off at the edges) but it seems that the refraction algorithm works on all objects within any surrounding refracting body no matter what the inner body is set to.

Personally (especially with the tendril idea), I would want to render that element out on its own anyway so that I could comp and finesse how it blends into the outer object and the scene as a whole.
Octane or Vray may handle this better. A true ray tracer may have better luck when the ray contacts that feathered boundary of the inner sphere. But that will add huge time to the renders. Or it may just be a stacking order issue with C4D as whole (refraction after transparency). Houdini could do this.

There are a few other gotchas with glass objects - motion blur doesn't work on anything seen through the glass, neither does depth of field. Glass over nothing has all sorts of complications especially if there are semi transparent areas - those areas don't always map to the alpha properly when there is no background. Luminous glass objects also don't always work depending on whats behind them.
So whenever we starting thinking about doing glass, there is always a "lets think about this" moment to make sure we've covered all the basis for what it has to do in the scene.

What is the final object going to be/look like? Maybe there's another way over the cliff?



Return to posts index

Brian Jones
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 6:37:10 pm

Like Steve, playing around with it, there doesn't seem to be a way to stop refraction even at 1.0. We tend to think of 1 as no refraction but it's the refraction of air which does have refraction. You can get what you want (at least in this test) in the Corona renderer since it has a switch to turn off refraction (for glass panes etc where refraction is not needed would just slow things down to no effect) but nothing like that that I know of in the standard renderers.


Return to posts index

Steve Bentley
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 7:18:17 pm

Good point Brian on the index of 1 being for air and not really none (poor accuracy on my part). But if in the the project settings, air density is set to 1 then for all intents and purposes an object with IR set to 1 will have no visible refraction and just be clear. This discussion has me wanting to mess with C4D with both positive and negative numbers both in the project settings and the object settings and see what kind of trouble I can cause.



Return to posts index


John McMullin
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 9:42:09 pm

Brian and Steve,

Thanks so much for your advice on this. The idea was for a semi-transparent, candy character (mostly a head) that I was texturing. I was putting some patterns on the material and felt that they looked like a skin, rather than like they were running through him.

It's a personal project I was playing with and I didn't want to have to jump through hoops or spend a very long time achieving it. But the Corona renderer idea looks promising as it's free for c4d whilst it's in beta. I'll get back to it in a few days.

Thanks again.

John


Return to posts index

Brian Jones
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 11:26:57 pm

here's a test image



Return to posts index

Steve Bentley
Re: Coloured transitions within transparent objects
on Jun 20, 2018 at 11:37:06 pm

Coool! I'm hungry already! Gummies inside gummies. Is that the Corona renderer Brian?
In the sort of meniscus area at the bottom of the outer sphere (where there is no yellow or orange) is that refraction or reflection? If reflection, I don't see the squiggled floor reflected. Is that a limitation of Corona or a choice?



Return to posts index


Brian Jones
Re: Coloured transitions within transparent objects
on Jun 21, 2018 at 12:41:00 am
Last Edited By Brian Jones on Jun 21, 2018 at 12:44:08 am

that's Corona - the area you are looking at is refraction from the sky image lighting the scene. It actually has picked up the yellow of the larger sphere. I'll post the file so you and John can play with it if you want. It's massively simple, of course, but has some things in it you have to get used to with Corona if you are used to more complex renderers (at least to set up) - it's a lot simpler than most other engines (that I've tried) and will also let you use most of cinema's channel shaders directly (ie all the noises etc) without having to put them in an image node (like in Cycles)
I'm using the latest version the 1.7 beta1 bottom of their downloads page

12464_geltestc.c4d.zip


Return to posts index

John McMullin
Re: Coloured transitions within transparent objects
on Jun 21, 2018 at 5:00:03 pm

That image is perfect for what I was trying to do so I'll download Corona as soon as I'm back on it and see if I can do something nice. I had a look at the Corona website and quite excited to try it out. The interactive way you can change the exposure looks really nice.

Thanks a lot for all the feedback.

John


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]