-
Notifications
You must be signed in to change notification settings - Fork 263
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
Conversation
… 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
scratchMat4a[12] += this.mPos[0]; | ||
scratchMat4a[13] += this.mPos[1]; | ||
scratchMat4a[14] += this.mPos[2]; | ||
mat4.mul(this.mModelViewMtx, globals.camera.viewMatrix, scratchMat4a); |
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.
Probably easier to construct the MVM at prepareToRender time and just add animation/model matrices in here.
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.
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?
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.
Yes.
This reverts commit a28b3f5.
Also name the last of the unknown variables
The implementation is identical in JS (in C++ it's the short version vs float)
Removes old hardcoded texcoord hack
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.
Looking way better, thank you! Almost ready to merge, just a few nits, and I need to upload a new extra arc.
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 😁 |
This differes from the cpp, but suits JS better
Full rendering support, as well as idle and cut animation support. This is picking up from a changelist I stashed 5 years ago 😂