I try to send values to the GLSL, int is just all right, but float comes out strange.
Ubuntu 10.04LTS
Graphics card: G105M
Here is my vertex shader:
#version 110
attribute vec4 a_vertex;
attribute vec3 a_texCoord;
varying vec2 v_texCoord;
uniform float u_time;
void main()
{
gl_Position=vec4(a_vertex.x+u_time,a_vertex.y,a_vertex.z,1);
v_texCoord=a_texCoord.xy;
}
Here is my c code:
GLint timeLoc=glGetUniformLocation(splash_screen.proHandle,"u_time");
glUniform1f(timeLoc,1.0);
Here is the strange thing: if I change the u_time to int type, it works all right. But if I go with a float it is very strange.
if I use int,the vertex x will +1,but if i use float the vertex x not change.
I think i found it.
I port my program to Android,it work well.
It’s my computer’s problem(90% is the graphic card driver)
I finall found it.
I port my program to android,it work well
It’s my computer’s problem(90% is the graphic card driver)