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

Implement d_wood (bushes) for Wind Waker #712

Merged
merged 24 commits into from
Oct 24, 2024
Merged

Conversation

themikelester
Copy link
Collaborator

Screenshot 2024-10-21 at 8 39 13 PM

Full rendering support, as well as idle and cut animation support. This is picking up from a changelist I stashed 5 years ago 😂

… already exist

Without this change, the script will fail if data/ZeldaWindWaker does not already exist
NoClip expects these files to be present in the output directory.
This should be everything we need to render bushes
This is the start of one of the remaining missing d_s_play components, Wood (which is the TWW misnomer for bushes).

Instead of following the old Grass.ts pattern, this is architected as similar to the d_wood.cpp as possible. This makes it simpler to compare to the decompiled results.

A few functions are implemented, and the rendering is based heavily off of d_tree so it may not be completely correct. But basic model rendering and drop shadows are present.
This is used by d_wood's animation functions
Since the src and dst parameters are switched from usual, I think it's worth adding this so that it's easy to copy paste from decomp
Idle animation fully implemented
* Enable alpha testing on bushes (greatly improves aliasing on leaf edges)
* Render to the XLU BG display list. This fixes an ordering issue. We must render after most bg objects because of the alpha testing.
* Disable alpha test when fading out after a bush has been cut
src/ZeldaWindWaker/SComponent.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
scratchMat4a[12] += this.mPos[0];
scratchMat4a[13] += this.mPos[1];
scratchMat4a[14] += this.mPos[2];
mat4.mul(this.mModelViewMtx, globals.camera.viewMatrix, scratchMat4a);
Copy link
Owner

Choose a reason for hiding this comment

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

Probably easier to construct the MVM at prepareToRender time and just add animation/model matrices in here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah I'm just matching what the cpp was doing, so I'm more confident I don't miss anything. Should I move it around? Got a preference?

Copy link
Owner

Choose a reason for hiding this comment

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

Yes.

src/ZeldaWindWaker/d_wood.ts Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Show resolved Hide resolved
src/ZeldaWindWaker/tools/zww_extractor.ts Outdated Show resolved Hide resolved
Copy link
Owner

@magcius magcius left a comment

Choose a reason for hiding this comment

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

Looking way better, thank you! Almost ready to merge, just a few nits, and I need to upload a new extra arc.

src/ZeldaWindWaker/d_wood.ts Show resolved Hide resolved
src/ZeldaWindWaker/m_do_mtx.ts Show resolved Hide resolved
src/ZeldaWindWaker/d_wood.ts Outdated Show resolved Hide resolved
@themikelester
Copy link
Collaborator Author

Yea thanks for the thorough review! It's been so long, I'd like to match your vision as best I can. Rather have all the nits up front 😁

@magcius magcius merged commit d1c23ff into magcius:master Oct 24, 2024
1 check passed
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