• Content count

  • Joined

  • Last visited

Community Reputation

100 Neutral

About torelocks

  • Rank
  1. Hi guys, firstly thanks for your quick replies. @jesse, you make a very good point about understanding the content before compiling. This is what I'm trying to do, chapter by chapter but i was totally stumped with this one. Thanks for pointing out that the output vertex variables need to be named the same as the input fragment ones...that was a detail I missed! @Luke, much thanks for those bugfixes; the problem i was hitting is fixed. it was indeed one of the problems referred to in the fix notes: [quote] * Since release, certain drivers (specifically AMD) started requiring precision qualifiers in the fragment shader causing the examples to fail while compiling the shader. All shaders are now fixed and an accompanying document gives a brief explanation of the issue.[/quote] I did notice that one of the other bug-fixes is not fixed (as far as I can tell): [quote] An incorrect size was passed to glGetShaderInfoLog causing any log output to be truncated. [/quote] I'm guessing this is Luke Benstead...if so, thanks for writing a clear and readable book. One suggestion I would make is to place links to these bug-fixes on: [url=""][/url] as the book says that's the support web-site and there's currently no support available there. Again, thanks for your help. It's great to see a friendly and helpful community. Hopefully i can give some back down the line T
  2. Hi guys, I'm hoping smeone can give me some advice. I recently got "Beginning OpenGL Game Programming 2nd edition" by Luke Bernstead. The first thing i have been doing is doing is reading through and compiling / running the projects. When I get to the first one with a fragment shader (Chapter 6) however, it bombs out. After some debugging, I've narrowed it down to the fragment shader. this is the supplied shader: [code]#version 130 in vec4 color; out vec4 outColor; void main(void) { outColor = color; }[/code] I tried changing the shader to something like this, which allows the program to run but everything is rendered black: [code]void main() { gl_FragColor = gl_Color; }[/code] [as far as I can tell this is deprecated anyway] I also mentioned the vert shader works; here it is: [code]#version 130 uniform mat4 projection_matrix; uniform mat4 modelview_matrix; in vec3 a_Vertex; in vec3 a_Color; out vec4 color; void main(void) { vec4 pos = modelview_matrix * vec4(a_Vertex, 1.0); gl_Position = projection_matrix * pos; color = vec4(a_Color, 1.0); } [/code] When I investigate what glGetShaderInfoLog says, all i get is: [quote]- Fragment Shader Fai[/quote] useful, huh? Unfortunately, I'm new to this whole thing and after a lot of searching on-line I'm still at an impasse. I hoping by posting here someone would be able to help me. Oh yeah, my laptop's graphics card is: ATI Radeon HD 4500 series. I ran GPUCapsViewer; which told me that the card is fully shader version 1.3 compatible. Any help appreciated, am i doing something wrong?!