how to change the color of the application surface, using the texture??

https://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes

https://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes#/media/File:CGA_palette_color_test_chart.png

my fragment shader start in this way:

varying vec2 v_vTexcoord;
varying vec4 v_vColour;

void main()
{
    gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
}

thanks

share|improve this question

One way would be to have another 1D texture which holds your texture palette. You could then have a uniform which is an offset for the start of the palette. If you turn on texture wrapping, you can simply add the offset to the x coordinate when you sample the texture and you'll be able to rotate the palette.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.