gonetz / GLideN64

A new generation, open-source graphics plugin for N64 emulators.
Other
779 stars 181 forks source link

Framebuffer alpha wireframe #2057

Open robinerd123 opened 5 years ago

robinerd123 commented 5 years ago

the framebuffer alpha bit is supposed to contain the wireframe data of the scene (in f3d atleast)

also why does the framebuffer alpha bit get affected by fog when it shouldnt be?

gonetz commented 5 years ago

Please provide more details. I don't understand your questions.

robinerd123 commented 5 years ago

i mean antialiasing coverage in the alpha bit in the framebuffer

oddMLan commented 5 years ago

Coverage isn't implemented in the plugin

robinerd123 commented 5 years ago

well yeah thats what im issuing about also fog causes problems cause for whatever reason it seems to mess with the framebuffer alpha in GLideN64 when it shouldnt

gonetz commented 5 years ago

Yes, antialiasing coverage is not emulated. N64 RDRAM byte consists of 9bits, not 8 as with other memory types. Upper bit is used for coverage. 16bit frame buffer has 3 bits for coverage: 2 additional bits plus 1 bit from alpha. The coverage information can be used for wire-frame mode, but as I understand, the data from additional bits required for that, not (or not only) the buffer alpha but. Thus, framebuffer alpha bit is not supposed to contain the wireframe data of the scene. I can be wrong there, I did not investigate how N64 wireframe mode actually works.

Regarding fog: N64 fog mode uses vertex alpha byte as fog factor. Please give me examples where it causes problems. Since fog can be applied only to opaque objects, frame buffer alpha bit must be 1 for all pixels covered by fog.

robinerd123 commented 5 years ago

i did a test on console where i looped trough the framebuffer and did different stuff with the alpha bit and the results are very different from the ones on GLideN64 first off alpha is indeed 0 in the edges resulting in kind of a wireframe render and second the fog doesn't affect the alpha bit on console while it does indeed affect it in GLideN64

gonetz commented 5 years ago

the fog doesn't affect the alpha bit on console while it does indeed affect it in GLideN64

Can you give me that test rom to check fog influence? Do you know any game, where it causes graphics glitches?

robinerd123 commented 5 years ago

i have overwritten my code but its easily achievable by looping trough the framebuffer from the cpu

also no, it doesnt cause any issues in games but it is an inaccuracy as in if for example homebrew was gonna use that it wouldnt work properly on GLideN64

oddMLan commented 5 years ago

duplicate of #2106

gonetz commented 5 years ago

It is related to coverage but the problem is different.