partnano wrote:Your work constantly leaves me astonished (and makes me feel a bit inadequate)
I would love to see the code behind this! I mean I could imagine how most of this works, but the actual implementation would be cool to see...
Thanks. If only I could remain focused enough to actually stay on one project at a time.
Which code are you most interested in? The palette is pretty much right there and easy as pie to implement.
A bit of pseudocode that would have to be modified:
Code: Select all
nesShader:send("color1", {0,0,0,255})
nesShader:send("color2", {0,0,0,255})
nesShader:send("color3", {0,0,0,255})
nesShader:send("color4", {0,0,0,255})
lgr.setShader(nesShader)
-- Whatever you're drawing. The greyscale image basically with 4 shades of white, grey and black.
lgr.setShader()
You'd have to replace the {0,0,0,255} with each color you want to replace in order from the lightest white pixels for color 1 to the darkest black pixels with color 4. The two shades in between would be between 63 and 127 red for the lighter grey and between 128 and 191 red for the darker one. The Alpha channel is always 255 to make it authentic, unless specifically making the pixel transparent in which case it'd be 0. You could modify the shader to do more than 4 colors if you need to. Just remember the more values you have to send into a shader, the slower the game can run. Right now I'd be sending 4 values for every image, of which there might be around 300, every frame. For a total of about 1200 vec4 variables being sent into the shader every frame.
The scripting? Well the system isn't done and it's quite complicated. I'd have to offer it as a whole for it to even be usable. I'd rather that happen when I'm sure it works fine. It's not done and there are plenty of other modules to write.