查看: 5503|回复: 16

osgEarth纹理使用问题

[复制链接]

该用户从未签到

发表于 2010-8-21 05:28:56 | 显示全部楼层 |阅读模式
我写的osgEarth的一个.earth文件如下:
<map name="Transportation" type="geocentric">
    <!--Add a base map of the blue marble data-->
    <image name="bluemarble" driver="gdal">
        <url>..data/world.tif</url>
    </image>

    <!--Add a high resolution inset of Washington, DC-->
    <image name="dc" driver="gdal">
        <url>../data/dc_high_res1.tif</url>
    </image>

    <!--Add a high resolution inset of Washington, DC-->
    <image name="dc" driver="gdal">
        <url>../data/dc_high_res2.tif</url>
    </image>

    <!--Add a high resolution inset of Washington, DC-->
    <image name="dc" driver="gdal">
        <url>../data/dc_high_res3.tif</url>
    </image>

    <!--Add a high resolution inset of Washington, DC-->
    <image name="dc" driver="gdal">
        <url>../data/dc_high_res4.tif</url>
    </image>

</map>
除了world.tif可以正常显示外,其他后面4个纹理只能够显示前三个纹理图片,不管我把哪些纹理放在前三,总是只是显示前三个纹理,请问这是怎么了呢?多谢。

该用户从未签到

 楼主| 发表于 2010-8-21 13:54:26 | 显示全部楼层
本帖最后由 hello! 于 2010-8-21 14:00 编辑

现在明白了。是要对layering_technique进行设置,否则osgEarth会根据硬件情况自己读入有限数目的纹理图片。例如采用
  <engine_properties>
      <layering_technique>composite</layering_technique>
   </engine_properties>
或者
  <engine_properties>
      <layering_technique>multipass</layering_technique>
   </engine_properties>
但是采用multipass发现osgEarth运行效率很低,cpu占用率太高了。而composite需要图形卡支持GL_TEXTURE_2D_ARRAY_EXT 纹理扩展,请问大家对于什么显卡支持GL_TEXTURE_2D_ARRAY_EXT 纹理扩展有了解么?如何知道自己的显卡是否支持GL_TEXTURE_2D_ARRAY_EXT ?多谢

该用户从未签到

发表于 2010-8-23 08:35:14 | 显示全部楼层
更新显卡驱动到OpenGL 2.0以上就可以支持texture array了

该用户从未签到

 楼主| 发表于 2010-8-26 07:10:46 | 显示全部楼层
多谢

该用户从未签到

 楼主| 发表于 2010-8-27 07:32:44 | 显示全部楼层
可是我查了一下我的opengl版本是2.1.2,
显卡为NVIDIA Quadro Fx1700/PCI/SSE2
不知道为何不支持您说的texture array

该用户从未签到

发表于 2010-8-27 08:16:23 | 显示全部楼层
您是如何知道自己不支持GL_TEXTURE_2D_ARRAY_EXT的?

该用户从未签到

 楼主| 发表于 2010-8-27 13:46:55 | 显示全部楼层
奥,我是不太清楚的。因为我之前看到osgEarth的composite需要图形卡支持GL_TEXTURE_2D_ARRAY_EXT 纹理扩展,而我实验composite效果不成功,所以以为自己显卡不支持GL_TEXTURE_2D_ARRAY_EXT,当然这样有些武断了。

该用户从未签到

发表于 2010-8-27 15:24:35 | 显示全部楼层
有一个很简单的办法可以判断您的系统是否支持某一种扩展,在控制台下输入:
set OSG_NOTIFY_LEVEL=INFO
osgviewer cow.osg
然后切换到控制台下查看输出的信息,其中就包含了OSG检测到的所有可支持的扩展,搜索其中是否有GL_EXT_texture_array或者其他可能的字样就可以了。当然您也可以自己用OpenGL的方式来检测

该用户从未签到

 楼主| 发表于 2010-8-30 22:28:33 | 显示全部楼层
您的方法我试验了。的确有效。我的显卡驱动支持的opengl是2.1.2,但是所支持的opengl格式中没有包括GL_TEXTURE_2D_ARRAY_EXT,请问这是显卡自身问题么?

该用户从未签到

发表于 2010-8-31 09:00:23 | 显示全部楼层
请搜索GL_EXT_texture_array的字样,也不排除有这种可能

