N
NeXy
Guest
Hi,
I'm trying to achieve a "true" limited palette effect like it was on the NES devices.
Notice in the example below how even though the screen is fading, only the colors corresponding to a predefined palette are being drawn:
I would like to achieve the same effect for my game. I'm using Dawnbringer's 16 Color Palette
for all my sprites, but if I draw anything with any opacity through code - whether it's lights, or for example when Player is transitioning between rooms I would draw a black rectangle across the screen which would "fade-in/out" as the transition is happening. As the black rectangle is changing it's opacity, all the game sprites drawn beneath it will blend with the black color at it's current alpha value, and thus produce color that is outside of the range of the above mentioned limited palette.
Although I have rather limited knowledge when it comes to shaders, through some research I've deducted I would definitely need to use one to achieve the desired effect. Namely, a shader that I can pass a limited palette through which will then, depending on values of colors on-screen, round each one to the nearest color on the given palette.
I've found this: GameBoyShader on Game Maker marketplace, and was able, with my limited knowledge, to modify it so it accepts more than 4 colors. The end result was still not as desired, as the way the shader is built will round to colors "linearly", meaning we can only round to color from darkest to lightest and not have for example - orange go to yellow then white, while another orange sprite goes to red instead as the blended color over that sprite was closest to the red from the palette at that moment. I probably can't post the code as this is a paid asset, but if I'm wrong maybe someone who has more experience using it can correct me.
Anyways, I hope my explanation was sufficient, this really was the bane of the progress of my game for quite some time, as I had no luck finding a shader that does this, but if there is one in existence it would be a godsend if you can provide me with a link. Otherwise, any form of help, guidance, instructions or links to tutorials would be greatly appreciated.
EDIT: I'm using GMS2 if it's relevant.
-Thanks in advance!
I'm trying to achieve a "true" limited palette effect like it was on the NES devices.
Notice in the example below how even though the screen is fading, only the colors corresponding to a predefined palette are being drawn:
I would like to achieve the same effect for my game. I'm using Dawnbringer's 16 Color Palette
for all my sprites, but if I draw anything with any opacity through code - whether it's lights, or for example when Player is transitioning between rooms I would draw a black rectangle across the screen which would "fade-in/out" as the transition is happening. As the black rectangle is changing it's opacity, all the game sprites drawn beneath it will blend with the black color at it's current alpha value, and thus produce color that is outside of the range of the above mentioned limited palette.
Although I have rather limited knowledge when it comes to shaders, through some research I've deducted I would definitely need to use one to achieve the desired effect. Namely, a shader that I can pass a limited palette through which will then, depending on values of colors on-screen, round each one to the nearest color on the given palette.
I've found this: GameBoyShader on Game Maker marketplace, and was able, with my limited knowledge, to modify it so it accepts more than 4 colors. The end result was still not as desired, as the way the shader is built will round to colors "linearly", meaning we can only round to color from darkest to lightest and not have for example - orange go to yellow then white, while another orange sprite goes to red instead as the blended color over that sprite was closest to the red from the palette at that moment. I probably can't post the code as this is a paid asset, but if I'm wrong maybe someone who has more experience using it can correct me.
Anyways, I hope my explanation was sufficient, this really was the bane of the progress of my game for quite some time, as I had no luck finding a shader that does this, but if there is one in existence it would be a godsend if you can provide me with a link. Otherwise, any form of help, guidance, instructions or links to tutorials would be greatly appreciated.
EDIT: I'm using GMS2 if it's relevant.
-Thanks in advance!
Last edited by a moderator: