I have two GL_RGBA32UI FBO textures, which I use to store current state of particle positions/velocities per texel. The first I fill with data like this only once: Per render loop the second one is written to via a shader while the first is used as texture and the second as target. I do that by drawing a quad of
Tag: opengl-es
OpenGL ES rotating shape around its center
I tried to rotate rectangle using rotateMatrix, following tutorial on https://developer.android.com/training/graphics/opengl/motion, but when I runned it, the rectangle is rotating around (I think) point 0,0. What do I need to change to make it rotate around it’s center? Answer If you want to rotate around a pivot you have to: Translate the object so that the pivot point is moved
Java IOExeption reading file android
I’m trying to get an Opengl es app working and I’m currently working on the shaders. To do that I need to open tow text files situated in src/shaders/ Here is my code: private static int LoadShader(…
Problem with texture not showing in screen. OpenGL ES
I am newbie in opengl es 2 programming, I was trying to load a texture in png format in my test application. I used PNGDecoder to do this, but just the black rectangle and the line are show in the screen. What is wrong? Renderer: Fragment Shader: Vertex Shader: Square2D (is used to store vertex positions): Answer glVertexAttribPointer can be
OpenGL Alpha values having no effect in shader
I have a simple shader to make scanlines in my 2d game which works fine and is as follows: #ifdef GL_ES precision mediump float; #endif varying vec4 v_color; varying vec2 v_texCoords; uniform …