Jump to content
  • Advertisement

Alberto Garc

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

133 Neutral

About Alberto Garc

  • Rank
    Newbie
  1. Sorry I have seen your code again and now I saw that you are using glFramebufferTexture2D function.
  2. Hi, I think that you forget to use the glFramebufferTexture2D funcion, which allow you to attach a texture to a frame buffer. Here you have an example, in the OpenGL wiki, where two textures are attached, the first one is attached to a color component, and the other one is attached to the depth component.
  3. Maybe these tutorials can help you with your normal mapping shader:   http://www.geeks3d.com/20091019/shader-library-bump-mapping-shader-with-multiple-lights-glsl/ http://learnopengl.com/#!Advanced-Lighting/Normal-Mapping   Best regards, Alberto.
  4. Thanks for your response. :)
  5. Thanks for your response I have tried multiply my lightPos * gl_ModelViewMatrix and I have the same result, in addition I have follow the tutorial in lighthouse3d and I have the same result.
  6. Hi there, I'm triyng to do a simple point entity light shader where the light position is harcoded in the shader ( 0, 0, 0 ). The problem is that when I move my ball, it always recives the light in the same direction.   This is my vertex shader: vec4 lightPos; vec3 vertexPos, normal, s; varying float i; void main() { normal = normalize( gl_NormalMatrix * gl_Normal ); vertexPos = vec3( gl_ModelViewMatrix * gl_Vertex ); lightPos = vec4( 0, 0, 0, 1 ); s = normalize( lightPos - vertexPos ); // The diffuse shading equation i = dot( normal, s ); gl_Position = ftransform(); } And this my fragment shader: varying float i; void main (void) { gl_FragColor = vec4( i, i, i, 1.0); } In the picture attach you can see the result. Allways is the same result when I move it arroun the 0,0,0 position.   Any help is welcome, thaks in advance.  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!