migueltk's picture

Shadow Map Test Help

I'm trying to adapt this tutorial GLSL shadow mapping to OpenTK, but again and again I get the following OpenGL error "OpenGL error: InvalidFramebufferOperationExt". The code is the same and the original executable works fine on my computer.

Test code: ShadowMapCode

Someone can help me, thanks.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

It appears to work correctly on my Nvidia system. Which line is causing this error? (Try running with the debug version of OpenTK).

flopoloco's picture

Great application Miguel!

I have Windows 7 and nVidia GTX295, It works fine also on my system.

I have heard in many cases people complain that there are incompatibility issues between nVidia and Ati GLSL code. I don't know exactly but that could be the case, just throwing ideas.

migueltk's picture

I find the first error, first frame, after line GL.Clear(ClearBufferMask.DepthBufferBit);, the method OnRenderFrame ().

Same error on Ubuntu 12.04 (64bits) and Windows 7 (32bits), ATI drivers updated.

Visual Studio Diagnostics debug out:

'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\10.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'D:\Proyectos\Proyectos-2012\ShadowMapTest\ShadowMapTest\bin\Debug\ShadowMapTest.vshost.exe', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_es_b77a5c561934e089\mscorlib.resources.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
El subproceso 'vshost.NotifyLoad' (0xe28) terminó con código 0 (0x0).
El subproceso '' (0x1120) terminó con código 0 (0x0).
El subproceso 'vshost.LoadReference' (0xdac) terminó con código 0 (0x0).
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'D:\Proyectos\Proyectos-2012\ShadowMapTest\ShadowMapTest\bin\Debug\ShadowMapTest.exe', símbolos cargados.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'D:\Proyectos\Proyectos-2012\ShadowMapTest\ShadowMapTest\bin\Debug\OpenTK.dll', símbolos cargados.
Excepción del tipo 'System.DllNotFoundException' en OpenTK.dll
Excepción del tipo 'System.TypeInitializationException' en OpenTK.dll
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll', se omitió la carga de símbolos. Se optimizó el módulo y se habilitó la opción 'Solo mi código'.
Detected configuration: Windows / .Net
Excepción del tipo 'System.DllNotFoundException' en OpenTK.dll
DisplayDevice 1 (primary) supports 96 resolutions.
Creating default GraphicsMode (32, 16, 0, 0, 0, 2, False).
Creating GraphicsContext.
GraphicsMode: Index: 2, Color: 0 (0000), Depth: 0, Stencil: 0, Samples: 0, Accum: 0 (0000), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 1180608, Parent (Windows.WindowInfo: Handle 197640, Parent (null))
GraphicsContextFlags: Default
Requested version: 1.0
Loaded opengl32.dll: 1449656320
OpenGL will be bound to window:1180608 on thread:8
Setting pixel format... 2
Creating temporary context for wgl extensions.
Load extensions for OpenTK.Platform.Windows.Wgl... 60 extensions loaded in 13 ms.
Using WGL_ARB_create_context... success! (id: 131072)
Retrieving ARB pixel formats.... Disposing context 131072.
Destroying window: Windows.WindowInfo: Handle 197640, Parent (null)
Creating GraphicsContext.
GraphicsMode: Index: 2, Color: 32 (8888), Depth: 24, Stencil: 8, Samples: 0, Accum: 0 (0000), Buffers: 2, Stereo: False
IWindowInfo: Windows.WindowInfo: Handle 459716, Parent (Windows.WindowInfo: Handle 263176, Parent (null))
GraphicsContextFlags: Default
Requested version: 1.0
OpenGL will be bound to window:459716 on thread:8
Setting pixel format... 2
Using WGL_ARB_create_context... success! (id: 196608)
Load extensions for OpenTK.Platform.Windows.Wgl... 60 extensions loaded in 1 ms.
Loading extensions for OpenTK.Graphics.OpenGL.GL... 2279 extensions loaded in 361.2014 ms.
Linking Program (3) succeeded.
Program registered 3 Attributes.
Unbind of ShaderBase build. GL Error: NoError
FBO: An attachment point referenced by GL.DrawBuffers() doesn’t have an attachment.
Entering main loop.
'ShadowMapTest.vshost.exe' (Administrado (v2.0.50727)): se cargó 'D:\Proyectos\Proyectos-2012\ShadowMapTest\ShadowMapTest\bin\Debug\OpenTK.Compatibility.dll', símbolos cargados.
Excepción del tipo 'OpenTK.Graphics.GraphicsErrorException' en OpenTK.dll

