Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add refract #12

Closed
CJT-Jackton opened this issue Mar 27, 2019 · 2 comments
Closed

Add refract #12

CJT-Jackton opened this issue Mar 27, 2019 · 2 comments
Assignees
Labels

Comments

@CJT-Jackton
Copy link

I think the function refract is missing. The following code is stolen from here. I is the incident vector, N is the normal vector, and eta is the ratio of indices of refraction.

k = 1.0 - eta * eta * (1.0 - dot(N, I) * dot(N, I));
if (k < 0.0)
    R = floatN(0.0);
else
    R = eta * I - (eta * dot(N, I) + sqrt(k)) * N;

Please add it thank you.

@redorav
Copy link
Owner

redorav commented Mar 27, 2019

I'll take a look this evening and do some tests to see that it behaves like in fxc and I'll add it. Thanks!

@redorav redorav self-assigned this Mar 27, 2019
@redorav
Copy link
Owner

redorav commented Mar 27, 2019

Fixed via ec88eb1

@redorav redorav closed this as completed Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants