-
Notifications
You must be signed in to change notification settings - Fork 212
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
Fix lessons #1028
Fix lessons #1028
Conversation
@@ -3,6 +3,11 @@ import {AnimationLoop, Texture2D, loadFile, setParameters} from '@luma.gl/core'; | |||
import {addEvents} from '@luma.gl/addons'; | |||
import {Matrix4, radians} from 'math.gl'; | |||
import {loadWorldGeometry, World} from './world'; | |||
/* eslint-disable complexity */ |
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.
Use // eslint-disable-next-line complexity
in front of each function/method instead of globally disabling it.
|
||
/* | ||
Cave texture from: http://texturelib.com/texture/?path=/Textures/rock/cave/rock_cave_0019 | ||
*/ |
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.
Add a line about license for textures from this lib?
examples/lessons/10/package.json
Outdated
@@ -8,8 +8,10 @@ | |||
"start-local": "webpack-dev-server --env.local --progress --hot --open -d" | |||
}, | |||
"dependencies": { | |||
"@luma.gl/addons": "^7.0.0-alpha", | |||
"@luma.gl/constants": "^7.0.0-alpha.3", |
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.
Use same version for all luma deps?
examples/lessons/13/app.js
Outdated
@@ -233,6 +244,7 @@ const animationLoop = new AnimationLoop({ | |||
|
|||
moon | |||
.setUniforms({ | |||
uSampler: moonTexture, |
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.
Do we need to set this again if we are no longer sharing programs?
Teaching best practices would be to only set uniforms that vary each frame?
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.
No, that was to work around the program-sharing issue.
examples/lessons/13/app.js
Outdated
@@ -166,38 +169,46 @@ const animationLoop = new AnimationLoop({ | |||
}), | |||
program: fragmentLightingProgram, |
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.
Should we stop making programs in advance and just pass in the shaders to the Model constructors to avoid the sharing issue (which seems to be an overly ambitious optimization unrelated to the main exposition of this example, i.e. fragment 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.
Sounds good.
@@ -274,54 +287,6 @@ function animate(state) { | |||
state.lastTime = timeNow; | |||
} | |||
|
|||
/* global document */ | |||
// eslint-disable-next-line complexity | |||
function getControlValues() { |
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.
Instead of deleting these, should we restore the HTML elements above instead, they seem to have been cut by mistake in a previous cleanup.
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.
It actually looks like that logic has been moved around for a while, but hasn't been hooked into any actual UI for a long while:
https://github.com/uber/luma.gl/blob/5.0-release/examples/lessons/13/app.js
https://github.com/uber/luma.gl/blob/6.0-release/examples/lessons/13/app.js
I'll leave this for now, and we can discuss we want to flesh out with controls.
Fixes to lesson examples bases on #756