Render to texture and OpenGL... and some headache

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary

Render to texture and OpenGL... and some headache

Post by AssiDragon »

Alright, this is killing me. RTT for some reason doesn't work under OpenGL here... all it does is well nothing. It displays the background color of the viewport the RTT is assigned to. The puzzling fact is it works fine under DirectX, and I don't think RTT (or pBuffer for that sake) would use anything so dreadly complex to create a driver failure... (I could be wrong though.)


Here are my card capabilities reported by OGRE under GL:

Code: Select all

20:15:33: GL_VERSION = 1.5.0
20:15:33: GL_VENDOR = NVIDIA Corporation
20:15:33: GL_RENDERER = GeForce4 420 Go 32M/AGP/SSE2
20:15:35: GL_EXTENSIONS = GL_ARB_imaging GL_ARB_multitexture GL_ARB_point_parameters GL_ARB_point_sprite 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_mirrored_repeat GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_window_pos GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color 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_multi_draw_arrays GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shared_texture_palette GL_EXT_stencil_wrap GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp 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_object GL_EXT_vertex_array GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_fence GL_NV_fog_distance GL_NV_light_max_exponent GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_register_combiners GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SGIS_texture_lod GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control 
20:15:35: Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_extensions_string WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_render_texture WGL_EXT_extensions_string WGL_EXT_swap_control WGL_NV_render_texture_rectangle WGL_ARB_make_current_read 
20:15:35: ***************************
*** GL Renderer Started ***
***************************
20:15:35: Registering ResourceManager for type GpuProgram
20:15:35: RenderSystem capabilities
20:15:35: -------------------------
20:15:35:  * Hardware generation of mipmaps: yes
20:15:35:  * Texture blending: yes
20:15:35:  * Anisotropic texture filtering: yes
20:15:35:  * Dot product texture operation: yes
20:15:35:  * Cube mapping: yes
20:15:35:  * Hardware stencil buffer: yes
20:15:35:    - Stencil depth: 8
20:15:35:    - Two sided stencil support: no
20:15:35:    - Wrap stencil values: yes
20:15:36:  * Hardware vertex / index buffers: yes
20:15:36:  * Vertex programs: yes
20:15:36:    - Max vertex program version: arbvp1
20:15:36:  * Fragment programs: no
20:15:36:  * Texture Compression: yes
20:15:36:    - DXT: yes
20:15:36:    - VTC: no
20:15:36:  * Scissor Rectangle: yes
20:15:36:  * Hardware Occlusion Query: no
20:15:36:  * User clip planes: yes
20:15:36:  * VET_UBYTE4 vertex element type: yes
20:15:36:  * Infinite far plane projection: yes
20:15:36:  * Hardware render-to-texture: yes
20:15:36:  * Floating point textures: no
20:15:36:  * Non-power-of-two textures: no
20:15:36:  * Volume textures: yes
Hardware rtt supported. :?

..and here is the log part of creating the RTT thing:
20:21:39: Win32RenderTexture::Creating PBuffer
20:21:39: Win32RenderTexture::PBuffer -- Chosen pixel format rgba=8,8,8,0 depth=24 stencil=8
20:21:39: Win32RenderTexture::PBuffer -- Chosen pixel format rgba=8,8,8,0 depth=24 stencil=8Win32RenderTexture::PBuffer created -- Real dimensions 64x64
20:21:39: Creating viewport on target 'RttTex', rendering from camera 'ReflectCam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
20:21:40: Viewport for camera 'ReflectCam', actual dimensions L: 0 T: 0 W: 64 H: 64
The RTT texture just comes as plain black.

I wonder if anyone encountered this or is there a way around this... on a note, I'm not using the CVS ogre; I'm using a copy CVS of april. (Could this be a problem?)
Hope is the first step on the road to disappointment.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Well, the code uses pbuffers if available and it tends to be good to have the latest drivers to make sure they're supported properly. I hate to give the stock 'check your drivers' response, but, um, please check your drivers :?
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary

