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

Matrix / Vector glsl implementation #111

Open
AODQ opened this issue Jul 18, 2019 · 0 comments
Open

Matrix / Vector glsl implementation #111

AODQ opened this issue Jul 18, 2019 · 0 comments

Comments

@AODQ
Copy link

AODQ commented Jul 18, 2019

matrix / vectors should have GLSL operations. Makes it easier to write/read graphics math, and also makes it easier to transcribe CPU math to GPU math & vise versa.

this includes GLSL free-form functions and swizzling, though the latter is probably difficult to implement correctly.

ei of what it would be able to do

vec3 SomeFunc(vec3 wi, vec3 wo, vec3 nor, float roughness) {
  vec3 H = (someMatrix * vec4(normalize(wi + wo), 1.0f)).xyz;
  roughness *= length(H);
  H = normalize(H);
  return dot(H, nor) * smoothstep(0.2f, 0.6f,  roughness);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants