Add options for cel shading DL generation - #122
Conversation
* Added SetTileSize scrolling to SM64 * remove extraneous parenthesis Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com> * ensure changes are made before writing to texscroll.c Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
| return data | ||
|
|
||
| def to_c_vertex_scroll(self, gfxFormatter: GfxFormatter): | ||
| assert len(self.celTriLists) == 0 |
There was a problem hiding this comment.
is there any reason why vertex UV scrolling wouldn't work?
There was a problem hiding this comment.
To be honest I don't understand what this is, so I didn't try to implement compatibility with it. The way scrolling textures is done in OoT involves updating the tile definition every frame; any UV-based scheme would not be able to independently scroll both textures in a multitexture setup. Is this UV scrolling an SM64 thing or is it something made up by the community?
|
Cel shading presets have been separated and won't be visible unless you check the box saying you have the microcode patch installed (off by default). If you've tested this branch before, you'll need to delete the presets in ~/.config/blender/X/scripts/presets/f3d/* (except for the user directory). Otherwise the cel shading presets will still show up even if the box isn't checked. |
|
Closed in favor of V5 version. |
This is the cel shading implementation created by Sauraen and glank in October 2021, used for the Breath of the Wild characters in Triforce% OoT ACE Showcase.
A patch to F3DZEX is also needed, to optionally move the lighting information into the shade alpha channel based on a new geometry mode bit: https://github.com/sauraen/n64celshading
With cel shading turned on for a material, fast64 generates special display lists which draw the triangles multiple times, once per cel level, changing RDP options between each draw pass. This is automated and does not require any CPU intervention or any different treatment from drawing normal display lists or skinned meshes. It is compatible with OoT in-game lighting including multiple moving directional lights, but it does not support colored lights (the green light color is used and the other two channels are ignored).
Cel shading is intended to be used in 1 cycle mode with a single texture or a solid color. Alpha compare is used to draw or not draw each pixel based on the lighting level (shade alpha). After each cel level, the combiner and blender options are changed, usually to invert the threshold for the other cel level. In Triforce%, BotW Link uses three cel levels for his hair, but all other materials on BotW Link and Zelda use the standard two cel levels.
Here is an example of an outputted display list for a solid colored object:
This works on real N64 hardware and on any emulator which does RSP LLE and supports alpha compare in the RDP.
Two other, completely different, implementations of cel shading on the N64 were created in January 2022, one by James Lambert and one by Wiseguy (no public video). Our implementation was made in October 2021 but was hidden in a branch of a fork so not really made public, and is completely different from both of these.