Post by AssiDragon »

I have a laptop, Geforce4GO. No official drivers are out for this branch... v 56.72 is installed (stock driver)
Hope is the first step on the road to disappointment.
User avatar
IoN_PuLse
Goblin
Posts: 220
Joined: Mon May 31, 2004 5:54 am
Location: Canada

Post by IoN_PuLse »

I'm pretty sure the main nvidia driver, at version 71.89, supports all geforce cards...it should work on yours...
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary

Post by AssiDragon »

When you check the nVidia download page, they specifically state none of their drivers support GO! family cards. Which actually sucks, but fss. That said I could hand-edit the INF files so I could install them, but makes me wonder how stable such a thing would be...

(And I am not sure installing a 7x.xx driver on a Gf4GO card is a healthy idea either :D afterall, such late drivers are meant for a bit more powerful cards...)
Hope is the first step on the road to disappointment.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

I think you need the 66.x driver branch or better to use many of the GL features we use; many were buggy before that.
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary

Post by AssiDragon »

I installed 67.03 and it was no avail either; so for the heck of it I tried 71.89 too.
7189 works weird - Windows stutters and randomly hangs when I open new windows, but OGRE works better indeed. I guess I'll dig into it to solve my OS related bugs, but it solved my OGRE problems.

And here I would like to say a big f**k you for nVidia, as I have to manually "update" every inf file of downloaded drivers so I can install them on my PC. Would supporting all your cards hurt so much?!

Thanks for the help here guys, even if this was lame-user's-yet-another-driver-issue. o_O
Hope is the first step on the road to disappointment.
User avatar
DarkSeraph
Halfling
Posts: 85
Joined: Thu Apr 28, 2005 5:42 pm

Post by DarkSeraph »

[off topic]That's all graphics companies, they just kinda ignore the cards that they put in laptops, and decide that people don't need lew drivers for them. I used to have the same problem with an ATI card I had. I'm not saying it's true for ALL portable cards, but most of the time it seems like it is :(
User avatar
IoN_PuLse
Goblin
Posts: 220
Joined: Mon May 31, 2004 5:54 am
Location: Canada

Post by IoN_PuLse »

:/ That sucks Assi
AssiDragon
Greenskin
Posts: 145
Joined: Wed Apr 28, 2004 12:10 pm
Location: Hungary

Post by AssiDragon »

DarkSeraph wrote:[off topic]That's all graphics companies, they just kinda ignore the cards that they put in laptops, and decide that people don't need lew drivers for them. I used to have the same problem with an ATI card I had. I'm not saying it's true for ALL portable cards, but most of the time it seems like it is :(
I'd openly say all laptop graphics cards are just forgotten. They have special layout - that said, their special layout is merely a small change over the desktop version to adapt them to a laptop design :roll: - and manufacturers simply don't bother to properly support them. I guess the profit margin isn't high enough in this sector yet.

I occasionally fix PCs for friends and their friends and blabla. Once I was called out for a laptop that had a Gf4GO 4200, and performed pretty badly. It had the stock drivers, version 23.xx or something around that. Add to that, without modifying the inf files you can't install the newer nVidia drivers onto the laptop because it will say the card is not supported... yeah, user support. Freaky. Just freaky.
IoN_PuLse wrote::/ That sucks Assi
Well, it does. I've been installing drivers all night, and it seems 71.89 does it the best, even with the lock-up-on-new-window issue. Below that version the RTT error is still there, above it... well, much above it even games begin to hang too, I guess those drivers are not for a 32MB card. Hope there will be a "refined for lower end" version of them though :D But I can at least go on working on my project now. :twisted: and I'm positive that after tweaking the nVidia, windows desktop and theme settings the crashing will go away too. It just makes no sense to act like this while demanding softwares like OGRE work fine.
Hope is the first step on the road to disappointment.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

If it really remains a problem you could disable hardware RTT by editing OgreWin32GLSupport.cpp