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

Shadow Map Start #3551

Merged
merged 5 commits into from
Feb 12, 2016
Merged

Shadow Map Start #3551

merged 5 commits into from
Feb 12, 2016

Conversation

lilleyse
Copy link
Contributor

For #2594

Here is basic shadow mapping for glTF models, with some debug helpers.The major areas to work on next are fixing aliasing, getting shadow commands based on the light frustum, cascades/automatic light frustum fitting, support for terrain and primitives, and otherwise addressing the TODO's I left in the code.

@mramato
Copy link
Contributor

mramato commented Feb 11, 2016

How do you open a pull request like this without a screen shot 😄?

@lilleyse
Copy link
Contributor Author

shadows2

The blue lines represent the light volume.
The actual shadow map is on the bottom right.

@bagnell
Copy link
Contributor

bagnell commented Feb 11, 2016

Looks good to me so far. I don't have any comments yet. I will about how this fits into the engine when it gets to that point.

@pjcozzi Do you want to do a review?

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 11, 2016

Yes, will check this out tonight.

setView(this, camera.viewMatrix);
setInverseView(this, camera.inverseViewMatrix);
setCamera(this, camera);
this.updateCamera(camera);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked at the rest of the code yet, but does it make sense to not call this here and require the user to call it, e.g.,

renderFrame
  uniformState.update()
  foreach camera
    uniformState.updateCamera()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this.updateCamera(camera); breaks a lot of tests, so I'm leaving it in.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a TODO to your roadmap since those tests should probably call update and updateCamera (or we can make a tests-specific helper that calls both). I hate to make the render workflow more complicated so we don't have to change tests.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 12, 2016

@lilleyse consider breaking #2594 into Short-term and Long-term sections and add things like "Write tests", "reference doc", etc. Also feel free to remove anything already there that is now irrelevant.

@@ -148,6 +148,10 @@ define([
this._resolutionScale = 1.0;

this._fogDensity = undefined;

// TODO : expose these differently
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be fine to just have a ShadowMap reference here, and then assign to it each frame when calling UniformState.update (pass it as a separate parameter to start, I guess).

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 12, 2016

Great start, @lilleyse! That's all my comments.

@lilleyse
Copy link
Contributor Author

Updated.

@pjcozzi
Copy link
Contributor

pjcozzi commented Feb 12, 2016

Good start!

pjcozzi added a commit that referenced this pull request Feb 12, 2016
@pjcozzi pjcozzi merged commit 0bb958b into shadows Feb 12, 2016
@pjcozzi pjcozzi deleted the shadows-start branch February 12, 2016 20:48
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.

4 participants