• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

132 Neutral

About dchristopherfennell

  • Rank
  1. Anyone here a self-taught graphics programmer?

    My degree is math with a minor in computer science. I fell in love wiith graphics programming when I was doing simulation work for a defense contractor. I started off using DirectX and learned OpenGL on my own. I am completely self taught, with a lot of help from these forums. I never had a mentor so I am always wondering if what I did was really the correct way to do it. You will have to get used to doing a lot of online searches for tutorials/examples. The graphic APIs (DirectX and OpenGL) move at a fast pace. I am in awe of people who are able to keep up with it all. I was in gaming for 12.5+ years and now I am back to simulations.
  2. glProgramBinary crashes

    Running on ATI, if my shaders are compiled with 12.1 drivers and loaded with 12.2 drivers, glBinaryProgram will crash. I assumed that I would get an invalid link, which will let me know they need to be recompiled. I ran another application which had the same thing happen. Anyone else experience this?
  3. wglGetPixelFormat : GL_INVALID_OPERATION

    For anyone else reading about this problem, the answer appears to be related to NVIDIA cards with the beta glIntercept. You can read more about it here: [url="http://blog.podvilla.com/?p=41"]My link[/url] The latest glIntercept fixes the problem: [url="http://code.google.com/p/glintercept/"]download[/url] If you don't download the latest app, you can prevent this error from occurring by turning off "Threaded Optimization" under your 3D management menu in NVIDIA settings.
  4. GLSL: glLinkProgram slow with instancing

    Thanks for the input. I'm glad to know that it wasn't just me. I've contacted ATI about this too.
  5. GLSL: glLinkProgram slow with instancing

    Perhaps the statement should have been that glLinkProgram is slow with UBO's containing large arrays.
  6. Anyone have this problem with instancing? I have a uniform buffer object shared between shaders. The block looks like this: #version 150 #extension GL_ARB_uniform_buffer_object : enable uniform MatrixBlock { mat4 MVMatrix; mat4 NormalMatrix; mat4 ProjectionMatrix; }; uniform InstanceBlock { vec4 rotation[1000]; vec4 position[1000]; }; .... mat4 quatToMatrix(in vec4 q); void main() { mat4 world = quatToMatrix(rotation[gl_InstanceID]); world[3][0] = position[gl_InstanceID].x; world[3][1] = position[gl_InstanceID].y; world[3][2] = position[gl_InstanceID].z; .... } This causes glLinkProgram to take a very long time to link for each shader that uses this block. It's painfully slow. If I reduce the number from 1000 to 100 for the position and rotation arrays, the link is considerably faster. I'm compiling on ATI 5700 HD series. Is this the norm or am I doing it wrong?
  7. FBO and cube maps

    The target sent to glFramebufferTexture2DEXT to render a specific 'face' is GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face. For example: glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB + face, cubemapTextureID, 0);
  8. Shadow map with a multiple textured scene

    You are right about the texture matrix. I discovered that problem yesterday after I posted. The texture matrix needs to be set for the correct texture unit and the shadows now appear. ...Now to solve all the other visual anomalies :) Thanks for the input
  9. All the tutorial examples I see using shadow maps use one texture, the shadow map texture, and apply it to a scene with no textures The scene depth information is rendered to a shadow map The scene is rendered using a low ambient light The scene is finally rendered with the shadow map applied. I'm not using shaders for my shadows. I'm having trouble understanding how to apply this in a scene with multiple textures. All examples I see have the shadow map bound to glActiveTextureARB(GL_TEXTURE0_ARB), then apply the "compare R" to texture node and render the scene (spheres, boxes, pyramids etc...without textures) If you are rendering a scene that binds textures to GL_TEXTURE0_ARB texture unit (trees, buildings, etc), then I assume you can set the shadow map to glActiveTextureARB(GL_TEXTURE1_ARB) or higher (glActiveTextureARB(GL_TEXTURE7_ARB), for example) and it would work. However, I do not get any shadows. What if the scene is multi-textured? First Pass: Render the scene from the light point of view Copy the depth information to a depth texture Second Pass: Render the scene with a low ambient/diffuse light to make the shadow color Third pass: Render the scene by applying the shadow map Code for third pass (From one of the tutorials) glEnable(GL_DEPTH); glDepthFunc(GL_LEQUAL); glMatrixMode(GL_TEXTURE); glLoadIdentity(); glTranslatef(0.5f, 0.5f, 0.5f); glScalef(0.5f, 0.5f, 0.5f); glMultMatrixf(lightProjection); glMultMatrixf(lightModelview); glMatrixMode(GL_MODELVIEW); GLfloat splane[4] = {1, 0, 0, 0}; GLfloat tplane[4] = {0, 1, 0, 0}; GLfloat rplane[4] = {0, 0, 1, 0}; GLfloat qplane[4] = {0, 0, 0, 1}; glActiveTextureARB(GL_TEXTURE1_ARB); <----- HERE IS WHAT HAS CHANGED glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _shadowtexture); glEnable(GL_TEXTURE_GEN_S); glEnable(GL_TEXTURE_GEN_T); glEnable(GL_TEXTURE_GEN_R); glEnable(GL_TEXTURE_GEN_Q); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_Q, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGenfv(GL_S, GL_EYE_PLANE, splane); glTexGenfv(GL_T, GL_EYE_PLANE, tplane); glTexGenfv(GL_R, GL_EYE_PLANE, rplane); glTexGenfv(GL_Q, GL_EYE_PLANE, qplane); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE); glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_COMPARE_FUNC_ARB, GL_LEQUAL); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.9); RenderScene(); // Reset states here I have not been able to find a solution for this that does not use shaders. Any help or insight is appreciated.
  10. Two readings helped me out with this intially. For the math, read up on Eric Lengyel. He gives a good explanation on this discussion forum: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/011349.html He also has another example here: http://www.terathon.com/code/tangent.html This article is one that many people point to for a basic explanation: http://www.paulsprojects.net/tutorials/simplebump/simplebump.html
  • Advertisement