Ubuntu 12.04 glxinfo.txt.

OpenTK OpenGL Diagnostics:

Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 3800 Series
GL Version: 3.1.11631 Compatibility Profile Context
MajorVersion: 3
MinorVersion: 1
GLSL Version: 3.30
Extensions:
GL_AMDX_debug_output
GL_AMDX_vertex_shader_tessellator
GL_AMD_conservative_depth
GL_AMD_debug_output
GL_AMD_depth_clamp_separate
GL_AMD_draw_buffers_blend
GL_AMD_name_gen_delete
GL_AMD_performance_monitor
GL_AMD_pinned_memory
Vendor: ATI Technologies Inc.
Renderer: ATI Radeon HD 3800 Series
GL Version: 3.1.11631 Compatibility Profile Context
MajorVersion: 3
MinorVersion: 1
GLSL Version: 3.30
Extensions:
GL_AMDX_debug_output
GL_AMDX_vertex_shader_tessellator
GL_AMD_conservative_depth
GL_AMD_debug_output
GL_AMD_depth_clamp_separate
GL_AMD_draw_buffers_blend
GL_AMD_name_gen_delete
GL_AMD_performance_monitor
GL_AMD_pinned_memory
GL_AMD_sample_positions
GL_AMD_sample_positions
GL_AMD_shader_stencil_export
GL_AMD_texture_cube_map_array
GL_AMD_texture_texture4
GL_AMD_vertex_shader_tessellator
GL_ARB_ES2_compatibility
GL_ARB_base_instance
GL_ARB_blend_func_extended
GL_ARB_color_buffer_float
GL_ARB_compressed_texture_pixel_storage
GL_ARB_conservative_depth
GL_ARB_copy_buffer
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_buffers_blend
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_explicit_attrib_location
GL_ARB_fragment_coord_conventions
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB
GL_ARB_geometry_shader4
GL_ARB_get_program_binary
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_imaging
GL_ARB_instanced_arrays
GL_ARB_internalformat_query
GL_ARB_map_buffer_alignment
GL_ARB_map_buffer_range
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_occlusion_query2
GL_ARB_pixel_buffer_object
GL_AMD_shader_stencil_export
GL_AMD_texture_cube_map_array
GL_AMD_texture_texture4
GL_AMD_vertex_shader_tessellator
GL_ARB_ES2_compatibility
GL_ARB_base_instance
GL_ARB_blend_func_extended
GL_ARB_color_buffer_float
GL_ARB_compressed_texture_pixel_storage
GL_ARB_conservative_depth
GL_ARB_copy_buffer
GL_ARB_depth_buffer_float
GL_ARB_depth_clamp
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_draw_buffers_blend
GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced
GL_ARB_explicit_attrib_location
GL_ARB_fragment_coord_conventions
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB
GL_ARB_geometry_shader4
GL_ARB_get_program_binary
GL_ARB_half_float_pixel
GL_ARB_half_float_vertex
GL_ARB_imaging
GL_ARB_instanced_arrays
GL_ARB_internalformat_query
GL_ARB_map_buffer_alignment
GL_ARB_map_buffer_range
GL_ARB_multisample
GL_ARB_multitexture
GL_ARB_occlusion_query
GL_ARB_occlusion_query2
GL_ARB_pixel_bufferGL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_provoking_vertex
GL_ARB_sample_shading
GL_ARB_sampler_objects
GL_ARB_seamless_cube_map
GL_ARB_separate_shader_objects
GL_ARB_shader_bit_encoding
GL_ARB_shader_objects
GL_ARB_shader_precision
GL_ARB_shader_stencil_export
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shading_language_420pack
GL_ARB_shading_language_packing
GL_ARB_shadow
GL_ARB_shadow_ambient
GL_ARB_sync
GL_ARB_texture_border_clamp
GL_ARB_texture_buffer_object
GL_ARB_texture_buffer_object_rgb32
GL_ARB_texture_compression
GL_ARB_texture_compression_rgtc
GL_ARB_texture_cube_map
GL_ARB_texture_cube_map_array
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_gather
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_multisample
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_texture_rg
GL_ARB_texture_rgb10_a2ui
GL_ARB_texture_snorm
GL_ARB_texture_storage
_object
GL_ARB_point_parameters
GL_ARB_point_sprite
GL_ARB_provoking_vertex
GL_ARB_sample_shading
GL_ARB_sampler_objects
GL_ARB_seamless_cube_map
GL_ARB_separate_shader_objects
GL_ARB_shader_bit_encoding
GL_ARB_shader_objects
GL_ARB_shader_precision
GL_ARB_shader_stencil_export
GL_ARB_shader_texture_lod
GL_ARB_shading_language_100
GL_ARB_shading_language_420pack
GL_ARB_shading_language_packing
GL_ARB_shadow
GL_ARB_shadow_ambient
GL_ARB_sync
GL_ARB_texture_border_clamp
GL_ARB_texture_buffer_object
GL_ARB_texture_buffer_object_rgb32
GL_ARB_texture_compression
GL_ARB_texture_compression_rgtc
GL_ARB_texture_cube_map
GL_ARB_texture_cube_map_array
GL_ARB_texture_env_add
GL_ARB_texture_env_combine
GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_gather
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_multisample
GL_ARB_texture_non_power_of_two
GL_ARB_texture_rectangle
GL_ARB_texture_rg
GL_ARB_texture_rgb10_a2ui
GL_ARB_texture_snorm
GL_ARB_tGL_ARB_timer_query
GL_ARB_transform_feedback2
GL_ARB_transform_feedback3
GL_ARB_transform_feedback_instanced
GL_ARB_transpose_matrix
GL_ARB_uniform_buffer_object
GL_ARB_vertex_array_bgra
GL_ARB_vertex_array_object
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_vertex_type_2_10_10_10_rev
GL_ARB_viewport_array
GL_ARB_window_pos
GL_ATI_draw_buffers
GL_ATI_envmap_bumpmap
GL_ATI_fragment_shader
GL_ATI_meminfo
GL_ATI_separate_stencil
GL_ATI_texture_compression_3dc
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_bindable_uniform
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_copy_buffer
GL_EXT_copy_texture
GL_EXT_direct_state_access
GL_EXT_draw_buffers2
GL_EXT_draw_instanced
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multisample
exture_storage
GL_ARB_timer_query
GL_ARB_transform_feedback2
GL_ARB_transform_feedback3
GL_ARB_transform_feedback_instanced
GL_ARB_transpose_matrix
GL_ARB_uniform_buffer_object
GL_ARB_vertex_array_bgra
GL_ARB_vertex_array_object
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_vertex_type_2_10_10_10_rev
GL_ARB_viewport_array
GL_ARB_window_pos
GL_ATI_draw_buffers
GL_ATI_envmap_bumpmap
GL_ATI_fragment_shader
GL_ATI_meminfo
GL_ATI_separate_stencil
GL_ATI_texture_compression_3dc
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_bindable_uniform
GL_EXT_blend_color
GL_EXT_blend_equation_separate
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_compiled_vertex_array
GL_EXT_copy_buffer
GL_EXT_copy_texture
GL_EXT_direct_state_access
GL_EXT_draw_buffers2
GL_EXT_draw_instanced
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_blit
GL_EXT_framebuffer_multGL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_histogram
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_float
GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_EXT_subtexture
GL_EXT_texgen_reflection
GL_EXT_texture3D
GL_EXT_texture_array
GL_EXT_texture_buffer_object
GL_EXT_texture_compression_latc
GL_EXT_texture_compression_rgtc
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_rectangle
GL_EXT_texture_sRGB
GL_EXT_texture_shared_exponent
isample
GL_EXT_framebuffer_object
GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4
GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4
GL_EXT_histogram
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_float
GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_provoking_vertex
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_EXT_subtexture
GL_EXT_texgen_reflection
GL_EXT_texture3D
GL_EXT_texture_array
GL_EXT_texture_buffer_object
GL_EXT_texture_compression_latc
GL_EXT_texture_compression_rgtc
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_add
GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3
GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer
GL_EXT_texture_lod
GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_rectangle
GL_EXT_texture_sRGB
GL_EXT_texture_shared_exGL_EXT_texture_snorm
GL_EXT_texture_storage
GL_EXT_texture_swizzle
GL_EXT_timer_query
GL_EXT_transform_feedback
GL_EXT_vertex_array
GL_EXT_vertex_array_bgra
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_conditional_render
GL_NV_copy_depth_to_color
GL_NV_copy_image
GL_NV_explicit_multisample
GL_NV_float_buffer
GL_NV_half_float
GL_NV_primitive_restart
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod
GL_SUN_multi_draw_arrays
GL_WIN_swap_hint
WGL_EXT_swap_control
--- Framebuffer ---
Doublebuffer: True
MaxColorAttachments: 8
MaxDrawBuffers: 8
AuxBuffers: 4
DrawBuffer: Back
MaxSamples: 8
MaxViewportDims: ( 8192, 8192 )
Viewport: ( 0, 0 ) ( 116, 60 )
--- Framebuffer channels ---
RedBits: 8
GreenBits: 8
BlueBits: 8
AlphaBits: 8
DepthBits: 24
StencilBits: 8
AccumRedBits: 0
AccumGreenBits: 0
AccumBlueBits: 0
AccumAlphaBits: 0
--- Textures ---
MaxCombinedTextureImageUnits: 32
ponent
GL_EXT_texture_snorm
GL_EXT_texture_storage
GL_EXT_texture_swizzle
GL_EXT_timer_query
GL_EXT_transform_feedback
GL_EXT_vertex_array
GL_EXT_vertex_array_bgra
GL_IBM_texture_mirrored_repeat
GL_KTX_buffer_region
GL_NV_blend_square
GL_NV_conditional_render
GL_NV_copy_depth_to_color
GL_NV_copy_image
GL_NV_explicit_multisample
GL_NV_float_buffer
GL_NV_half_float
GL_NV_primitive_restart
GL_NV_texgen_reflection
GL_NV_texture_barrier
GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod
GL_SUN_multi_draw_arrays
GL_WIN_swap_hint
WGL_EXT_swap_control
--- Framebuffer ---
Doublebuffer: True
MaxColorAttachments: 8
MaxDrawBuffers: 8
AuxBuffers: 4
DrawBuffer: Back
MaxSamples: 8
MaxViewportDims: ( 8192, 8192 )
Viewport: ( 0, 0 ) ( 116, 60 )
--- Framebuffer channels ---
RedBits: 8
GreenBits: 8
BlueBits: 8
AlphaBits: 8
DepthBits: 24
StencilBits: 8
AccumRedBits: 0
AccumGreenBits: 0
AccumBlueBits: 0
AccumAlphaBits: 0
--- Textures ---
MaxCombinedTextureImageUMaxVertexTextureImageUnits: 16
MaxTextureImageUnits: 16
MaxTextureUnits: 8
MaxTextureSize: 8192
Max3DTextureSize: 8192
MaxCubeMapTextureSize: 8192
MaxRenderbufferSize: 8192
MaxTextureLodBias: 16
--- UN-supported Texture formats ---
R8ui, Rg8ui, Rgb8ui, Rgba8ui, R16ui, Rg16ui, Rgb16ui, Rgba16ui, R32ui, Rg32ui, Rgb32ui, Rgba32ui, R8i, Rg8i, Rgb8iExt, Rgba8i, R16i, Rg16i, Rgb16iExt, Rgba16i, R32i, Rg32i, Rgb32i, Rgba32i, CompressedRgbFxt13Dfx, CompressedRgbaFxt13Dfx,
--- SUPPORTED Texture formats ---
Alpha Alpha UnsignedByte
Alpha4 Alpha UnsignedByte
Alpha8Ext Alpha UnsignedByte
Alpha12Ext Alpha UnsignedByte
Alpha16Ext Alpha UnsignedByte
AlphaFloat16Ati Alpha HalfFloat
AlphaFloat32Apple Alpha Float
DepthComponent DepthComponent Int
DepthComponent16Sgix DepthComponent Float
DepthComponent24 DepthComponent Float
DepthComponent32Sgix DepthComponent Float
DepthComponent32f DepthComponent Float
DepthStencil DepthStencil UnsignedInt248
Depth24Stencil8 DepthStencil UnsignedInt248
nits: 32
MaxVertexTextureImageUnits: 16
MaxTextureImageUnits: 16
MaxTextureUnits: 8
MaxTextureSize: 8192
Max3DTextureSize: 8192
MaxCubeMapTextureSize: 8192
MaxRenderbufferSize: 8192
MaxTextureLodBias: 16
--- UN-supported Texture formats ---
R8ui, Rg8ui, Rgb8ui, Rgba8ui, R16ui, Rg16ui, Rgb16ui, Rgba16ui, R32ui, Rg32ui, Rgb32ui, Rgba32ui, R8i, Rg8i, Rgb8iExt, Rgba8i, R16i, Rg16i, Rgb16iExt, Rgba16i, R32i, Rg32i, Rgb32i, Rgba32i, CompressedRgbFxt13Dfx, CompressedRgbaFxt13Dfx,
--- SUPPORTED Texture formats ---
Alpha Alpha UnsignedByte
Alpha4 Alpha UnsignedByte
Alpha8Ext Alpha UnsignedByte
Alpha12Ext Alpha UnsignedByte
Alpha16Ext Alpha UnsignedByte
AlphaFloat16Ati Alpha HalfFloat
AlphaFloat32Apple Alpha Float
DepthComponent DepthComponent Int
DepthComponent16Sgix DepthComponent Float
DepthComponent24 DepthComponent Float
DepthComponent32Sgix DepthComponent Float
DepthComponent32f DepthComponent Float
DepthStencil DepthStencil UnsignedInt248
Depth2Depth32fStencil8 DepthStencil Float32UnsignedInt248Rev
Gl2XBitAti Red UnsignedByte
Two Rg UnsignedByte
Rgb Rgb UnsignedByte
Rgba Rgba UnsignedByte
Srgb Rgb UnsignedByte
SrgbAlpha Rgb UnsignedByte
Srgb8 Rgb UnsignedByte
Srgb8Alpha8 Rgba UnsignedByte
R16f Red HalfFloat
Rg16f Rg HalfFloat
RgbFloat16Ati Rgb HalfFloat
RgbaFloat16Apple Rgba HalfFloat
R32f Red Float
Rg32f Rg Float
Rgb32f Rgb Float
RgbaFloat32Ati Rgba Float
R8 Red UnsignedByte
Rg8 Rg UnsignedByte
Rgb8Ext Rgb UnsignedByte
Rgba8 Rgba UnsignedByte
R3G3B2 Rgb UnsignedByte
Rgb10A2 Rgba UnsignedByte
Rgb5A1Oes Rgb UnsignedByte
Rgb9E5 Rgb UnsignedByte
R11fG11fB10f Rgb UnsignedByte
CompressedAlpha Alpha UnsignedByte
CompressedIntensityArb Luminance UnsignedByte
CompressedLuminanceArb Luminance UnsignedByte
CompressedLuminanceAlphaArb LuminanceAlpha UnsignedByte
CompressedLuminanceLatc1Ext Luminance UnsignedByte
4Stencil8 DepthStencil UnsignedInt248
Depth32fStencil8 DepthStencil Float32UnsignedInt248Rev
Gl2XBitAti Red UnsignedByte
Two Rg UnsignedByte
Rgb Rgb UnsignedByte
Rgba Rgba UnsignedByte
Srgb Rgb UnsignedByte
SrgbAlpha Rgb UnsignedByte
Srgb8 Rgb UnsignedByte
Srgb8Alpha8 Rgba UnsignedByte
R16f Red HalfFloat
Rg16f Rg HalfFloat
RgbFloat16Ati Rgb HalfFloat
RgbaFloat16Apple Rgba HalfFloat
R32f Red Float
Rg32f Rg Float
Rgb32f Rgb Float
RgbaFloat32Ati Rgba Float
R8 Red UnsignedByte
Rg8 Rg UnsignedByte
Rgb8Ext Rgb UnsignedByte
Rgba8 Rgba UnsignedByte
R3G3B2 Rgb UnsignedByte
Rgb10A2 Rgba UnsignedByte
Rgb5A1Oes Rgb UnsignedByte
Rgb9E5 Rgb UnsignedByte
R11fG11fB10f Rgb UnsignedByte
CompressedAlpha Alpha UnsignedByte
CompressedIntensityArb Luminance UnsignedByte
CompressedLuminanceArb Luminance UnsignedByte
CompressedLuminanceAlphaArb LuminanceAlpha UnsignedByte
CompressedLuminanceLatc1Ext LuminanCompressedLuminanceAlphaLatc2Ext LuminanceAlpha UnsignedByte
CompressedRed Red UnsignedByte
CompressedRedRgtc1Ext Red UnsignedByte
CompressedRgRgtc2 Rg UnsignedByte
CompressedRg Rg UnsignedByte
CompressedRgRgtc2 Rg UnsignedByte
CompressedRgbArb Rgb UnsignedByte
CompressedRgbaArb Rgba UnsignedByte
CompressedSignedLuminanceAlphaLatc2Ext LuminanceAlpha UnsignedByte
CompressedSignedLuminanceLatc1Ext Luminance UnsignedByte
CompressedSignedRedRgtc1 Red UnsignedByte
CompressedSignedRedGreenRgtc2Ext Rg UnsignedByte
CompressedSluminance Luminance UnsignedByte
CompressedSluminanceAlpha LuminanceAlpha UnsignedByte
CompressedSrgb Rgb UnsignedByte
CompressedSrgbAlpha Rgba UnsignedByte
CompressedSrgbS3tcDxt1Ext Rgb UnsignedByte
CompressedSrgbAlphaS3tcDxt1Ext Rgba UnsignedByte
CompressedSrgbAlphaS3tcDxt3Ext Rgba UnsignedByte
CompressedSrgbAlphaS3tcDxt5Ext Rgba UnsignedByte
CompressedRgbS3tcDxt1Ext Rgb UnsignedByte
CompressedRgbaS3tcDxt1Ext Rgba UnsignedByte
ce UnsignedByte
CompressedLuminanceAlphaLatc2Ext LuminanceAlpha UnsignedByte
CompressedRed Red UnsignedByte
CompressedRedRgtc1Ext Red UnsignedByte
CompressedRgRgtc2 Rg UnsignedByte
CompressedRg Rg UnsignedByte
CompressedRgRgtc2 Rg UnsignedByte
CompressedRgbArb Rgb UnsignedByte
CompressedRgbaArb Rgba UnsignedByte
CompressedSignedLuminanceAlphaLatc2Ext LuminanceAlpha UnsignedByte
CompressedSignedLuminanceLatc1Ext Luminance UnsignedByte
CompressedSignedRedRgtc1 Red UnsignedByte
CompressedSignedRedGreenRgtc2Ext Rg UnsignedByte
CompressedSluminance Luminance UnsignedByte
CompressedSluminanceAlpha LuminanceAlpha UnsignedByte
CompressedSrgb Rgb UnsignedByte
CompressedSrgbAlpha Rgba UnsignedByte
CompressedSrgbS3tcDxt1Ext Rgb UnsignedByte
CompressedSrgbAlphaS3tcDxt1Ext Rgba UnsignedByte
CompressedSrgbAlphaS3tcDxt3Ext Rgba UnsignedByte
CompressedSrgbAlphaS3tcDxt5Ext Rgba UnsignedByte
CompressedRgbS3tcDxt1Ext Rgb UnsignedByte
CompresCompressedRgbaS3tcDxt3Ext Rgba UnsignedByte
CompressedRgbaS3tcDxt5Ext Rgba UnsignedByte