该用户从未签到

 楼主| 发表于 2010-9-1 10:17:35 | 显示全部楼层
试验过了,但是没有找到GL_EXT_texture_array的字样

该用户从未签到

 楼主| 发表于 2010-9-1 10:18:12 | 显示全部楼层
请问您显卡支持GL_TEXTURE_2D_ARRAY_EXT没有问题吧?

该用户从未签到

发表于 2010-9-1 10:23:05 | 显示全部楼层
of course

该用户从未签到

 楼主| 发表于 2010-9-2 06:53:37 | 显示全部楼层
多谢,我利用您的方法查到的我显卡支持opengl的情况列表如下,列表最后说的glVersion=2.01是指我的opengl是2.01版本的,但是是否由于我的glsl版本低了,所以不支持GL_TEXTURE_2D_ARRAY_EXT呢?
谢谢。


OpenGL extensions supported by installed OpenGL drivers are:
    GL_ARB_color_buffer_float
    GL_ARB_depth_texture
    GL_ARB_draw_buffers
    GL_ARB_fragment_program
    GL_ARB_fragment_program_shadow
    GL_ARB_fragment_shader
    GL_ARB_half_float_pixel
    GL_ARB_imaging
    GL_ARB_multisample
    GL_ARB_multitexture
    GL_ARB_occlusion_query
    GL_ARB_pixel_buffer_object
    GL_ARB_point_parameters
    GL_ARB_point_sprite
    GL_ARB_shader_objects
    GL_ARB_shading_language_100
    GL_ARB_shadow
    GL_ARB_texture_border_clamp
    GL_ARB_texture_compression
    GL_ARB_texture_cube_map
    GL_ARB_texture_env_add
    GL_ARB_texture_env_combine
    GL_ARB_texture_env_dot3
    GL_ARB_texture_float
    GL_ARB_texture_mirrored_repeat
    GL_ARB_texture_non_power_of_two
    GL_ARB_texture_rectangle
    GL_ARB_transpose_matrix
    GL_ARB_vertex_buffer_object
    GL_ARB_vertex_program
    GL_ARB_vertex_shader
    GL_ARB_window_pos
    GL_ATI_draw_buffers
    GL_ATI_texture_float
    GL_ATI_texture_mirror_once
    GL_EXT_Cg_shader
    GL_EXT_abgr
    GL_EXT_bgra
    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_depth_bounds_test
    GL_EXT_draw_range_elements
    GL_EXT_fog_coord
    GL_EXT_framebuffer_object
    GL_EXT_multi_draw_arrays
    GL_EXT_packed_depth_stencil
    GL_EXT_packed_pixels
    GL_EXT_pixel_buffer_object
    GL_EXT_point_parameters
    GL_EXT_rescale_normal
    GL_EXT_secondary_color
    GL_EXT_separate_specular_color
    GL_EXT_shadow_funcs
    GL_EXT_stencil_clear_tag
    GL_EXT_stencil_two_side
    GL_EXT_stencil_wrap
    GL_EXT_texture3D
    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_lod
    GL_EXT_texture_lod_bias
    GL_EXT_texture_mirror_clamp
    GL_EXT_texture_object
    GL_EXT_texture_sRGB
    GL_EXT_timer_query
    GL_EXT_vertex_array
    GL_HP_occlusion_test
    GL_IBM_rasterpos_clip
    GL_IBM_texture_mirrored_repeat
    GL_KTX_buffer_region
    GL_NVX_conditional_render
    GL_NV_blend_square
    GL_NV_copy_depth_to_color
    GL_NV_depth_clamp
    GL_NV_fence
    GL_NV_float_buffer
    GL_NV_fog_distance
    GL_NV_fragment_program
    GL_NV_fragment_program2
    GL_NV_fragment_program_option
    GL_NV_half_float
    GL_NV_light_max_exponent
    GL_NV_multisample_filter_hint
    GL_NV_occlusion_query
    GL_NV_packed_depth_stencil
    GL_NV_pixel_data_range
    GL_NV_point_sprite
    GL_NV_primitive_restart
    GL_NV_register_combiners
    GL_NV_register_combiners2
    GL_NV_texgen_reflection
    GL_NV_texture_compression_vtc
    GL_NV_texture_env_combine4
    GL_NV_texture_expand_normal
    GL_NV_texture_rectangle
    GL_NV_texture_shader
    GL_NV_texture_shader2
    GL_NV_texture_shader3
    GL_NV_vertex_array_range
    GL_NV_vertex_array_range2
    GL_NV_vertex_program
    GL_NV_vertex_program1_1
    GL_NV_vertex_program2
    GL_NV_vertex_program2_option
    GL_NV_vertex_program3
    GL_S3_s3tc
    GL_SGIS_generate_mipmap
    GL_SGIS_texture_lod
    GL_SGIX_depth_texture
    GL_SGIX_shadow
    GL_SUN_slice_accum
    GL_WIN_swap_hint
    WGL_ARB_buffer_region
    WGL_ARB_extensions_string
    WGL_ARB_make_current_read
    WGL_ARB_multisample
    WGL_ARB_pbuffer
    WGL_ARB_pixel_format
    WGL_ARB_render_texture
    WGL_ATI_pixel_format_float
    WGL_EXT_extensions_string
    WGL_EXT_swap_control
    WGL_NV_float_buffer
    WGL_NV_render_depth_texture
    WGL_NV_render_texture_rectangle
