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

A more performant version of DynamicShadows for html5 #307

Closed
wants to merge 3 commits into from

Conversation

UncertainProd
Copy link
Contributor

@UncertainProd UncertainProd commented Apr 6, 2023

(Related to DynamicShadows in #287 )
Since shadows were being calculated for every shape in the tilemap, the performance of the Dynamic Shadows demo was pretty bad on html5. By limiting the illuminated area around the light source, we can reduce the number of shapes for which shadows are calculated (which helps increase the framerate) while also keeping the demo looking good.

Current demo:
before-pr
before-pr-2

New demo:
after-pr

after-pr-2

@Geokureli
Copy link
Member

Geokureli commented Apr 6, 2023

can't look right now, excited about this, though!

@Geokureli
Copy link
Member

Sorry for ghosting you on this. TBH I wasn't super thrilled about making this less visually appealing just to make it function on html5, so I messed around with shaders and came up with this which seems to perform fantastically on html5 and desktop, but doesn't work on flash (so I'll keep the old version)

@Geokureli
Copy link
Member

Thanks for getting the ball rolling on this, but gonna close this in light of the new shader solution

@Geokureli Geokureli closed this Aug 8, 2023
@UncertainProd
Copy link
Contributor Author

Sorry for ghosting you on this. TBH I wasn't super thrilled about making this less visually appealing just to make it function on html5, so I messed around with shaders and came up with this which seems to perform fantastically on html5 and desktop, but doesn't work on flash (so I'll keep the old version)

At first I was also trying to recreate the effect with shaders but didn't get anywhere. Your version looks good 👍

@UncertainProd UncertainProd deleted the dynamic-shadows branch August 8, 2023 14:40
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.

2 participants