--- Point&Line volumes ---
AliasedPointSizeRange: ( 1, 8192 )
PointSizeMin: 0
PointSizeMax: 8192
PointSizeGranularity: 0,125
PointSizeRange: ( 1, 63 )
AliasedLineWidthRange: ( 1, 128 )
SmoothLineWidthGranularity: 0,125
SmoothLineWidthRange: ( 1, 63 )
--- VBO ---
MaxElementsIndices: 16777215
MaxElementsVertices: 2147483647
MaxVertexAttribs: 29
--- GLSL ---
MaxCombinedFragmentUniformComponents: 262144
MaxCombinedGeometryUniformComponents: 262144
MaxCombinedVertexUniformComponents: 262144
MaxFragmentUniformComponents: 16384
MaxVertexUniformComponents: 16384
MaxCombinedUniformBlocks: 45
MaxFragmentUniformBlocks: 15
MaxGeometryUniformBlocks: 15
MaxVertexUniformBlocks: 15
MaxUniformBlockSize: 65536
MaxUniformBufferBindings: 45
MaxVaryingComponents: 128
--- Transform Feedback ---
MaxTransformFeedbackInterleavedComponents: 64
MaxTransformFeedbackSeparateAttribs: 4
sedRgbaS3tcDxt1Ext Rgba UnsignedByte
CompressedRgbaS3tcDxt3Ext Rgba UnsignedByte
CompressedRgbaS3tcDxt5Ext Rgba UnsignedByte

