mercredi 11 mars 2015

How to use random matrix in fragment shader in samsung android devices?


Vote count:

0




I am new to opengl ,This is the fragment shader code i am using for rendering but in all samsung devices it shows only red color and in nexus 4,5 it gives correct result, there is no linking error , even if i simply initialize matrix without using,it gives red color , i searched and found there is some issue with mali gpu. How can i define a random matrix and use that matrix in fragment shader code so that it gives me correct result on all platform.



fragmentShaderCode5 =
"#extension GL_OES_EGL_image_external : require\n"
+ "precision lowp float;"
+ "varying vec2 v_TexCoordinate;"
+ " mat4 colorMatrix;"
+ "uniform samplerExternalOES texture;"
+ "void main()\n {"
+ " mat4 colorMatrix = mat4(0.3588f, 0.7044f, 0.1368f, 0f,
0.2990f,0.5870f, 0.1140f, 0f, 0.2392f, 0.4696f, 0.0912f ,0f,
0f,0f,0f,0f);"
+ " vec4 color = texture2D(texture, v_TexCoordinate);"
+ " vec4 outputColor = color*colorMatrix ;"
+ " gl_FragColor = (0.1 * color) + ((1.0 - 0.1) *
outputColor);"
+ "}";


asked 17 secs ago







How to use random matrix in fragment shader in samsung android devices?

Aucun commentaire:

Enregistrer un commentaire