New answers tagged

0

Last week, I moved the code about determining color from the vertex fragment to the fragment shader, it worked. That is to say, Fragment Shader varying vec3 v_pos; void main( void ) { gl_FragColor = vec4(vec3(step(v_pos.x, 0.), 0., step(0., v_pos.x)), 1.); } Vertex Shader varying vec3 v_pos; void main() { v_pos = position; vec4 mvPosition =...


2

Now that I read my question I noticed the bug. I used GL11/GL_TEXTURE_1D instead of GL11/GL_TEXTURE_2D for the second texture, sorry: (def dep-texture (GL11/glGenTextures)) (GL13/glActiveTexture GL13/GL_TEXTURE1) (GL11/glBindTexture GL11/GL_TEXTURE_2D dep-texture) (GL20/glUniform1i (GL20/glGetUniformLocation program "dep") 1) (GL11/glTexImage2D ...


0

Ok, so I managed to get it working. My code had many problems, first of all the modulus operand % which is not supported by GLSL ES. I had to use the mod function and, as I found on the official docs, the function needs to be called with the two operands as parameters. As I can understand from the docs, I also had to give the value to divide for as a float. ...


Top 50 recent answers are included