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

SA2 Event - Add Remaining Event Entry Flags #37

Open
shaddatic opened this issue Oct 29, 2024 · 1 comment
Open

SA2 Event - Add Remaining Event Entry Flags #37

shaddatic opened this issue Oct 29, 2024 · 1 comment
Labels
feature-request New feature or request

Comments

@shaddatic
Copy link

I recently decompiled the Event rendering code and managed to confirm the use of each flag. Rewriting the PC Event draw functions to correctly apply these flags, and emulating the original DC draw functions, produced results that exactly match Dreamcast with both the original DC event files from disc and the vanilla PC events. This allows us to safely assume the flags are the same across all versions.

Here are the flags with descriptions of what they do:

Flag   | My Name   | Description

0x0001 - HASENV    - Has env mapped materials, use Simple variant of draw function
0x0002 - NOFOG     - Draw with fog disabled and use EasyDraw
0x0004 - LIGHT1    - Use multi-light 1
0x0008 - LIGHT2    - Use multi-light 2
0x0010 - LIGHT3    - Use multi-light 3
0x0020 - LIGHT4    - Use multi-light 4
0x0040 - MODVOL    - Is a modifier volume and should use ModDraw
0x0080 - REFLECT   - To be reflected in reflection planes
0x0100 - BLARE     - To have blare effects applied
0x0200 - USESIMPLE - Use regular Simple over any Multi or Easy variant

Notes:

  • DrawMotion and DrawShapeMotion are decided based on if the motion and shape data are present, with shape requiring both.
  • EasyDraw variants don't support environment maps, diffuse on textured materials, or backface culling. It is the fastest draw function on DC
  • SimpleDraw variants support env maps and backface culling, but not diffuse on textured materials. On env mapped materials, Simple applies diffuse, but SimpleMulti does not.
  • MultiDraw allows for multiple lights, up to 6 (events use 4), to be used on a single model; otherwise only 1 light can be used. Both Multi and non-Multi functions use only 1 ambient value, but Multi supports an arbitrary ambient color while non-Multi functions only support the ambient being a multiple of the light color.
  • If a model has any of the LIGHT# flags it will use MultiDraw, if it has none it will use the non Multi
    variant with light 1
  • The flags don't change depending on the scene number, including the base scene
  • NOFOG only works for models with no motion data, and overrides the HASENV, USESIMPLE, and LIGHT# flags
  • MODVOL overrides everything
  • USESIMPLE is the strangest of the flags, as everything in the base scene seems to use it, even if it also uses NOFOG or even a LIGHT# flag. It's not a STATIC flag, as some entries use it even though they are animated, it's not a NOMULTI flag as most other entries just disable all the LIGHT# flags, and it's not a back face culling thing either as NOFOG forces EasyDraw and skyboxes often use both. So, I stuck with USESIMPLE for now

If there are any other questions, I'll try my best to answer them!

@shaddatic
Copy link
Author

Now that the new flag names have been in place for a bit, we've been able to see how users actually percieve them. Because of this, I've noticed some confusion with some of the names originally chosen (sorry!) and I have some suggestions to make things clearer; without users needing to have an in-depth knowledge of the SAIO manual or the Ninja API.

Here are my suggestions for names and descriptions, and why:

Has Environment -> Has/Use Advanced Materials: This setting allows the use of advanced material properties, such as back-face culling, environment mapping, and material flags such as 'Ignore Lighting'

There's already been a few people confused why certain flags won't apply on their model, believing this setting to only apply to environment maps. Perhaps the devs used it this way, however for users it's better to make it more clear that this setting has wide reaching effects on how materials are drawn.

No Fog & EasyDraw -> No Fog (Basic Materials Only): Disable fog rendering and cannot use advanced material properties. Usually used for skyboxes. Flag ignored if entry has a motion/animation.

The suggestion needs more work, but it's an okay start. It's also useful to note how this flag is ignored when an entry has a motion attatched.

Light # -> Multi-Light #: Use multi-light #. If no multi-lights are enabled, multi-lighting will be disabled and only light 1 and and will be used; this will also effect which ambient color source is used.

I haven't personally seen any confusion over this, however calling them Multi-Light is technically more accurate as all 4, even if seperately, enable multi-lighting; only having all 4 off enables single-light rendering.

Use SimpleDraw -> Force 'njCnkSimpleDraw': Forces advanced material properties and disables multi-lighting. Used as a quick performance hack by the Dreamcast devs late in development.

It might be best to put this flag behind a toggle, similar to the advanced node flags, as this setting doesn't really serve any purpose not covered by the other settings. It really does seem like a quick fix the devs threw in to speed up performance without having to worry about changing other specific flags.

The common change I'm suggesting is switching EasyDraw and SimpleDraw to something more understandable to users, like Basic Material Properties and Advanced Material Properties. The specifics of each, and what draw function each is, should be left to the SAIO manual; something I can help with of course. But just because the manual exists doesn't mean we should keep things vague in the tooltips, and I think I've struck a good balance here. But, I want feedback on all these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants