   Framebuffer/Shader Cubemapping Problem
http://ioj.com/v/twgxuSomehow, I don't think that's working... :D I've got a coloured cube around the central object(+/-50 around all axes). Normals are defined for the central object, and they work with lighting.However, all I get with my cube mapped object is random noise... I'm rendering the scene to a texture via a rander buffer and frame buffer objects, once to each side of the cube map for each render to the screen.Here's my code:Initialising the FBO and RBO:unsigned int color_tex;unsigned int fb;unsigned int depth_rb;glGenTextures(1, &color_tex); glBindTexture(GL_TEXTURE_CUBE_MAP, color_tex); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+0, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+1, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+2, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+3, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+4, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X+5, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); glGenFramebuffersEXT(1, &fb); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb); //Attach one of the faces of the Cubemap texture to this FBO glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, color_tex, 0); glGenRenderbuffersEXT(1, &depth_rb); glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_rb); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, 512, 512); //Attach depth buffer to FBO glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_rb); //------------------------- //Does the GPU support current FBO configuration? GLenum status; status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); switch(status) {    case GL_FRAMEBUFFER_COMPLETE_EXT:    LogStatus("Good\n");    break;    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:    LogStatus("Unassigned\n");    break;default:    LogStatus("Bad\n");    break; }Rendering to the frame buffer (Every other general render):if(Toggle){printf("Cube cout: %i",CubeCount);switch(CubeCount){case 1:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_Y, color_tex, 0);break;case 2:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_Z, color_tex, 0);break;case 3:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, color_tex, 0);break;case 4:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, color_tex, 0);break;case 5:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, color_tex, 0);break;default:glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_CUBE_MAP_POSITIVE_X, color_tex, 0);break;}CubeCount++;if(CubeCount > 5){CubeCount = 0;}Toggle = false;}else{glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);Toggle = true;}Rendering my object:glTexGeni( GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );glTexGeni( GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );glTexGeni( GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP );glEnable( GL_TEXTURE_GEN_S );glEnable( GL_TEXTURE_GEN_T );glEnable( GL_TEXTURE_GEN_R );glEnable(GL_TEXTURE_CUBE_MAP);glBindTexture(GL_TEXTURE_CUBE_MAP,color_tex);AddShader("CubeMap");MakeShader();for(int i = 0; i < Objects.OBJModels.size(); i++){Objects.OBJModels.Model.Render();//glCallList(Objects.OBJModels.Model.GLList);}DeleteAll();glDisable( GL_TEXTURE_GEN_S );glDisable( GL_TEXTURE_GEN_T );glDisable( GL_TEXTURE_GEN_R );glDisable(GL_TEXTURE_CUBE_MAP);Vertex Shader:varying vec3 normal;varying vec3 view;void main(void){gl_Position = ftransform();normal = normalize(gl_NormalMatrix * gl_Normal);view = normalize(gl_ModelViewMatrix * gl_Vertex).xyz;}Fragment Shader:varying vec3 normal;varying vec3 view;uniform samplerCube cubeMap;void main(void){vec3 reflTexCoord = reflect(view, normal);vec4 reflCol = textureCube(cubeMap, reflTexCoord);gl_FragColor = reflCol;}If anyone could help, I'd very greatly appreciate it!- Sputty[Edited by - LordSputnik on June 16, 2009 11:25:00 AM]