--- Point&Line volumes ---
AliasedPointSizeRange: ( 1, 8192 )
PointSizeMin: 0
PointSizeMax: 8192
PointSizeGranularity: 0,125
PointSizeRange: ( 1, 63 )
AliasedLineWidthRange: ( 1, 128 )
SmoothLineWidthGranularity: 0,125
SmoothLineWidthRange: ( 1, 63 )
--- VBO ---
MaxElementsIndices: 16777215
MaxElementsVertices: 2147483647
MaxVertexAttribs: 29
--- GLSL ---
MaxCombinedFragmentUniformComponents: 262144
MaxCombinedGeometryUniformComponents: 262144
MaxCombinedVertexUniformComponents: 262144
MaxFragmentUniformComponents: 16384
MaxVertexUniformComponents: 16384
MaxCombinedUniformBlocks: 45
MaxFragmentUniformBlocks: 15
MaxGeometryUniformBlocks: 15
MaxVertexUniformBlocks: 15
MaxUniformBlockSize: 65536
MaxUniformBufferBindings: 45
MaxVaryingComponents: 128
--- Transform Feedback ---
MaxTransformFeedbackInterleavedComponents: 64
MaxTransformFeedbackSepaMaxTransformFeedbackSeparateComponents: 4
--- Fixed-Func Stacks, GL.Push* and GL.Pop* ---
MaxClientAttribStackDepth: 16
MaxAttribStackDepth: 16
MaxProjectionStackDepth: 10
MaxModelviewStackDepth: 32
MaxTextureStackDepth: 10
MaxNameStackDepth: 64
--- Fixed-Func misc. stuff ---
MaxEvalOrder: 40
MaxClipPlanes: 8
MaxArrayTextureLayers: 8192
MaxListNesting: 64
MaxLights: 8
MaxTextureCoords: 16
rateAttribs: 4
MaxTransformFeedbackSeparateComponents: 4
--- Fixed-Func Stacks, GL.Push* and GL.Pop* ---
MaxClientAttribStackDepth: 16
MaxAttribStackDepth: 16
MaxProjectionStackDepth: 10
MaxModelviewStackDepth: 32
MaxTextureStackDepth: 10
MaxNameStackDepth: 64
--- Fixed-Func misc. stuff ---
MaxEvalOrder: 40
MaxClipPlanes: 8
MaxArrayTextureLayers: 8192
MaxListNesting: 64
MaxLights: 8
MaxTextureCoords: 16

