Author Topic: volume fog  (Read 7963 times)

2019-02-12, 10:06:55

koubankeo

  • Active Users
  • **
  • Posts: 119
    • View Profile
Hi,
is there any way to do this? https://www.youtube.com/watch?v=RbOKWhlxkQM
0:14 global volume distance from ground?

2019-02-12, 11:06:34
Reply #1

Beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 3811
  • Bengamin
    • View Profile
    • Cormats
My approach would be to apply a gradient on the volume material and adjust the settings to get something I'd be happy with. ;)

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

2019-02-12, 14:10:49
Reply #2

koubankeo

  • Active Users
  • **
  • Posts: 119
    • View Profile
Thanks beanzvision, can you send a scene?

2019-02-12, 14:26:37
Reply #3

Beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 3811
  • Bengamin
    • View Profile
    • Cormats
Thanks beanzvision, can you send a scene?

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

2019-02-12, 15:22:13
Reply #4

Br0nto

  • Active Users
  • **
  • Posts: 47
    • View Profile
This is quite cool, but I'm intrigued by the idea of a "distance from ground" function. Is that doable in C4D or only a 3ds Max feature? I would love to have fog that hugs the ground, whereas this seems like a general workaround to blend fog across the flat top of the volume box.

2019-02-12, 15:28:32
Reply #5

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
There is the native Proximal shader, which plays a similar role to the Corona Distance shader in Max. Things I noticed on some quick tests a while back:

- It works only on vertices, not smoothly on the boundary of the selected "distance from" object. Can kind of smooth it out by playing with the distance and intensity
- It only works with editable objects (so, a parametric sphere won't work; also things like Volume Meshers and SDS didn't seem to work)
- IR doesn't update when the "Distance From" object in the Proximal is moved, though it does if parameters are updated or if the object painted with the Proximal shader is moved
- I can't see a way to add noise into the distance parameters of the Proximal (useful for ensuring there aren't hard, geometric shapes in the Inside Volume result, e.g. for a cloud shape). Maybe it could just be multiplied with some noise map in another node?

Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-03-01, 22:04:40
Reply #6

jojorender

  • Active Users
  • **
  • Posts: 241
    • View Profile
Hi,
I’m trying to create the steam on top of a jacuzzi at night. The problem is I can’t get the volume material to fade out. You can see in the screenshots that the steam stops somewhat abruptly at the outline of the volume mesh. I tried a gradient yellowish fog to pure white and also a texture with a gradient to 100% transparency. The texture approach looked even worse.
Can the volume density only be controlled by the “absorption distance”? My distance is set to 40 cm, If my mesh is less than 40 cm the volume should be “clear” correct?
Does anybody have an idea what else I can try to fade out the “fog”, besides “painting it in” in PS ?

Thanks in advance.

2019-03-04, 14:15:02
Reply #7

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
On the Absorption Distance - with a value of 40 cm, after traveling 40 cm through the volume, the ray will have the color specified in the Absorption Color; between 0 and 40 cm it will already be graduating from nothing to the Absorption Color though, so will not be "clear" other than at a distance of 0. Raising the Distance well above the 40cm will make it fade out more. As an alternative, or as an additional effect, you can vary the Absorption Color through a Corona Distance map (Max) or Proximal map (C4D), so that at a certain distance from a certain object the Absorption color is pure white (which counts as zero absorption, that is, no effect).
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-03-06, 13:34:03
Reply #8

jojorender

  • Active Users
  • **
  • Posts: 241
    • View Profile
Hi Tom,
thanks for the explanations. I already tried to wrap my head around the Proximal shader, but I can’t figure out how to use it in this context. Can you point me in the right direction?

“that at a certain distance from a certain object the Absorption color is pure white (which counts as zero absorption, that is, no effect).” 

How does the volume material get mapped inside the volume mesh? I thought I might be able to achieve the fading with a gradient to pure white, but that doesn’t seem to work.

2019-03-06, 15:04:02
Reply #9

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
It doesn't get mapped inside at the moment, just on the surface - there isn't an "inside mode" in the Corona Volume Material in Cinema 4D yet.

On the Proximal, things to keep in mind:

- It works only on vertices or edges, not smoothly on the boundary of the selected "distance from" object. Can kind of smooth it out by playing with the distance and intensity
- The distance parameters are the very odd %, rather than actual distance units
- There's no control for what happens inside the "distance from" object versus outside of it (seems to be just raw distance from vertices)
- IR doesn't update when the "Distance From" object in the Proximal is moved, though it does if parameters are updated or if the object painted with the Proximal shader is moved
- It only works with editable objects (so, objects that are still parametric won't work; also things like Volume Meshers and SDS didn't seem to work).

Very quick Proximal scene attached, but just using Diffuse (altering the diffuse color of the cube based on distance from the edges / vertices of a plane).

Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-03-06, 15:40:36
Reply #10

Beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 3811
  • Bengamin
    • View Profile
    • Cormats
I still think that a gradient in the absorption slot might work. ?  Attached is a quick and nasty scene.

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

2019-03-06, 15:43:56
Reply #11

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
Yep, gradient is fine so long as you aren't having the fog hug a surface that isn't flat (such as a ground with rises and dips in it, and you want the fog depth to follow that rather than be a preset gradient).
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-03-06, 16:31:23
Reply #12

jojorender

  • Active Users
  • **
  • Posts: 241
    • View Profile
Thanks Tom and beanz,
will give that proximal shader another try.
With the gradient you still see a “hard” outline at the mesh edges. I tried round,  irregular shaped meshes and different gradients (circular etc) and also different mapping, nothing really worked.
That's why I was hoping, the volume mat could be 3D mapped inside the mesh.

2019-03-06, 17:06:24
Reply #13

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5434
    • View Profile
Yep, that might be a drawback of the fact that it is only calculated at the surface, and the Proximal shader wouldn't really change that. Should be less obvious with your "steam mesh" though as it has an irregular surface (either with gradient, or Proximal).

It also looks like the Volume shader might not like the Corona Shared Shader, at least if Proximal is in the chain of nodes somewhere, so watch out for that.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-03-06, 17:41:02
Reply #14

Beanzvision

  • Corona Team
  • Active Users
  • ****
  • Posts: 3811
  • Bengamin
    • View Profile
    • Cormats
You could chamfer your edges to eliminate that. ;)
Bengamin Jerrems l chaos-corona.com
3D Support Specialist - Corona l contact us
Corona Uploader l Upload
Portfolio l Click me!