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

OSL displace() function not recognized #6

Open
marksnoswell opened this issue May 6, 2018 · 4 comments
Open

OSL displace() function not recognized #6

marksnoswell opened this issue May 6, 2018 · 4 comments

Comments

@marksnoswell
Copy link

Editor recognizes displace() but on compilation the scanline renderer is throwing the following error
"Displace" is not known.

Is this meant to work? ... or is just not implimented yet?

@lgritz
Copy link

lgritz commented May 6, 2018

displace() seems to be unimplemented, despite being documented. Sorry. The equivalent is simply

P += displacement_amplutide * displacement_direction;
N = calculatenormal(P);

(where displacement_direction is often N, but doesn't have to be)

I'm not sure why it's missing. I suspect we meant to get to it, but somehow everybody just used the code above and didn't ask or point out that the function was not there.

I'll add it to future releases to be complete.

@MasterZap
Copy link
Collaborator

MasterZap commented May 7, 2018

@lgritz Isn't the situation the same with bump() that actually is in the docs but doesn't exist in reality?

/Z

@lgritz
Copy link

lgritz commented May 7, 2018

Yes. And the equivalent of bump is

N = calculatenormal (P + displacement_amplitude * displacement_direction);

@lgritz
Copy link

lgritz commented May 7, 2018

Actually, I think in both of those cases, it's safer if you ensure that the resulting N is still unit-length, by changing where I wrote

N = calculatenormal(...)

to

N = normalize(calculatenormal(...))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants