-
Notifications
You must be signed in to change notification settings - Fork 521
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
Tweak: Implement better extended culling options #4285
Tweak: Implement better extended culling options #4285
Conversation
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, mostly some cvar prefix stuff and maybe it'd be a good idea to rename gDisableDrawDistance
.
// Skip cutscne actors that depend on culling to hide from camera pans | ||
if (actor->id == ACTOR_EN_VIEWER) { | ||
return false; | ||
} |
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.
Are all the cutscene actors we want to hide like this, ACTOR_EN_VIEWER
?
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.
This actor pertains to zelda/impa/ganon and their horses, primarily from the chase scene. The previous issue noticed by our enhancements was their horses "running in place" during camera pans when they would have been culled.
I'm not aware of any other actor that needs special handling, and this is on par with SoH since 1.0.0, but we can always add more actors later if necessary.
This is a MacReady PR, the cvar prefixes don't exist here yet, and similarly we wouldn't want to rename |
On that note, let me know what things need to be added to the migrator, my migrator for the CVar macros hasn't gone through yet, so I can add them to that. |
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.
Whoops, forgot macready doesn't have the prefixes.
This PR achieves two main goals:
Draw Distance
Previously our Draw Distance enhancement was implemented rather poorly. The way it worked essentially bypassed culling checks entirely, meaning that all actors were drawn and updated, even if they where behind the camera/out of view. For lower end devices, this would cause significant lag in larger areas like Hyrule Field.
The changes in this PR attempt to address this in two ways:
First, a "draw distance" enhancement should really only increase the forward culling plane of the uncull frustum. So now things behind the camera will cull as expected following the actors rules.
Second, the "draw distance" enhancement is now a slider so that players can choose "how much" increased range they want. This works as a multiplier against each actors forward uncull zone value, so that the zones scale per actor (e.g. trees scale father than insects).
Widescreen culling
Previously we hardcoded the side, top, and bottom uncull planes to be increased by a factor of 2. This change was arbitrary and got lost in git history, not to mention changing the top and bottom planes is not necessary for widescreens. It worked decently for 16:9 aspect ratios, but started to show actor pop-in on much larger ratios like 32:9. In 8.0.5, we reverted this change back to vanilla to restore certain uncull glitches (i.e. King Zora unfreeze), but now there is noticeable actor pop-in on regular widescreen ratios.
The changes in this PR bring back widescreen actor culling as a dedicated option, so that it can be turned on/off. Additionally, the horizontal planes are now increased proportionally to the games aspect ratio so that even 32:9 displays should have little-to-no actor pop-in.
Exclude glitch useful actors
To deal with glitches, a new option is added that allows specific glitch-useful actors to be excluded from the extended culling options. This means things like King Zora unfreeze, Gerudo guard unculling, blue warp unculling, etc can all work as expected while extended culling is active. This works by allowing actors to "draw" without actually "updating", so there won't be pop-in, but update logic will not run (the logic that uncull glitches take advantage of).
Specific actors have been identified and included as of now, but we can add more as other use cases are identified.
Other things to note
Previous actor exclusions like Dark Link's room or Dodongos Cavern Lizalfos are not longer necessary with these updates so they have been removed. Others were just incorrect (zelda/ganon horse), and have been replaced with the appropriate actor (
en_viewer
).Some trees/bushes spawn and clean up "additional" actors in Hyrule field using the same extended logic now.
Bush/rock circles have additional logic to spawn/clean up their individual actors tweaked to match the extended culling options.
Build Artifacts