Unsigned char color // All assigned to value of 255 Structure that holds my vertex information: struct Vertex MTexture = glGetUniformLocation(mProgramId, "Texture0") GlBindAttribLocation(mProgramId, 2, "vColor") GlBindAttribLocation(mProgramId, 1, "vTexCoord") GlBindAttribLocation(mProgramId, 0, "vPosition") Gl_FragColor = texture2D(Texture0, varTexCoord) * varColor Īfter shader is linked, I'm binding my attributes like this: mMatrixMVP = glGetUniformLocation(mProgramId, "modelViewProjectionMatrix") Gl_Position = modelViewProjectionMatrix * vPosition įragment shader: precision mediump float ( Added some screenshots to show what I mean)Ĭan someone help me to figure out what am I doing wrong, or point me in the right direction? Thanks. But if I use color values from the " vColor" attribue - everything gets messed up. When I specify it directly in the vertex shader ( "varColor = vec4(1.0, 0.5, 0.4, 1.0) ") - everything is ok. I'm struggling a bit to apply the color for my geometry.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |