Chaos Corona Forum

Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: Flavius on 2020-04-14, 22:31:01

Title: Refraction issues
Post by: Flavius on 2020-04-14, 22:31:01
Hello...

So I've been bashing my head around this... It started initially with the phoenix fd liquid simulator..I thought that is the culprit, then I exported the mesh to Alembic, then I thought that is the problem + many other things until I ended up with this simple setup- a collapsed mesh(Singe sided!) from the ABC file and a simple plane and a ground plane.

I have a ground plane at -60meters. And I have this water plane(with the cutout) and the ,abc mesh at +3 meters.  I don't know how to explain it properly, I think the images shows the issue. If the meshes are separate they render differently, if they are attached they render uniform and with correct depth/absorbtion parameter.

Is there anyway around this? In case you are wondering why I need this, I want to render a big plane with displacement with water and then composit the phoenix fd simulator box on top of it, but I can't do that because of this problem. I've attached another screenshot to see. Look how the displaced mesh (a collapsed edit poly now) looks. This doesn't seem right at all to me.
Even more weird, if I attached the mesh to the plane with the cut, it renders correct!!!

Thanks in advance!

Title: Re: Refraction issues
Post by: sprayer on 2020-04-14, 23:19:48
Did you tried to use box instead plane?
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 09:19:27
I do have the ground plane underneath to properly calculate the absorption parameter. A box wouldn't help me at all, I need a plane because the phoenix mesh I am outputing is a plane basically. It's clearly a corona problem(EDIT: Not only a corona thing:( ), as detached meshes look different and if I simply attach them and do nothing else they render differently.
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 10:21:21
Ok..I am very confused and will go nuts soon...I have tried Arnold and I get the same thing... Separate meshes seem to have a completely different behavior than attached meshes. See the examples...So how come the result is so different by simply using an "attach" to edit poly?

And if you guys know a workaround this, it would be of tremendous help.

Thanks!


EDIT: Going completely nuts with it.... Separate mesh render incorrectly, if I attach them in the same mesh they render differently. I even made a a bigger cut in the plane to emphasize the problem
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 18:18:52
So. Corona-Vray-Arnold-> same broken behavior.

I have asked a friend to try this thing out on RedShift and that renders and calculates things correctly. Is this something related to Embree? Any workaround would be of great help.

I made a test with ART renderer and this one seems to do things right.
Title: Re: Refraction issues
Post by: PROH on 2020-04-15, 19:01:11
Hi. Kind of hard to understand what you are showing, since everything changes in all images, and the materials bump seems wrong when you find it correct.

But here's a long shot: Have you tried to do a "Reset X-form" to all meshes? This is one of the things that changes when attaching meshes. So this could be a reason for change.
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 19:08:16
hi...

it's not about the bump or anything related to displacement. to make things simpler.. I made a simple big plane, and a simple small plane. Smaller one renders very differently.

Title: Re: Refraction issues
Post by: romullus on 2020-04-15, 19:36:22
You are trying to render impossible setup - it's hard to tell what is supposed to be "correct" look. Having said that, i have to admit that Corona still has issues with refractive materials in certain situations.
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 19:41:45
You are trying to render impossible setup - it's hard to tell what is supposed to be "correct" look. Having said that, i have to admit that Corona still has issues with refractive materials in certain situations.

Hi Romullus... I don't know how to explain it better sadly. A smaller plane behaves very differently than a bigger plane. Even if the planes are not connected via polygons, If I attach the smaller plane to the bigger one the appearance changes completely.

I just wanted to render a big plane of water, and then my smaller simulation and composite that on top.

EDIT: Ok, maybe correct/incorrect is not the way to put it. But it shouldn't render so differently. That's the problem. Very inconsistent :(
Title: Re: Refraction issues
Post by: PROH on 2020-04-15, 20:12:20
Hi. I think I know what's going on. I made a test myself, and as you can see on the attached render, the edges of the 2 planes (1 small & 1 big) are darker than the center. This is caused by refracyion + scattering distance.

So if the dark "color-edge" is bigger than the small plane, then it will look darker than the big plane.

You can see how it changes in IR when you move the bottom plane up and down, or adjust the scatter distance value.

Hope it helps
Title: Re: Refraction issues
Post by: antanas on 2020-04-15, 20:13:17
Flavius sent me the scene to test it out and I rendered one of it's earlier versions in Cycles for Max and Redshift prior to that (sadly I didn't save the renders from rs)  - no such weird behavior in neither of those - maybe it's some sort or an Embree bug after all cause the renders who do suffer from that behavior are embree based (Arnold, Corona, Vray) which might explain it cause neither Redshift or Cycles (in it's gpu mode which I used) are not - not so sure about Art renderer though.
Title: Re: Refraction issues
Post by: romullus on 2020-04-15, 20:29:20
Antanas, does material in your examples has refraction? I know, that from such angle, reflection normally overpowers refraction, but it still should be visible even if barely. Maybe for this test we should disable reflection at all, so it wouldn't distract from results.

