NPOT textures

Started by
10 comments, last by KumGame07 16 years, 8 months ago
Hi all, I have a NPOT texture and the extension GL_ARB_texture_non_power_of_two is supported on my card (ATI X1600) . According to the spec, with this extension, all addressing modes are supported for NPOT textures as well. But if I use any of the addressing modes 'GL_REPEAT' or 'GL_MIRRORED_REPEAT' texture look-up fails. Does anyone know the reason for this ?
Best Regards,KumGame07
Advertisement
how are you confirming that the extension is supported? As I have a X1900XT and it's only 'supported' in that my card supports OGL2.0, the extension string itself isn't present.

This is because, while card can use NPOT textures, there are restrictions on the use (no addressing modes other than normal non-wrapping modes, no texture filtering, and maybe a couple of other restrictions I can't recall), which is why it the extension string doesn't show up.
KumGame07,
You may be talking about "GL_ARB_texture_rectangle". This extension does not support GL_REPEAT and mipmaps, though a similar extension "GL_ARB_texture_non_power_of_two" supports GL_REPEAT.

I also have a X1900, and it doesn't support "GL_ARB_texture_non_power_of_two" yet. However, I notice it partially works on Radeon cards. You can use this extention (simply load a npot texture into your application), even if it isn't shown in the extension string.

But, whenever you use GL_REPEAT on the npot texture, the program becomes extremely slow. So, loading a npot texture is okay on Radeon cards, but there is a big performance hit when GL_REPEAT is used.

Thanks for the reply.

@phantom :-
I checked out the extension string using glGetString() call, and found the extension 'GL_ARB_texture_non_power_of_two' in it. Is there anything else I need to check ?

@songho :-
Initially I thought of using 'GL_ARB_texture_rectangle'. But then I had to change all the texture targets (from GL_TEXTURE_2D to GL_TEXTURE_RECTANGLE_EXT). So I'm planning to use 'GL_ARB_texture_non_power_of_two' where, I think, I need not change the texture target.
Best Regards,KumGame07
BTW, I checked on my friend's machine (on ATI X1900, OGL 2.0), it showed the extension 'GL_ARB_texture_non_power_of_two' . Is it another ATI fuckup ? Anyways, I'm gonna check on another NVIDIA card as well. Its really killing me :(
Best Regards,KumGame07
Weird... I actually updated the latest WinXP driver yesterday if GL_ARB_texture_non_power_of_two was added or not. But still, I don't see this extension in my card (X1900).

KumGame07, could you tell me what version of the driver you use? Here is my version and extension strings:

OpenGL Driver Info
==================
Vendor: ATI Technologies Inc.
Version: 2.0.6645 WinXP Release
Renderer: Radeon X1900 Series x86/MMX/3DNow!/SSE2

Total Number of Extensions: 97
==============================
GL_ARB_depth_texture
GL_ARB_draw_buffers
GL_ARB_fragment_program
GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader
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_shadow_ambient
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_crossbar
GL_ARB_texture_env_dot3
GL_ARB_texture_float
GL_ARB_texture_mirrored_repeat
GL_ARB_texture_rectangle
GL_ARB_transpose_matrix
GL_ARB_vertex_blend
GL_ARB_vertex_buffer_object
GL_ARB_vertex_program
GL_ARB_vertex_shader
GL_ARB_window_pos
GL_ATIX_texture_env_combine3
GL_ATIX_texture_env_route
GL_ATIX_vertex_shader_output_point_size
GL_ATI_draw_buffers
GL_ATI_element_array
GL_ATI_envmap_bumpmap
GL_ATI_fragment_shader
GL_ATI_map_object_buffer
GL_ATI_separate_stencil
GL_ATI_shader_texture_lod
GL_ATI_texture_compression_3dc
GL_ATI_texture_env_combine3
GL_ATI_texture_float
GL_ATI_texture_mirror_once
GL_ATI_vertex_array_object
GL_ATI_vertex_attrib_array_object
GL_ATI_vertex_streams
GL_EXT_abgr
GL_EXT_bgra
GL_EXT_blend_color
GL_EXT_blend_func_separate
GL_EXT_blend_minmax
GL_EXT_blend_subtract
GL_EXT_clip_volume_hint
GL_EXT_compiled_vertex_array
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_object
GL_EXT_multi_draw_arrays
GL_EXT_packed_pixels
GL_EXT_point_parameters
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_wrap
GL_EXT_texgen_reflection
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_bias
GL_EXT_texture_mirror_clamp
GL_EXT_texture_object
GL_EXT_texture_rectangle
GL_EXT_vertex_array
GL_EXT_vertex_shader
GL_HP_occlusion_test
GL_NV_blend_square
GL_NV_occlusion_query
GL_NV_texgen_reflection
GL_S3_s3tc
GL_SGIS_generate_mipmap
GL_SGIS_multitexture
GL_SGIS_texture_border_clamp
GL_SGIS_texture_edge_clamp
GL_SGIS_texture_lod
GL_SGI_color_matrix
GL_SUN_multi_draw_arrays
GL_WIN_swap_hint
WGL_EXT_extensions_string
WGL_EXT_swap_control
Thanks songho for the concern.

BTW, I'm workin on Mac OS X (10.4.9) following are the extensions supported.

OpenGL version : 2.0 ATI-1.4.52Renderer       : ATI Radeon X1600 OpenGL EngineVendor         : ATI Technologies Inc.Shading lang version : 1.10Total extensions : 94GL_ARB_transpose_matrixGL_ARB_vertex_programGL_ARB_vertex_blendGL_ARB_window_posGL_ARB_shader_objectsGL_ARB_vertex_shaderGL_EXT_multi_draw_arraysGL_EXT_clip_volume_hintGL_EXT_rescale_normalGL_EXT_draw_range_elementsGL_EXT_fog_coordGL_EXT_gpu_program_parametersGL_APPLE_client_storageGL_APPLE_specular_vectorGL_APPLE_transform_hintGL_APPLE_packed_pixelsGL_APPLE_fenceGL_APPLE_vertex_array_objectGL_APPLE_vertex_program_evaluatorsGL_APPLE_element_arrayGL_APPLE_flush_renderGL_NV_texgen_reflectionGL_NV_light_max_exponentGL_IBM_rasterpos_clipGL_SGIS_generate_mipmapGL_ARB_shading_language_100GL_ARB_imagingGL_ARB_point_parametersGL_ARB_texture_env_crossbarGL_ARB_texture_border_clampGL_ARB_multitextureGL_ARB_texture_env_addGL_ARB_texture_cube_mapGL_ARB_texture_env_dot3GL_ARB_multisampleGL_ARB_texture_env_combineGL_ARB_texture_compressionGL_ARB_texture_mirrored_repeatGL_ARB_shadowGL_ARB_depth_textureGL_ARB_shadow_ambientGL_ARB_fragment_programGL_ARB_fragment_program_shadowGL_ARB_fragment_shaderGL_ARB_occlusion_queryGL_ARB_point_spriteGL_ARB_texture_non_power_of_twoGL_ARB_vertex_buffer_objectGL_ARB_pixel_buffer_objectGL_ARB_draw_buffersGL_ARB_shader_texture_lodGL_EXT_compiled_vertex_arrayGL_EXT_framebuffer_objectGL_EXT_texture_rectangleGL_ARB_texture_rectangleGL_EXT_texture_env_addGL_EXT_blend_colorGL_EXT_blend_minmaxGL_EXT_blend_subtractGL_EXT_texture_lod_biasGL_EXT_abgrGL_EXT_bgraGL_EXT_stencil_wrapGL_EXT_texture_filter_anisotropicGL_EXT_separate_specular_colorGL_EXT_secondary_colorGL_EXT_blend_func_separateGL_EXT_shadow_funcsGL_EXT_stencil_two_sideGL_EXT_texture_compression_s3tcGL_EXT_texture_compression_dxt1GL_EXT_blend_equation_separateGL_EXT_texture_mirror_clampGL_EXT_packed_depth_stencilGL_APPLE_flush_buffer_rangeGL_APPLE_ycbcr_422GL_APPLE_vertex_array_rangeGL_APPLE_texture_rangeGL_APPLE_float_pixelsGL_ATI_texture_floatGL_ARB_texture_floatGL_APPLE_pixel_bufferGL_NV_blend_squareGL_NV_fog_distanceGL_ATI_texture_mirror_onceGL_ATI_text_fragment_shaderGL_ATI_blend_equation_separateGL_ATI_blend_weighted_minmaxGL_ATI_texture_env_combine3GL_ATI_separate_stencilGL_ATI_texture_compression_3dcGL_SGIS_texture_edge_clampGL_SGIS_texture_lodGL_SGI_color_matrix
Best Regards,KumGame07


But, whenever you use GL_REPEAT on the npot texture, the program becomes extremely slow. So, loading a npot texture is okay on Radeon cards, but there is a big performance hit when GL_REPEAT is used.
[/quotew]

Yes songho. Even I observed the same performance hit while using GL_REPEAT. I avoided the usage of GL_REPEAT (I'm using GL_CLAMP_TO_EDGE instead). But still ATI fucks !!!!

Another update.....

Same code runs perfectly on NVIDIA Geforce 7400 GT (even with GL_REPEAT)

Best Regards,KumGame07
well, nor i cant see npots suport in the extension list on my x1950pro catalyst 7.7 :( and it doesn't work
Quote:Original post by 3dmaniac
well, nor i cant see npots suport in the extension list on my x1950pro catalyst 7.7 :( and it doesn't work


He is using a Mac so we can assume the ATI driver has a fault. Not sure if Apple is in the mix or not since GL is done differently on Apple.

Everyone on Windows says they don't have that extension with their ATI and latest drivers.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

This topic is closed to new replies.

Advertisement