Author Topic: Layering Alpha Channels with Different Mappings  (Read 1944 times)

2018-11-14, 19:34:33

Br0nto

  • Active Users
  • **
  • Posts: 47
    • View Profile
I'm trying to fake some headlight fog with a series of layered shaders. First, I have a layered material that contains a white diffuse/fresnel opacity shader, with an additional opacity gradient on top to make it fade out as it leaves the headlights. This part works fine:



However, I also want to add a fade just as it touches the road to avoid a hard transition. The trick is that it needs a separate mapping, since the cones are using a cylindrical map and I need to do a flat map to align with the road:



The problem I run into is that I don't know how to combine these two together in a way that merely adds the second alpha fade to the original headlight layered shader. I tried making it a second material tag mixed on top of the first, but that only gave me stuff like this:



Any ideas? Thanks!

2018-11-14, 20:21:11
Reply #1

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8779
  • Let's move this topic, shall we?
    • View Profile
    • My Models
3ds Max or C4D?
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures

2018-11-14, 20:21:40
Reply #2

Br0nto

  • Active Users
  • **
  • Posts: 47
    • View Profile
Oh, sorry, Cinema 4D R19, with Corona B2 (core 3).
« Last Edit: 2018-11-14, 20:29:14 by Br0nto »

2018-11-15, 23:35:26
Reply #3

davetwo

  • Active Users
  • **
  • Posts: 298
    • View Profile
Try C4Ds native projection shader

2018-11-16, 10:44:23
Reply #4

Beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 3811
  • Bengamin
    • View Profile
    • Cormats
Have you tried the volumetric material?

Bengamin Jerrems l chaos-corona.com
3D Support Specialist - Corona l contact us
Corona Uploader l Upload
Portfolio l Click me!

2018-11-16, 20:57:12
Reply #5

Br0nto

  • Active Users
  • **
  • Posts: 47
    • View Profile
Try C4Ds native projection shader

That did the trick, thanks!






Have you tried the volumetric material?

I tried that first, but this particular scene has some quirks that prevented it from working as expected. Ideally, the headlights would be a light that matches the shape, and then that would illuminate the volumetric shader and fade as it leaves the light. However, these headlights are made up of a bunch of individual lights to get the reflector look correct, plus separate beams for the road illumination and an IES for the light bleed. The resulting illumination was quite unnatural looking.

When it became evident I couldn't use "realistic" in-scene lighting for the fog, I tried a slight bit of emissive light on the volumetric shader. That had the problem of not fading as it left the light, and I couldn't find a way to fade it out with distance. The emissive light also started shining back on the car, which I probably could have fixed with a corona compositing tag had I continued down that road.

In the end, the subtle faked effect is very adjustable and I can use gradients to fade it at whatever angles I need. The fresnel properties also fade it out automatically as the camera moves in front of the car, to prevent visible edges.

Thanks!