I am working on opengl es 2.0 for android application. I have a model for which i apply texture. I do this by using the below shaders. Its a simple shader.
In the below shader when the texture file is transparent at some places I get a black color. Instead I want to find the places where it is transparent and give a particular color like RGB(0.6,0.7,0.3). Please let me know how to modify the below shader to get this in my model.
protected static final String mVShader =
"uniform mat4 uMVPMatrix;\n" +
"attribute vec4 aPosition;\n" +
"attribute vec2 aTextureCoord;\n" +
"varying vec2 vTextureCoord;\n" +
"void main() {\n" +
" gl_Position = uMVPMatrix * aPosition;\n" +
" vTextureCoord = aTextureCoord;\n" +
"}\n";
protected static final String mFShader =
"precision mediump float;\n" +
"varying vec2 vTextureCoord;\n" +
"uniform sampler2D uTexture0;\n" +
"void main() {\n" +
" gl_FragColor = texture2D(uTexture0, vTextureCoord);\n" +
"}\n";