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

Wind Waker: Add black bars to top and bottom during demos #736

Closed
wants to merge 15 commits into from

Conversation

themikelester
Copy link
Collaborator

zww_stolensister_2024-12-20T15_32_47 407Z

These bars disappear when the demo is paused or when viewing a normal scene. They animate in and out using the same logic as the game.

More interestingly, I had to add a few camera-related member variables, which made it seem like time to create dCamera_c. For simplicity I left it in Main.ts. I also implemented the scissoring as simply as I could, which is a bit hacky. We could introduce dDlst_window_c which would get set on each draw list. Then dCamera_c would just modify the window during its update. Thoughts?

@magcius
Copy link
Owner

magcius commented Dec 20, 2024

I'm not sure I want this. The original letterboxing effect was there to frame things in a more 16:9 ratio. We already allow users to resize the window to see the same cutscene in different aspect ratios, meaning that we're already not going to get the original viewing proportions correct. So I don't see a major reason to add the letterboxing effect, and I think it goes against the goals of noclip as being a way to "step outside" the game.

@magcius magcius closed this Dec 20, 2024
@themikelester
Copy link
Collaborator Author

Aww, I was afraid you'd say that, but I really like it. When you pause (which allows you to move the camera), they animate it away and it makes it clear that you're stepping outside the game. But when it's playing it does make it seem more cinematic.

But of course I really don't want to mess with your vision for noclip. If this doesn't fit with that vision, then I'll leave it out.

@magcius
Copy link
Owner

magcius commented Dec 20, 2024

I could be convinced otherwise, but I'd need to spend some time with it.

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.

Please also make sure to replace the clear color from TransparentBlack to OpaqueBlack in Main.ts to ensure that the black bars work correctly, since you're now relying on that.


public execute(globals: dGlobals, viewerInput: Viewer.ViewerRenderInput) {
// Near/far planes are decided by the stage data.
const stag = globals.dStage_dt.stag;
Copy link
Owner

Choose a reason for hiding this comment

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

I like the idea of splitting dCamera_c out to a separate class, but I believe we should replace globals.camera with it. Search for setupFromCamera to see other examples of how I do this elsewhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done! It turned out to be a bit messier than the other users of setFromCamera because there are several places in src/Common/ and src/gx/ that use viewerInput.camera directly. To work around this without doing some bigger refactoring, I made dCamera_c extend Camera.

I think we'd be better off if Camera wasn't used anywhere in src/Common, and we just passed in matrices, frustums, etc or abstracted whatever is using those up to a higher level. But take a look through this and let me know what you think . And feel free to either make changes directly in the branch too.

src/ZeldaWindWaker/Main.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/Main.ts Outdated Show resolved Hide resolved
src/ZeldaWindWaker/d_place_name.ts Show resolved Hide resolved
@themikelester
Copy link
Collaborator Author

What do you think about adding a "Demo Options" UI element? We could add letterboxing as a toggle and stick some play speed / scrubbing controls in there too (after looking through Studio, I think it'd be tough to integrate the scrubbing UI)

I've added `viewerCamera: Camera` as a member of `dCamera_c`, so all the old logic that required a Camera just passes through to that. It makes it very clear which places will require logic changes once everything is just using dCamera_c
I didn't want to extend noclip's Camera, but there are too many places in common code (gx, J3DGraph, etc) that rely on the `Camera` class.
…erInput.camera

Avoid gx.ts' `fillSceneParamsDataOnTemplate` uses viewerInput.camera.projectionMatrix. I decided not to modify it or use a default parameter since it is already used by so many other files.
@magcius magcius reopened this Dec 27, 2024
@magcius magcius closed this in 2da3270 Dec 27, 2024
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