Closed olivieryuyu closed 2 years ago
Hi Olivier!
Thanks for the info about this interesting demo. I checked how it works. Yes, as the author explains, the demo first renders the scene into 8bit color buffer. On the next step, this buffer is used as 8bit CI texture and rendered into the main buffer by texrects. GLideN64 needs special shader to emulate it properly, something similar to fog shader for BAR. Such a shader needs color palette loaded as texture, so it can build the output texel using the input frame buffer texel as the palette index. It can be done, but I'm not sure when I can find time for it.
There is another way though. If we don't need to have this effect in high-res, we can save 8bit buffer to RDRAM and then use it as a regular texture. The plugin already has "copy aux buffer to N64 memory" option, but it does not work here because color buffer considered as an auxiliary one if its size is less then size of the VI buffer. However, 8bit buffer is obviously auxiliary. I made a simple correction, and the demo started to work with "copy aux buffers" enabled, see #2651
Fixed with "copy aux buffers" enabled.
toonshading.zip
does not work under pj64 but ok with mupenplus and 1964.
here how it should look like:
explanation and source code here
https://github.com/lambertjamesd/n64graphicsdemo