Author Topic: Scene scale affecting refraction behavior  (Read 7254 times)

2013-04-04, 16:20:58

pokoy

  • Active Users
  • **
  • Posts: 1983
    • View Profile
Alpha 4, max 2012

I am seeing a strange bug with large scene scale or if an object is far away from the origin, where objects with refractions (in solid mode) seem to miss their backface and render as if they were single sided.

Here's an example:



The car's glass pane is a thin double sided object with a refracting material in solid mode.
There's an object in the scene located 7000 meters away from the camera. Moving the object to somewhere at 2000 meters solves the problem and everything renders fine:



Notice the headlight also rendering differently (correctly).

Scene units are meters, display units too. The pane is around 0.003 meters thick.

I guess it should be easy to reproduce, if not I could try to supply a part of the scene or another example scene.

2013-04-04, 17:51:26
Reply #1

Polymax

  • Active Users
  • **
  • Posts: 830
  • CG Generalist
    • View Profile
    • maxkagirov.com
Yes, if the scene is far from the center of the world, then there are errors and not only that, there are also other errors, but the problem is not Corona renderer, this problem of 3ds Max. And  Vray will can make errors in such cases (see vraylog).
Corona - the best rendering solution!

2013-04-04, 18:03:01
Reply #2

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
Yes, Corona misses the other face of the glass because of selfintersection protection from numerical imprecisions.  You should not use such small details that far away from the scene center, Corona works in single precision, so this is not easily fixable without slowing it down.
« Last Edit: 2013-04-04, 18:04:42 by Keymaster »
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2013-04-04, 18:17:17
Reply #3

pokoy

  • Active Users
  • **
  • Posts: 1983
    • View Profile
Yes, Corona misses the other face of the glass because of selfintersection protection from numerical imprecisions.  You should not use such small details that far away from the scene center, Corona works in single precision, so this is not easily fixable without slowing it down.

I see, thanks for the info. I know about inaccuracies that may occur far from the origin but never had similar problems in the past (Brazil user), that's why it triggered a 'bug alert'.
Would be good to know when you're leaving the 'safe zone' with scene scale, is there any rule of thumb? I sometimes need to create large objects far away for all kinds of trickery.

Yes, if the scene is far from the center of the world, then there are errors and not only that, there are also other errors, but the problem is not Corona renderer, this problem of 3ds Max. And  Vray will can make errors in such cases (see vraylog).

What other errors exactly? Would like to know to avoid them in the future.

Thanks!

2013-04-04, 18:28:23
Reply #4

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
You can use for example the slider in system units settings in 3dsmax. General rule of thumb is, that 32bit float offers 6-7 decimal places, so you should not make details million times smaller than the distance from origin. In this case, if you have 3mm detail 7km from the origin, it is 2 million times smaller.

Since the numerical errors can accumulate, I would go for 100 000 times smaller details at most.
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2013-04-04, 18:44:53
Reply #5

pokoy

  • Active Users
  • **
  • Posts: 1983
    • View Profile
Ok. The pane rendered correctly with the other object being somewhere at 2500-3000, so it should be safe around 1:1 000 000.

Is there an internal setting for this you could expose to the user, similar to a ray cutoff threshold?

2013-04-04, 19:24:00
Reply #6

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
I've added it in daily builds. But it cannot make the problems go away in all cases.
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)

2013-04-04, 23:28:14
Reply #7

iliyang

  • Active Users
  • **
  • Posts: 32
    • View Profile
As far as I know, VRay doesn't use any epsilons for secondary (including reflection/refraction) rays, but instead tracks the last hit primitive.

2013-04-04, 23:44:06
Reply #8

Ondra

  • Administrator
  • Active Users
  • *****
  • Posts: 9048
  • Turning coffee to features since 2009
    • View Profile
you still need to manage areas where edges meet. I had this and discarded it, it was too ugly
Rendering is magic.How to get minidumps for crashed/frozen 3ds Max | Sorry for short replies, brief responses = more time to develop Corona ;)