Also, the fact that Cycles or Redshift renders what seems to be expected, that doesn't mean they are physically correct, because the setup itself isn't physically plausible. Maybe those renders are cheating, or cutting corners and coincidentally that led to better looking outcome :]
Title: Re: Refraction issues
Post by: antanas on 2020-04-15, 20:35:57
Yeah, it has a refraction but it's not a native Cycles for max material - I used a regular physical one cause my knowledge of Cycles is limited at best.
You might be right about both of them cheating, no arguing there but we sure need that kind of cheating option in Corona too, otherwise dealing with such scenes which is impossible or rather unfeasible to do in corona at least when we talk about animations which Flavius needs doing, cause it would simply take ages to render on any kind of hardware if done physically correct - the water depth of 60m would see to that ))))
Title: Re: Refraction issues
Post by: Juraj on 2020-04-15, 20:39:56
I can clearly see refraction in Antannas image (box to the utmost right), unless it's some hack :- ).

Where do refractive rays travel if their volume is defined by two planes (the actual sea level, and the ground object), but nothing else, no actual enclosed volume?
How does it calculate its virtual volume? Do these "extents" change based on object's bounding box or something?

(side-note, is it in any way affected by ray directionality, somewhat further fake?)
(side-note 2, I don't think index differs for reflection and refraction, both should be 1.333 imho)

I plan on making this same scenario for long time, so very interested in outcome!
Title: Re: Refraction issues
Post by: Flavius on 2020-04-15, 21:45:27
Hi all,

Thanks for looking into this. I have simplified the scene, organized it a bit. You have a big plane, a small plane, the ground and two materials of water, one with sub-surface scattering and a simple one to test them out. the SSS one darkens the edge of the plane.

If there is any workaround this that would be amazing. What I need is the small plane to have the same look as the bigger one so I can blend them in post production.

P.S. The reason why I am not using the Ocean Mesh generation by Phoenix is that the displacement is really bad compared to Corona's and even if I increase the ocean subdivisions from Phoenix, the "transforming vertices' stage takes over 2 minutes @1080p which is not acceptable.

Thanks again!
Title: Re: Refraction issues
Post by: sprayer on 2020-04-15, 22:47:57
(https://i.imgur.com/8vwbsuA.jpg)
Is this what you want to achieve?
As i suggest i made closed shape from small plane and have to turn off cast shadows from small plane

(https://i.imgur.com/P1qSnDs.jpg)

Title: Re: Refraction issues
Post by: Flavius on 2020-04-16, 07:59:08
Hi,

Thanks for looking into this I kind of understand what you did but when rendering I need only the small plane, the thing is I cannot make the small plane to a box. Here, I am attaching another image to try and explain my issue. This is what I need.

To try and explain the situation I made a hole in the bigger water plane and simply attached my wave mesh. See how the refraction behavior changes. This does not seem normal to me. I left a big gap between them just to showcase the peculiarity.

Title: Re: Refraction issues
Post by: PROH on 2020-04-16, 12:14:50
@Flavius - just an idea (haven't tested it). What happens, if you attach 4 tiny meshes, placed at the outer corners of the big mesh, to the small mesh? This way the small piece gets the same bounding box as the big piece.

As I said, I haven't tested it.

Hope it helps
Title: Re: Refraction issues
Post by: Flavius on 2020-04-16, 13:00:49
@Flavius - just an idea (haven't tested it). What happens, if you attach 4 tiny meshes, placed at the outer corners of the big mesh, to the small mesh? This way the small piece gets the same bounding box as the big piece.

As I said, I haven't tested it.

Hope it helps

I was thinking of a similar thing last night, I will test it out and see how it behaves. ty
Title: Re: Refraction issues
Post by: maru on 2020-04-16, 13:40:00
Try rendering this with the following option and see if it changes anything:
1) Enable devel/debug settings - https://coronarenderer.freshdesk.com/support/solutions/articles/12000021288
2) Go to Performance > Development/Experimental stuff
3) Enable "Use legacy medium resolving" at the top, right under "Basic configuration"
Title: Re: Refraction issues
Post by: Flavius on 2020-04-16, 14:38:42
@PROH the trick didn't work, I left some polygons on the edge of the big plane, attached my waves mesh, it does change the appereance a bit, but only a tiny bit (which is absurd anyway as the polygons are really far away and there's nothing else between them and the mesh)

@maru- using legacy makes no difference sadly :(

Oh well...
Title: Re: Refraction issues
Post by: Flavius on 2020-04-16, 15:06:10
!!! I have literally went into rage mode and I've started to change all the parameters from the developer rollout in Corona. Embree on/off, Pathtracer, VCM, Light Tracer, PPM, VPL, terminat shandling, adaptivity on off literally everything.

AND THEN... (David Gilmour song reference)

I noticed the setting "ENVIRO DISTANCE" !!!! I have lowered that to 500m AND I get the identical results regardless if there's a smaller plane or a big plane. Still the values seem messed up to me and this only works with the Distance parameter in volumetric scattering is higher than the enviro distance. I had to lower my ground plane at -300 meters otherwise my water would've been too transparent, and the planes would have very different refraction results (So the problem I had before but more accentuated). I have just discovered this so I am still looking into the numbers.

EDIT: overjoy too soon, at different angles there are differences again but smaller...I hope I can adjust them in post though.
Title: Re: Refraction issues
Post by: romullus on 2020-04-16, 15:46:53
Maybe try to add walls around your ocean so that refracted rays would always hit  some geometry and you don't have to fiddle with enviro distance.