-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Feature implementation: spotlight() #3913
Conversation
</head> | ||
|
||
<body> | ||
<header> |
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.
Small note, can you remove this? Not applicable here as far as I can tell
let color, position, direction; | ||
const length = arguments.length; | ||
|
||
switch (length) { |
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.
Good job juggling so many different parameters!
* <code> | ||
* function setup() { | ||
* createCanvas(100, 100, WEBGL); | ||
* setAttributes('perPixelLighting', true); |
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.
Part of me feels like we should set 'perPixelLighting' to true by default. These lines can feel unnecessarily complicating for the lighting references.
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.
I agree, and I think the per-vertex lighting looks pretty ugly. I also feel like the setAttributes function is a little arcane.
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.
Yeah I am not sure if there are performance hits with per pixel. The setAttributes
function is definitely intended to only be used by people that want a non-traditional webgl setup for whatever reason. The most commonly used attribute modification would theoretically be 'antialias' which would likely be changed by smooth()
for most users.
I'll break this out into an issue.
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.
Great job! Small comments inline but I generally approve :-D
Rebased on top of
feature-specularlight
, so that needs to be merged first.fixes- #3894
See manual test
/webgl/lights/spotlight/
.Work done-
lighting.glsl
.spotLight()
in /src/webgl/light.js/webgl/lights/spotLight/
To do-
More to follow...