-
Notifications
You must be signed in to change notification settings - Fork 11
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
Loadout support #66
Loadout support #66
Conversation
use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supportedWebReplayViewer/src/loaders/storage/loadRlLoadout.ts Lines 29 to 34 in 7d2cf9c
This comment was generated by todo based on a
|
use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supportedWebReplayViewer/src/loaders/storage/loadRlLoadout.ts Lines 29 to 34 in 6b0163d
This comment was generated by todo based on a
|
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.
Looks good but I wouldn't scrap the default model loaders. For the future, we're going to add quality scales and mobile users will be defaulted to load really basic models (I'm talking a few steps removed from a box) so that we don't blow our their CPUs.
const paintConfig = createPaintConfig(player.isOrange) | ||
body = new BodyModel(Body.DEFAULT, Decal.NONE, paintConfig, manager.config) | ||
wheels = new WheelsModel(Wheel.DEFAULT, paintConfig, manager.config) | ||
await Promise.all([body.load(), wheels.load()]) |
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.
Does your library handle caching the body and wheel loads?
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.
The lib itself doesn't handle caching, but I've enabled three's internal cache here:
Cache.enabled = true |
Although since this only caches the raw downloaded assets, they do still need to be processed. If you want to speed up processing, there are also smaller textures available that have 4x less pixels.
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.
Three's cache is fine for handling preexisting assets being added to a scene, but this might still make the request to download these models N times over assuming the browser isn't smart about cache. On a mobile connection, another 30Mb is another 30 seconds.
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.
Three's FileLoader is smart enough to not load duplicate assets https://github.com/mrdoob/three.js/blob/master/src/loaders/FileLoader.js#L48
E.g. if you enable default loadouts and check the requests in the dev console, there is only one request for the octane, while normally the browser would show multiple requests but indicate that the subsequent ones are fetched from cache.
I am considering making some big changes to the model files. Setting this to WIP |
# Conflicts: # package-lock.json # package.json # src/loaders/scenes/GameFieldAssets.ts
use the default wheel for now, there aren't a lot of wheels in rocket-loadout yet, and not yet fully supportedWebReplayViewer/src/loaders/storage/loadRlLoadout.ts Lines 29 to 34 in 43e326e
This comment was generated by todo based on a
|
Loads car models from rocket-loadout.com
Also fixes #45