-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Adding light position configurability for surface
and mesh3d
, and general lighting configurability for the latter
#556
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
Conversation
As of now, the CI check obviously fails for the reason that the package dependencies haven't yet been bumped and pushed to the NPM repo so it doesn't find |
@@ -182,6 +206,20 @@ module.exports = { | |||
min: 0.00, | |||
max: 5.00, | |||
dflt: 0.2 | |||
}, | |||
vertexnormalsepsilon: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe vertexnormal
and facenormal
would suffice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@etpinard it's quite specific to to the epsilon error terms in the normals calculation and these names would be suggestive of passing on the normals directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Agreed. I won't be the most used attribute nor is it the most obvious ; might as well be verbose. 👍
@monfera looks like your patch led to image test diffs: Is that on purpose? |
@monfera great work 🎉 Thanks for bringing our Before merging this in:
|
@etpinard yes, I knew about the image diff but haven't yet pushed the commit for its solution. Also I agree with your list and push commits, and pls. see my reply on the naming. |
2386922
to
10a2ca7
Compare
}, | ||
roughness: { | ||
valType: 'number', | ||
role: 'style', | ||
min: 0.00, | ||
max: 1.00, | ||
dflt: 0.5 | ||
dflt: 0.5, | ||
description: 'Alters specular reflection; the rougher the surface, the wider and less contrasty the shine.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. These descriptions are great. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙇
@etpinard regarding the coercion of I added commits to this PR such that the directional light position is being sent to The different lighting cast on the yield curve highlights an issue with the specific test case. I'll look into that but it is unrelated to this PR; even in the former image, the unexpected shady bands are somewhat visible. |
@etpinard I didn't want to fiddle with your PR checklist above but I think they were covered by late yesterday, and today's commits made light positions work with |
surface
and mesh3d
, and general lighting configurability for the latter
dflt: 1e-6, // even the brain model doesn't appear to need finer than this | ||
description: 'Epsilon for face normals calculation avoids math issues arising from degenerate geometry.' | ||
} | ||
}, surfaceAtts.lighting), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Can you elaborate? If I understand correctly, |
eddc43b
to
2fc27f1
Compare
… dependencies that now take these new params. The default values are set such that 3D mesh models with minute triangles are also properly included in the GL specular light reflection calculation.
…stly improved Snowden head)
…s. Not covered: specular and its constituent parameters.
Set a different default light position for surface vs mesh
@monfera Fantastic work. You win the PR of the week 🏆 |
Part of the fix to #552
The fix isn't actually to the 'plotly.js' repo, but rather, the dependencies are changed such that epsilon values can be passed on to them. The alternative fix in the dependencies (changing the epsilon in the
normals
repo) was deemed less good because the epsilon is better be configurable in the dependencies.PRs in dependent issues:
mikolalysenko/normals#2
gl-vis/gl-mesh3d#5
The other part of the fix is even less to do with
plotly.js
(except bumping the dependency version number): gl-vis/gl-mesh3d@b901f89Adding epsilon configuration in order to pass it on to newly modified dependencies that now take these new params. The default values are set such that 3D mesh models with minute triangles are also properly included in the GL specular light reflection calculation.
WIP because: