Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Apr 2010
Offline Last Active May 20 2012 07:19 AM

#4780982 Depth bias clamping in opengl

Posted by on 02 March 2011 - 07:47 AM

I don't know anything about direct X but can it be that u'R looking for polygon offset, it's an extension from OpenGL 1.0


#4780060 Animation And Shaders

Posted by on 28 February 2011 - 07:05 AM

animating an object(skinning) on the CPU or GPU is mostly the same, but when u want to animate purely on the GPU it is perhaps a lot harder for a beginner to get it working because he not only need to get the transformations right but also all the restrictions you have with shaders and so on.

So I guess that the author just explains the basics of animation with a CPU implementations cause it is not as complex as a GPU implementation.
If u want to write your own animation routines first try it out on the CPU cause it will be much easier for you to get it working, but of course a GPU implementation will be a lot faster in the end

#4770366 Render To Texture with GLSL: Elevation map -> Normal texture

Posted by on 06 February 2011 - 05:37 AM

  • create FBO
  • create your normal texture and attach it to the FBO
  • set viewport to normal texture size
  • use a shader with a screenquad vertex and a fragment shader with your desired calculations.
  • render a single quad with the coords from (-1, -1) to (1, 1)
In the vertex shader u would just copy the position input(no matrix calculations), and calculate the texcoord from the position ( (pos +1) * 0.5, so it's in the [0, 1] range)
In the fragment shader u calculate what ever you want. You properly have to tell the shader how big one pixel is to sample neighbor pixels from the one you are right now processing(pixel size = 1. / texturesize).

#4761215 Vertex Array Objects... good or bad?

Posted by on 19 January 2011 - 06:08 AM

I think that there is no case were using VAOs isn't useful, it might not speed up your calculations a lot,
but makes managing all the different meshes you want to render a lot easier.

i think you mixed up Vertex Arrays with Vertex Array Objects. Also i think that we shouldn't use the name VBO anymore cause there is no such thing as Vertex Buffer Objects anymore.
We have simple Buffer Objects which can be used for a lot of different stuff (Uniform block, Texture and of course Vertex Data).