Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用英特尔hd 3000的opentk c#上的深度纹理和fbo问题_C#_Opengl_Opentk_Fbo_Depth Buffer - Fatal编程技术网

使用英特尔hd 3000的opentk c#上的深度纹理和fbo问题

使用英特尔hd 3000的opentk c#上的深度纹理和fbo问题,c#,opengl,opentk,fbo,depth-buffer,C#,Opengl,Opentk,Fbo,Depth Buffer,我目前在使用英特尔高清图形硬件实现阴影映射效果时遇到了一个问题。我认为这段代码与我想要的结果相差不远,因为这段代码片段在ATI Mobility Radeon 5650和Nvidia NVS 4200M上运行良好,但在Intel HD 3000和4000上不起作用 GL.GenTextures(1, out ShadowMap); GL.BindTexture(TextureTarget.Texture2D, ShadowMap); GL.TexParameter(Tex

我目前在使用英特尔高清图形硬件实现阴影映射效果时遇到了一个问题。我认为这段代码与我想要的结果相差不远,因为这段代码片段在ATI Mobility Radeon 5650和Nvidia NVS 4200M上运行良好,但在Intel HD 3000和4000上不起作用

    GL.GenTextures(1, out ShadowMap);
    GL.BindTexture(TextureTarget.Texture2D, ShadowMap);
    GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Nearest);
    GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Nearest); 
    GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int)TextureWrapMode.Clamp);
    GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int)TextureWrapMode.Clamp);
    GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureCompareFunc, (int)All.Lequal);
    GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.DepthComponent32, SHADOW_MAP_SIZE, SHADOW_MAP_SIZE, 0, OpenTK.Graphics.OpenGL.PixelFormat.DepthComponent, PixelType.Float, IntPtr.Zero);

    GL.BindTexture(TextureTarget.Texture2D, 0);

    GL.GenFramebuffers(1, out FBO);
    GL.BindFramebuffer(FramebufferTarget.Framebuffer, FBO);

    DrawBuffersEnum dbe = DrawBuffersEnum.None;
    GL.DrawBuffers(0, ref dbe);

    GL.FramebufferTexture2D(FramebufferTarget.Framebuffer, FramebufferAttachment.DepthAttachment, TextureTarget.Texture2D, ShadowMap, 0);


    FramebufferErrorCode status = GL.CheckFramebufferStatus(FramebufferTarget.Framebuffer);

    GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
“status”变量表示FrameBufferIncompleReadBuffer,因此此fbo的使用将不正确(从灯光POV渲染场景)。 我在网上看到了这个状态,但我没有找到解决我问题的答案。 那么我在这段代码上做错了什么和/或FBO问题的根源是什么。 提前谢谢。
PS:在着色器中,我使用1.2版本,我应该将阴影贴图纹理作为深度贴图进行采样。

对于遇到sampe问题的人, 它只是更新最新的驱动程序,我在问我的问题之前考虑过这一点,但是Windows7告诉我我有最新的驱动程序(这是错误的)