Hi,
For a project I’m working on I to work with an OpenGL engine someone made himself. We tried the engine on different laptops and everywhere it works normal. However due to some unknown cause I can’t see models on my screen. I believe the problem lies within the vertex shaders we use. Still I have little to no knowledge of shaders so I can’t be 100% sure about it.
I have an ATI Mobility Radeon HD 5600/5700 series graphics card with the latest drivers. Driver date is 2011-01-26. Version is 8.821.0.0
I added a screenshot how it should look like and a screenshot
how it’s displayed on my screen.
And this are the shaders we use:
vertex.glsl
#version 140
precision highp float;
uniform mat4 camera_matrix;
uniform mat4 model_matrix;
uniform mat4 projection_matrix;
uniform vec3 model_scale;
in vec3 in_Vertex;
in vec3 in_Normal;
in vec2 in_UV;
out vec3 out_Vertex;
out vec3 out_Normal;
out vec2 out_UV;
void main()
{
vec4 pos=model_matrix*vec4(in_Vertex.x*model_scale.x,in_Vertex.y*model_scale.y,in_Vertex.z*model_scale.z,1.0);
out_Vertex=pos.xyz;
out_Normal=mat3(model_matrix)*in_Normal;
out_UV=in_UV;
gl_Position=projection_matrix*mat4(mat3(camera_matrix))*(pos+vec4(camera_matrix[3][0],camera_matrix[3][1],camera_matrix[3][2],0));
}
fragment.glsl
#version 140
precision highp float;
uniform struct
{
int m_Active;
vec3 m_Ambient;
vec3 m_Diffuse;
vec3 m_Specular;
float m_Shine;
} Material;
uniform sampler2D texture0;
in vec3 out_Vertex;
in vec3 out_Normal;
in vec2 out_UV;
void main(void)
{
if(Material.m_Active==1)
{
gl_FragColor=texture2D(texture0,out_UV.st);
}
else
{
gl_FragColor=vec4(Material.m_Diffuse,1.0);
}
//gl_FragColor=vec4(out_Vertex.x*0.2+0.5,out_Vertex.y*0.2+0.5,out_Vertex.z*0.2+0.5,1.0);
}
Anyone who knows what the cause could be? Because I’m really stuck if I can’t fix this