I’m not very skilled with WebGL and wish to ask if this undertaking is doubtlessly possible and likewise for a number of hints about what path I’ll wish to take.
I’d wish to implement the entire logic required to render an SNES PPU in fragment shaders utilizing WebGL. I’ve a principally cycle-accurate JavaScript SNES emulator, which runs at a great pace, besides PPU drawing is sluggish. I’ve different plans to hurry it up, however somebody made a suggestion to do it with GLSL, and it captured my consideration.
This requires entry to the next information buildings:
A 64k 8-bit (or 32k 16-bit can be handy) buffer to symbolize VRAM,
About 1k of information per scanline, of which there might be as much as 240
It requires doing numerous lookups, deal with calculations, reads and comparisons, and holding a bunch of variables in reminiscence directly. S-PPU coloration math is non-trivial.
I’d have two basic approaches in thoughts –
A non-pipelined strategy, the place every shader takes its display screen place and does all of the lookups and math to output a closing pixel worth.
Or a extra difficult deferred rendering-style setup the place lookups, comparisons, and so forth. occur in phases between a number of buffers.
Is that this a possible undertaking with WebGL fragment shaders? Any hints as to which path I ought to head?
Thanks!