Normals and refraction

Use this forum for general user support and related questions.
Post Reply
mick
Posts: 51
Joined: Mon May 21, 2018 7:57 pm

Normals and refraction

Post by mick » Wed Jun 06, 2018 1:04 pm

I achieved promising results with lenses made of quite fine meshes, and normals interpolated from face normals. Now I want to optimize precision and performance. I need validate my understanding of normals.

My understanding is that (with BIDIRCPU) luxcore takes the normals to bend/curve faces to calculate the ray-face crossing points and angle for refraction. This smoothes the approximation of concav/convex surfaces by meshes. Is this correct?

Lets take it to the extreme with the following vertices, connect each three neighbors to 8 faces, and copy the vertices as normals.
-1 0 0
0 -1 0
0 0 -1
1 0 0

The results would still have the geometry of a cube, appears as a cube, has the shadow of a cube. But the color is smoothly shaded leaving no edges visible in the shading.

And the refraction should actually be like from a perfect sphere.

So it produces the refraction from a sphere but the shadow of a cube???

Here rendered without normals vs. with normals:
image_rgb.png
image_rgb.png

User avatar
Dade
Developer
Posts: 1143
Joined: Mon Dec 04, 2017 8:36 pm

Re: Normals and refraction

Post by Dade » Wed Jun 06, 2018 1:36 pm

mick wrote:
Wed Jun 06, 2018 1:04 pm
My understanding is that (with BIDIRCPU) luxcore takes the normals to bend/curve faces to calculate the ray-face crossing points and angle for refraction. This smoothes the approximation of concav/convex surfaces by meshes. Is this correct?
Only the (shading) normal is interpolated across the face vertex normals, the point of intersection is still the same (i.e. still on the face of a cube).
Support LuxCoreRender project with salts and bounties

mick
Posts: 51
Joined: Mon May 21, 2018 7:57 pm

Re: Normals and refraction

Post by mick » Wed Jun 06, 2018 2:28 pm

So what is the effect of normals on refraction then. They just define which IOR to use for which side of the face? Or is there more like e.g. interpolating angle?

User avatar
Dade
Developer
Posts: 1143
Joined: Mon Dec 04, 2017 8:36 pm

Re: Normals and refraction

Post by Dade » Wed Jun 06, 2018 2:35 pm

mick wrote:
Wed Jun 06, 2018 2:28 pm
So what is the effect of normals on refraction then. They just define which IOR to use for which side of the face?
Yes, the interpolated (shading) normal is used to compute the angle of refracation (in place of the geometry normal, i.e. the triangle face normal). When the triangle is small enough, it produces a convincing approximation of the curved surface.
Support LuxCoreRender project with salts and bounties

mick
Posts: 51
Joined: Mon May 21, 2018 7:57 pm

Re: Normals and refraction

Post by mick » Wed Jun 06, 2018 3:07 pm

Thanks. I think I've a reasonable understanding now.

So even for simple homogenous geometries like spheres there is now way around fine meshes to get precise results for refraction (not for the object itself), right?

User avatar
Dade
Developer
Posts: 1143
Joined: Mon Dec 04, 2017 8:36 pm

Re: Normals and refraction

Post by Dade » Wed Jun 06, 2018 4:19 pm

mick wrote:
Wed Jun 06, 2018 3:07 pm
So even for simple homogenous geometries like spheres there is now way around fine meshes to get precise results for refraction (not for the object itself), right?
Yes because all the objects are approximate as triangle meshes. Anyway, it is debatable because you can easily have triangles small enough to be practically the same of rendering a primitive sphere (given the floating point 32bit precision).
Support LuxCoreRender project with salts and bounties

Post Reply