문제

I'm trying to understand how to use glsl's refract function for ray tracing. Let's say that I have an object with a refractive index of 1.5. If I want to generate a refracted ray, I call refract(rayDir, surfNorm, 1.0/1.5) correct?

However, I'd like to know how to handle the resulting transmission ray when it reaches the other side of the object and leaves. What is the eta value for this function call? Is it 1.5/1.0?

도움이 되었습니까?

해결책

Frankly, I'm not highly familiar with this, but since nobody else is answering:

The 3rd argument of refract() is documented as "the ratio of indices of refraction eta". So what you're suggesting makes sense to me. It the ratio is eta going from material A to material B, the ratio would be 1.0 / eta going from material B to material A.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top