evildead9000
Member
I'm having a difficult time understanding shaders. I've seen numerous video tutorials online and example code, but still feel lost. Here's what I know thus far:
My_Shader.vsh is untouched. The following is written under My_Shader.fsh:
In the "Draw" event of my object I have:
I ran it successfully and it changes the entire sprite a shade of blue. However, I would only like to change yellow hex color FFF200 (which I obtained from my sprite) to the original blue found within the sprite.
I believe I do not have to modify My_Shader.vsh and all code to change yellow to blue needs to be within the My_Shader.fsh code above in main(). I am confused as to how to loop through each pixel to find the yellow value to replace. My understanding is limited at this point and any info would be greatly appreciated.
Thank you!
My_Shader.vsh is untouched. The following is written under My_Shader.fsh:
Code:
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 Base_Color = texture2D( gm_BaseTexture, v_vTexcoord );
float Red = 0.0;
float Green = 0.0;
float Blue = Base_Color.b;
float Alpha = 1.0;
vec4 New_Color = vec4(Red, Green, Blue, Alpha);
gl_FragColor = New_Color;
}
Code:
shader_set(shader_test);
draw_self();
shader_reset();
I believe I do not have to modify My_Shader.vsh and all code to change yellow to blue needs to be within the My_Shader.fsh code above in main(). I am confused as to how to loop through each pixel to find the yellow value to replace. My understanding is limited at this point and any info would be greatly appreciated.
Thank you!