Re-implement King Dodongo's Lava texture effects#3434
Merged
briaguya0 merged 5 commits intoHarbourMasters:develop-macreadyfrom Nov 23, 2023
Merged
Re-implement King Dodongo's Lava texture effects#3434briaguya0 merged 5 commits intoHarbourMasters:develop-macreadyfrom
briaguya0 merged 5 commits intoHarbourMasters:develop-macreadyfrom
Conversation
Contributor
Author
|
I'm pointing this to MacReady cause I think it can be excepted as a bugfix, but if others would prefer this for develop instead then I can retarget it. |
Archez
commented
Nov 23, 2023
Comment on lines
+187
to
+189
| void GameInteractor_RegisterOnAssetAltChange(void (*fn)(void)) { | ||
| GameInteractor::Instance->RegisterGameHook<GameInteractor::OnAssetAltChange>(fn); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This is the first example of making a C bridge method for registering to a hook on the C side. Sticking it here to go with the other bridge methods.
briaguya0
approved these changes
Nov 23, 2023
Contributor
briaguya0
left a comment
There was a problem hiding this comment.
i think some of the resource stuff in OTRGlobals could probably be a part of LUS, but i have no problem with it being in SoH for now
i also agree that macready is a good place for this, it's a bugfix for sure
![]()
This was referenced Nov 29, 2023
A-Green-Spoon
pushed a commit
to A-Green-Spoon/Shipwright
that referenced
this pull request
Nov 30, 2023
* fix alt backgrounds not always loading * include gfx lookup with the original unload * Add hook for alt toggle * handle cpu modified texture for kd lava * malloc array instead of illegal initialize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After introducing the HD and alternate resource system, the wavy and cooling off lava effects in KD's room were disabled as they are CPU modified textures. One of the blended effects was disabled due to crashing but I believe that was due to an incorrect height/width values for the lava texture that have since been fixed by various asset related PRs.
To resolve all this I have recreated the CPU modified texture effects in the actor code with two flows: one for the original asset size, and the other for HD/raw loaded assets. The original functions were updated to use a copied texture value rather than a pointer to the resource manager. The HD/raw methods copy this pattern but are adjusted to handle the different sizes and the texture being RGBA32 instead of RGBA16.
On init for KD, the textures from the resource manager are copied to a static pointer, the HD/raw ones are malloc'd (and free'd). I've also added a GI hook for detecting when the Alt assets toggle is changed. The texture copy process is registered to run on this hook to handle updating everything appropriately when toggling alt assets.
The cooling effect is achieved by taking the values that would have normally applied to the original asset, but setting extra pixels to account for the increased width and height scales. This makes it look like square chunks are being filled in the same as the original texture, just not with the tri-linear filtering.
The wavy effect for HD/raw assets has the calculation adjusted to try and scale the effect up to for the texture size while trying to still look similar to the original effect. Unlike the cooling effect, I decided to have the math scale like this so that the wavy effect looks smooth and good for the HD texture, instead of being chunky.
I opted for doing this in the actor file instead of a shader, largely because I don't know how to work with shaders, but also because it felt like the effect was tied pretty closely to the actor and this is like two different compounding effects applied on top of each other.. If someone knows how to handle it as a shader instead, I'm also open to solutions.
kd-lava-wavy2.mp4
Based on top of #3420
Build Artifacts