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

WebGLRenderer: Optimize number of light shadow uniforms. #18627

Merged
merged 3 commits into from
Feb 20, 2020

Conversation

Oletus
Copy link
Contributor

@Oletus Oletus commented Feb 13, 2020

Light shadow uniforms are now in a separate struct so they don't need to be included in case shadows are not enabled.

This makes it possible to use more shadowless lights on platforms that have low limits for uniform count.

It was experimentally verified that this change makes a difference on 7th gen iPad with iPadOS 13.3.1.

Point light shadow uniforms are now in a separate struct so they don't need to be included in case shadows are not enabled.

This makes it possible to use more shadowless lights on platforms that have low limits for uniform count.

It was experimentally verified that this change makes a difference on 7th gen iPad with iPadOS 13.3.1.
The shaders only contain code for active shadows, so they don't need a separate flag to determine whether the shadow is enabled.
@mrdoob mrdoob added this to the r115 milestone Feb 14, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 14, 2020

It was experimentally verified that this change makes a difference on 7th gen iPad with iPadOS 13.3.1.

In terms of overall performance or being able to make the scene more complex?

@Mugen87 Mugen87 changed the title Optimize number of light shadow uniforms WebGLRenderer: Optimize number of light shadow uniforms. Feb 14, 2020
@Oletus
Copy link
Contributor Author

Oletus commented Feb 14, 2020

In terms of overall performance or being able to make the scene more complex?

I was able to significantly increase the number of shadowless point lights in the scene on iPad after this change without running into shader compilation issues.

Copy link
Collaborator

@Mugen87 Mugen87 left a comment

Choose a reason for hiding this comment

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

I've locally tested the PR today. Examples work as expected and the code changes look good, too.

@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2020

Lets merge this in r115. I guess this will break NodeMaterial?

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 20, 2020

Well, I've tested all node examples and they work fine^^.

@sunag Could this change still affect NodeMaterial?

@sunag
Copy link
Collaborator

sunag commented Feb 20, 2020

@Mugen87 No problem for me.

@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2020

Lets merge it now then! YOLO 😁

@mrdoob mrdoob modified the milestones: r115, r114 Feb 20, 2020
@mrdoob mrdoob merged commit ea794f5 into mrdoob:dev Feb 20, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 20, 2020

Thanks!

@Oletus Oletus deleted the shadow-uniforms branch February 20, 2020 22:06
@Oletus
Copy link
Contributor Author

Oletus commented Feb 20, 2020

Thanks for merging this!

@gkjohnson gkjohnson mentioned this pull request Feb 22, 2020
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