migueltk's picture

A line from the original source code I could not por to C#, glDrawBuffers(0, NULL);.
Can this be the problem?

Yes! This is the problem, I just made a change to the code and it works.

Original source code in C++ glDrawBuffers(0, NULL);, ported to C#

            DrawBuffersEnum dbe = DrawBuffersEnum.None;
            GL.DrawBuffers(1, ref dbe); // Would be nice to put GL.DrawBuffers(1, DrawBuffersEnum.None)

I searched the function GL.Ext.DrawBuffers(1, DrawBuffersEnumExt.None); but can not find it, is this correct?

Thanks for the help.

Norris's picture

WOW ! Miguel, you can't imagine how I'm happy to finally see a working example of shadows in OpenTK ... and the quality is very good !
I searched so many time this kind of example :D
I just discovered your website and your great work for OpenST. Now I need to take several months to understand and learn all those great code samples.
Do you think it's possible for me to ask you some questions by private messages if I need custom explanations ?

P.S: I seen that English is not your first language ... as me (I'm French). Do you speak French ?

heeeuuuu ... sorry for my bad English !

migueltk's picture

Hello Norris

Of course you can send me mail and I'll explain the issue I propose. It's in my mind polishing and documenting the code when I allowed my spare time. As for the language using 'Google translator' we can understand.

Do note that I'm learning, there is a lot of code, but most are adaptations of C++ to C#.

As for 'Shadow Maps' is true that I have published an adaptation of the example of NVidia 'Cascaded Shadow Maps' view https://sites.google.com/site/bitiopia/openst , is a code that was a little dirty on my computer. I prefer to share the code to have it on my computer 'gaining dust', not a finished work.

Greetings ... Miguel

Norris's picture

For my part, Google translator and all others are crap except for some vocabulary.
I think I will understand most of your code, but there are so many areas in OpenGL I can't understand because no examples in C# or VB.Net (I work with VB.Net).

"Do note that I'm learning, there is a lot of code, but most are adaptations of C++ to C#."

I think you are exactly the guy I need :D !! You are a little better (if not very better) than me. You are at some steps after me in your learning (I learn the same things some months after you).
Many tutorials on Internet are very complex to understand, and it will be easier to learn with you.
Obviously, I will not ask your help every days ... don't be afraid :D !

This is not a finished work (for shadows) ? GREAT !! This won't be too hard to understand !
Could you just confirm that this shadows technique is called "cascaded shadow maps" ? (So I will be able to search for myself on Internet)

Unfortunately, I think I'm not able to teach you something in OpenGL, but if you need help to understand a 3D modeler (I like MAXON Cinema 4D) or Photoshop, I will be very happy to share my small knowledge with you.

Best regards, Norris.