OpenGL extension 'GL_ARB_vertex_program' is supported.
OpenGL extension 'GL_EXT_secondary_color' is supported.
OpenGL extension 'GL_EXT_fog_coord' is supported.
OpenGL extension 'GL_ARB_multitexture' is supported.
OpenGL extension 'GL_NV_occlusion_query' is supported.
OpenGL extension 'GL_ARB_occlusion_query' is supported.
OpenGL extension 'GL_EXT_timer_query' is supported.
OpenGL extension 'GL_EXT_secondary_color' is supported.
OpenGL extension 'GL_EXT_fog_coord' is supported.
OpenGL extension 'GL_ARB_multitexture' is supported.
OpenGL extension 'GL_EXT_texture_filter_anisotropic' is supported.
OpenGL extension 'GL_ARB_texture_compression' is supported.
OpenGL extension 'GL_EXT_texture_compression_s3tc' is supported.
OpenGL extension 'GL_IBM_texture_mirrored_repeat' is supported.
OpenGL extension 'GL_EXT_texture_edge_clamp' is supported.
OpenGL extension 'GL_ARB_texture_border_clamp' is supported.
OpenGL extension 'GL_SGIS_generate_mipmap' is supported.
OpenGL extension 'GL_ARB_shadow' is supported.
OpenGL extension 'GL_ARB_shadow_ambient' is not supported.
OpenGL extension 'GL_APPLE_client_storage' is not supported.
OpenGL extension 'GL_ARB_texture_non_power_of_two' is supported.
OpenGL extension 'GL_EXT_texture_integer' is not supported.
OpenGL extension '' is not supported.
OpenGL extension 'GL_ARB_pixel_buffer_object' is supported.
OpenGL extension 'GL_ARB_fragment_program' is supported.
OpenGL extension 'GL_EXT_framebuffer_object' is supported.
OpenGL extension 'GL_EXT_framebuffer_blit' is not supported.
OpenGL extension 'GL_ARB_shader_objects' is supported.
OpenGL extension 'GL_ARB_vertex_shader' is supported.
OpenGL extension 'GL_ARB_fragment_shader' is supported.
OpenGL extension 'GL_ARB_shading_language_100' is supported.
OpenGL extension 'GL_EXT_geometry_shader4' is not supported.
OpenGL extension 'GL_EXT_gpu_shader4' is not supported.
glVersion=2.01, isGlslSupported=YES, glslLanguageVersion=1.1
OpenGL extension 'GL_ARB_vertex_program' is supported.
Setting up osg::Camera::FRAME_BUFFER
OpenGL extension '' is not supported.
Setting up osg::Camera::FRAME_BUFFER

该用户从未签到

发表于 2010-9-2 10:42:22 | 显示全部楼层
glsl是oGL的一部分啊

该用户从未签到

 楼主| 发表于 2010-9-2 13:42:01 | 显示全部楼层
glVersion=2.01, isGlslSupported=YES, glslLanguageVersion=1.1
可见上面是分开的

该用户从未签到

发表于 2010-9-2 22:50:56 | 显示全部楼层
我不认为这两者有什么关系,至少我在OpenGL官方的标准说明上没有看到这样的字样
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表