## Normals and refraction

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

### Normals and refraction

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: Posts: 2126
Joined: Mon Dec 04, 2017 8:36 pm

### Re: Normals and refraction

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: 80
Joined: Mon May 21, 2018 7:57 pm

### Re: Normals and refraction

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? Posts: 2126
Joined: Mon Dec 04, 2017 8:36 pm

### Re: Normals and refraction

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: 80
Joined: Mon May 21, 2018 7:57 pm

### Re: Normals and refraction

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? 