A minor bug

Ygolonac

18-07-2006 22:05:39

I think I hit a small bug in the 27 june 2006 prebuilt SDK. Apparently, supposing we have a terrain with TextureFormat set to "foobar", turning VertexCompression on makes PLSM require a "foobar" material but also a "foobarDecompress" one, only the latter of which should be required. I think.

Falagard

18-07-2006 23:17:11

Ya, I've seen this bug too.

tuan kuranes

24-07-2006 16:35:18

Doesn't a fallback material should be mandatory ?

Falagard

24-07-2006 16:44:06

No :-)

OvermindDL1

24-07-2006 19:40:52

Not every video card (such as the one in one of the computers next to me) do not support vertex compression, so yes, use fallbacks.

tuan kuranes

24-07-2006 20:55:42

Perhaps a warning in log should be sufficent for developper to know that some cards won't support it ?

Falagard

24-07-2006 21:07:34

I'm not saying we shouldn't support fallbacks, I'm saying don't force them. I might be writing code for the Xbox 360. I'm not, but who knows right?

It's not really a big deal since at the worse case a developer would either detect that the user was using a card that wasn't supported and show an error before the PLM is even created, or would create a dummy material.

tuan kuranes

24-07-2006 21:30:07

ok, I'll add that to CVS.

Wogz

26-07-2006 12:01:19

i don't have support for VertexCompression on this computer, and if i set it to yes, it crash the application.
That should be enabled/used only if available/supported.
It took me a few hours to figure out what was crashing the demo.

tuan kuranes

26-07-2006 14:11:22

if you're using an Intel video card, problem is that Intel is lying about GPU capabilities...
Otherwise it's a bug. tell me which case it is.

Wogz

26-07-2006 15:15:17

i'm using a geforce3 with the lastest nvidia driver.

Changing from a terrain with VertexCompression = no to a terrain with VertexCompression = yes just crash with the following log.


...
10:35:50: Win32Input8: Keyboard input established.
10:35:50: Win32Input8: Initializing mouse input in immediate mode.
10:35:50: Win32Input8: Mouse input in immediate mode initialized.
10:35:50: Texture: hf129_3.Base.0.0.png: Loading 1 faces(PF_B8G8R8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
10:35:50: Texture: Detail3.jpg: Loading 1 faces(PF_B8G8R8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
10:35:50: Texture: hf129_3.Light.0.0.png: Loading 1 faces(PF_L8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_L8,512x512x1.
10:35:55: Added resource location '../../../Media/paginglandscape2/terrains/ps_height_1k' of type 'FileSystem' to resource group 'PLSM2'
10:35:55: Initialising resource group PLSM2
10:35:55: Texture: ps_texture_1k.1.1.png: Loading 1 faces(PF_B8G8R8,1024x1024x1) with 10 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,1024x1024x1.
10:35:55: An exception has been thrown!

-----------------------------------
Details:
-----------------------------------
Error #: 9
Function: DecompressVertexOnly/VP
Description: Cannot load GL vertex program DecompressVertexOnly/VP. Line -1:
line 26, column 24: warning: EXT_vertex_weighting and ARB_vertex_blend not supported. Using generic vertex attribute 1.
.
File: ..\src\OgreGLGpuProgram.cpp
Line: 141
Stack unwinding: <<beginning of stack>>
10:36:34: *-*-* OGRE Shutdown
10:36:34: Unregistering ResourceManager for type Compositor
...


when loading i get a few of these errors with some of the shaders

-----------------------------------
Details:
-----------------------------------
Error #: 6
Function: ResourceManager::add
Description: Resource with the name PLDecompressAmbientVPCG already exists..
File: ..\src\OgreResourceManager.cpp
Line: 89
Stack unwinding: <<beginning of stack>>
10:35:49: Error at line 6 of PLShaders.program: Could not create GPU program 'PLDecompressAmbientVPCG', error reported was: An exception has been thrown!



is the shader profile correct?
10:35:47: * Vertex programs: yes
10:35:47: - Max vertex program version: arbvp1
10:35:47: * Fragment programs: yes
10:35:47: - Max fragment program version: fp20
10:35:47: * Texture Compression: yes
10:35:47: - DXT: yes
10:35:47: - VTC: yes



10:35:47: Created Win32Window 'OGRE Render Window' : 1024x768, 32bpp
10:35:47: GL_VERSION = 1.5.7
10:35:47: GL_VENDOR = NVIDIA Corporation
10:35:47: GL_RENDERER = GeForce3/AGP/3DNOW!
10:35:47: GL_EXTENSIONS = GL_ARB_depth_texture 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_shadow GL_ARB_shader_objects GL_ARB_shading_language_100 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_mirrored_repeat 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_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_compiled_vertex_array GL_EXT_Cg_shader 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_shadow_funcs GL_EXT_shared_texture_palette 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_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_timer_query GL_EXT_vertex_array GL_HP_occlusion_test GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fence GL_NV_fog_distance 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_register_combiners GL_NV_register_combiners2 GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 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_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum GL_WIN_swap_hint WGL_EXT_swap_control
10:35:47: Supported WGL extensions: 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_EXT_extensions_string WGL_EXT_swap_control WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle

tuan kuranes

26-07-2006 16:15:22

can you try replacing BLENDWEIGHT by TEXCOORD1 in DecompressVertex.cg at line 7 and change around OgrePagingLandscapeRenderable:157 by commenting the "VES_BLEND_WEIGHTS" and enable the
decl->addElement(DELTA_BINDING, 0, VET_SHORT2, VES_TEXTURE_COORDINATES, 1);

Wogz

26-07-2006 17:49:07

I just did both changes. It's still crashing when i load a terrain with VertexCompression=yes.

the error:


-----------------------------------
Details:
-----------------------------------
Error #: 9
Function: DecompressVertexOnly/VP
Description: Cannot load GL vertex program DecompressVertexOnly/VP. Line -1:
.
File: ..\src\OgreGLGpuProgram.cpp
Line: 141


i checked the shader twice, i only changed that line.
The new recompiled dll is working too, just like before, but with VertexCompression=no.

...
float2 iTexcoord : TEXCOORD0,
float2 iLodpos : TEXCOORD1,

out float4 oPosition : POSITION,
...

tuan kuranes

26-07-2006 20:07:11

error line -1 is not helping a lot there.

DX and GL give same result ?

You can try tweaking the cg (remove normal, remove ambient light and lightdir in cg and in .material) or compile it as an ASM vertex shader and declare it in the .program as ASM to get better error description...

Wogz

26-07-2006 21:26:08

i just tried with direct3d, it's running, but the pages farther away from the camera somehow get a wrong height based on their distance from the camera.
when i move the camera, pages near it moves down to their original position, while the pages farther moves up, cracking the terrain between pages.
I also notice that there's a problem with the far plane in direct3d, it's alot closer to the camera then in opengl. Another bug perhaps?

tuan kuranes

31-07-2006 13:08:55

i just tried with direct3d, it's running, but the pages farther away from the camera somehow get a wrong height based on their distance from the camera. when i move the camera, pages near it moves down to their original position, while the pages farther moves up, cracking the terrain between pages.

That's LodMorphing not working. So it seems it has hard time reading from the texcoord2 there... (the one which was vertex_blend before.)

I also notice that there's a problem with the far plane in direct3d, it's alot closer to the camera then in opengl. Another bug perhaps?
driver limitations... you direct3D might not support "infinite far plane" wheras opengl supports it ?