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

Fix lessons #1028

Merged
merged 6 commits into from
Apr 2, 2019
Merged

Fix lessons #1028

merged 6 commits into from
Apr 2, 2019

Conversation

tsherif
Copy link
Contributor

@tsherif tsherif commented Apr 2, 2019

Fixes to lesson examples bases on #756

@tsherif tsherif requested a review from ibgreen April 2, 2019 22:20
@@ -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 */
Copy link
Collaborator

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
*/
Copy link
Collaborator

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?

@@ -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",
Copy link
Collaborator

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?

@@ -233,6 +244,7 @@ const animationLoop = new AnimationLoop({

moon
.setUniforms({
uSampler: moonTexture,
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@@ -166,38 +169,46 @@ const animationLoop = new AnimationLoop({
}),
program: fragmentLightingProgram,
Copy link
Collaborator

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)?

Copy link
Contributor Author

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() {
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

@coveralls
Copy link

coveralls commented Apr 2, 2019

Coverage Status

Coverage decreased (-0.005%) to 45.636% when pulling 1b70efe on fix-lessons into 1d9aece on master.

@tsherif tsherif merged commit c827067 into master Apr 2, 2019
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

Successfully merging this pull request may close these issues.

3 participants