Page 4 of 10

Posted: Thu Mar 13, 2008 12:03 am
by IFASS
Congratulations on the badge Null! :wink:

Posted: Thu Mar 13, 2008 12:06 am
by nullsquared
:)

Ok, let's not get another 5 pages on here with "congrats" :lol:.

I think we need more people to test the demo, and report any bugs. A demo wouldn't be a good demo if it only runs on a small selection of machines.

Posted: Thu Mar 13, 2008 12:10 am
by danharibo
nullsquared wrote::)

Ok, let's not get another 5 pages on here with "congrats" :lol:.

I think we need more people to test the demo, and report any bugs. A demo wouldn't be a good demo if it only runs on a small selection of machines.
The demo you posted runs at about 55~fps on my shity x600Pro

Re: Soft Shadows

Posted: Thu Mar 13, 2008 12:10 am
by sinbad
nullsquared wrote:I'll be 15 in August.
:shock: I only just picked up on this. You my friend, have one hell of a future.

I'd like to work this technique into Demo_Shadows in some way if that doesn't offend you too much ;) Not sure exactly when, and it would be nice to re-do the demo anyway with a better scene - the existing one was designed to not look too bad in cases where there was no self-shadowing while still being able to test self-shadowing, I think it's probably time to move to an entirely self-shadowing demo and leading with this technique, dropping the old depth/shadowmapping or perhaps just relegating it to another option. We could detect ATI/GL or older cards to avoid starting up with something that blows up.

Which reminds me, what were your results like with alternative ShadowCameraSetups & VSM? I see them mentioned in the code but I haven't had time to experiement yet.

Posted: Thu Mar 13, 2008 12:13 am
by KungFooMasta
Good work on the demo, and grats on the badge! OGL version runs on my work laptop, using NVIDIA Quadro NVS 140M. When setting the ini file to use D3D the app fails to start because d3dx9_30.dll was not found.

I haven't read through all the code in depth, but from a glance it looks well structured, and has a lot of commenting. Nice!

Re: Soft Shadows

Posted: Thu Mar 13, 2008 12:14 am
by nullsquared
sinbad wrote:
nullsquared wrote:I'll be 15 in August.
:shock: I only just picked up on this. You my friend, have one hell of a future.
:)
I'd like to work this technique into Demo_Shadows in some way if that doesn't offend you too much ;) Not sure exactly when, and it would be nice to re-do the demo anyway with a better scene - the existing one was designed to not look too bad in cases where there was no self-shadowing while still being able to test self-shadowing, I think it's probably time to move to an entirely self-shadowing demo and leading with this technique, dropping the old depth/shadowmapping or perhaps just relegating it to another option. We could detect ATI/GL or older cards to avoid starting up with something that blows up.
Sure, I wouldn't mind a more well-done demo ;). This whole scene was a bit of a hack-up. I just wanted to get something that looks like Half Life 2: Episode 2's flash light shadowing :D. And auto-detection would be a good thing to add, definitely. I've seen unsupported shaders do things I'd never imagine possible.
Which reminds me, what were your results like with alternative ShadowCameraSetups & VSM? I see them mentioned in the code but I haven't had time to experiement yet.
I didn't test them too extensively. The LiSPM setup didn't really improve the quality, and it had some really odd artifacts at the cases where the occluder was near the receiver. The focused shadow camera didn't really have any effect at all :|. I don't know - variance shadow mapping just doesn't really need any special type of camera setup as much as regular shadow mapping.

@ KungFooMasta: Yeah, my X850XT failed with a missing DX dll as well. Not 100% sure what causes it. But then, in cases where DX fails, there's always OGL ;)

@ Sinbad: Also, not sure if you remember, but I was the same guy who had all the extremely odd issues with shadow mapping:
http://www.ogre3d.org/phpBB2/viewtopic. ... ow+mapping
http://www.ogre3d.org/phpBB2/viewtopic. ... ow+mapping
:lol:
Note that if you don't set the shadow count, then the size, then the shadow type (in that order), you get the really odd bug where adding a light to the scene causes incorrect resolution shadow maps (though inverse_texture_size reports the "correct" size, which messes up blurring). Or, at least I do :|.

Re: Soft Shadows

Posted: Thu Mar 13, 2008 12:29 am
by mr. iknoweverything
nullsquared wrote: I'll be 15 in August.
it's official. im jealous.

you know, just to keep my self-esteem, you didn't grow up in surroundings that kind of promoted that skillset, like a geeky father or mother, did you?

Re: Soft Shadows

Posted: Thu Mar 13, 2008 12:37 am
by nullsquared
mr. iknoweverything wrote:
nullsquared wrote: I'll be 15 in August.
it's official. im jealous.

you know, just to keep my self-esteem, you didn't grow up in surroundings that kind of promoted that skillset, like a geeky father or mother, did you?
No.

Did you try the demo? (Ok, now if you haven't tried the demo to report how it ran, you don't get to post in the thread :lol:)

Posted: Thu Mar 13, 2008 12:53 am
by mr. iknoweverything
getting something like whoppin 8 fps on my xpress200. Apart from the expected framerate it runs flawlessly on standard settings.
Mind you i dont feel like trying more settings on my aged notebook ;)

fantastico.

Posted: Thu Mar 13, 2008 12:58 am
by nullsquared
mr. iknoweverything wrote:getting something like whoppin 8 fps on my xpress200. Apart from the expected framerate it runs flawlessly on standard settings.
Mind you i dont feel like trying more settings on my aged notebook ;)

fantastico.
Sounds good, considering my X850XT got 6FPS :D. Anything that supports 16-bit floating point textures and filtering on them (or even without filtering, though it'll look more like brute-force PCF than VSM) should run this demo without a hitch.

Posted: Thu Mar 13, 2008 1:03 am
by pjcast
ATI Mobility Fire GL T2/T2E

At 1600x1200 full screen, get 10 FPS.
At 1024x768 full screen, get 25 FPS

Probably would perform better with D3D. But, get same error as above posters. Looks like your D3D Renderer was built with a very new version of DX SDK? I really prefer sticking with 2004 SDK for building the renderer, as it has most wide support for Dx9 systems.

Posted: Thu Mar 13, 2008 1:17 am
by nullsquared
pjcast wrote:ATI Mobility Fire GL T2/T2E

At 1600x1200 full screen, get 10 FPS.
At 1024x768 full screen, get 25 FPS

Probably would perform better with D3D. But, get same error as above posters. Looks like your D3D Renderer was built with a very new version of DX SDK? I really prefer sticking with 2004 SDK for building the renderer, as it has most wide support for Dx9 systems.
Wow, doesn't sound too bad for 3x3 VSM on a mobility FireGL.

As for the D3D stuff... I just used the 1.46 Ogre Code::Blocks SDK :D. I've yet to build Ogre from source.

Posted: Thu Mar 13, 2008 2:53 am
by novaumas
Very nice work, thanks for sharing :D

I've tried it runs nicely, both on D3D and OGL, fullscreen at 1280x1024 on a 8800gs.

With four lights I'll get something like 60 fps. With just one light I'm getting over 500.

Posted: Thu Mar 13, 2008 5:23 am
by hpesoj
Fantastic work.

Seems to run fine 'n' dandy on my Geforce 7600 GT, pretty fast even with many lights.

Joe

Posted: Thu Mar 13, 2008 6:02 am
by Praetor
x1900XT here. Ran in both OGL and D3D. Got about 177 FPS with up to 4 lights at 1024x768 (windowed). So I decided to turn on a little FSAA and still got 93. Anyway, the shadows themselves look really nice. I can't wait to play around with them in some other environments. Thank you very much for doing this. You deserve that badge.

I'll try it out on my laptop (7900M i believe) tomorrow.

Posted: Thu Mar 13, 2008 9:03 am
by mehdix
Hi

Great work Null, thanks.

I've tested it on a pretty old card: ATI Mobility Radon 9700 - using a driver that hasn't been updated for about 3 years!

Direct3D:
Image

the problem is:
Unable to compile Cg program blur_ps: CG ERROR : The compile returned an error.
(0) : error C6001: Temporary register limit of 12 exceeded; 49 registers needed to compile program
Here is the log:

Code: Select all

10:51:10: Creating resource group General
10:51:10: Creating resource group Internal
10:51:10: Creating resource group Autodetect
10:51:10: SceneManagerFactory for type 'DefaultSceneManager' registered.
10:51:10: Registering ResourceManager for type Material
10:51:10: Registering ResourceManager for type Mesh
10:51:10: Registering ResourceManager for type Skeleton
10:51:10: MovableObjectFactory for type 'ParticleSystem' registered.
10:51:10: OverlayElementFactory for type Panel registered.
10:51:10: OverlayElementFactory for type BorderPanel registered.
10:51:10: OverlayElementFactory for type TextArea registered.
10:51:10: Registering ResourceManager for type Font
10:51:10: ArchiveFactory for archive type FileSystem registered.
10:51:10: ArchiveFactory for archive type Zip registered.
10:51:10: FreeImage version: 3.9.3
10:51:10: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
10:51:10: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
10:51:10: DDS codec registering
10:51:10: Registering ResourceManager for type HighLevelGpuProgram
10:51:10: Registering ResourceManager for type Compositor
10:51:10: MovableObjectFactory for type 'Entity' registered.
10:51:10: MovableObjectFactory for type 'Light' registered.
10:51:10: MovableObjectFactory for type 'BillboardSet' registered.
10:51:10: MovableObjectFactory for type 'ManualObject' registered.
10:51:10: MovableObjectFactory for type 'BillboardChain' registered.
10:51:10: MovableObjectFactory for type 'RibbonTrail' registered.
10:51:10: *-*-* OGRE Initialising
10:51:10: *-*-* Version 1.4.6 (Eihort)
10:51:10: Loading library RenderSystem_Direct3D9
10:51:10: Installing plugin: D3D9 RenderSystem
10:51:10: D3D9 : Direct3D9 Rendering Subsystem created.
10:51:10: D3D9: Driver Detection Starts
10:51:10: D3D9: Driver Detection Ends
10:51:10: Plugin successfully installed
10:51:10: Loading library Plugin_CgProgramManager
10:51:10: Installing plugin: Cg Program Manager
10:51:10: Plugin successfully installed
10:51:10: CPU Identifier & Features
10:51:10: -------------------------
10:51:10:  *   CPU ID: GenuineIntel: Intel(R) Pentium(R) M processor 1.80GHz
10:51:10:  *      SSE: yes
10:51:10:  *     SSE2: yes
10:51:10:  *     SSE3: no
10:51:10:  *      MMX: yes
10:51:10:  *   MMXEXT: yes
10:51:10:  *    3DNOW: no
10:51:10:  * 3DNOWEXT: no
10:51:10:  *     CMOV: yes
10:51:10:  *      TSC: yes
10:51:10:  *      FPU: yes
10:51:10:  *      PRO: no
10:51:10:  *       HT: no
10:51:10: -------------------------
10:51:10: D3D9 : Subsystem Initialising
10:51:10: ***************************************
10:51:10: *** D3D9 : Subsystem Initialised OK ***
10:51:10: ***************************************
10:51:10: D3D9RenderSystem::createRenderWindow "Ogre Soft Shadowing", 800x600 windowed  miscParams: FSAA=0 vsync=false 
10:51:10: D3D9 : Created D3D9 Rendering Window 'Ogre Soft Shadowing' : 800x600, 32bpp
10:51:10: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
10:51:10: Registering ResourceManager for type Texture
10:51:10: Registering ResourceManager for type GpuProgram
10:51:10: RenderSystem capabilities
10:51:10: -------------------------
10:51:10:  * Hardware generation of mipmaps: yes
10:51:10:  * Texture blending: yes
10:51:10:  * Anisotropic texture filtering: yes
10:51:10:  * Dot product texture operation: yes
10:51:10:  * Cube mapping: yes
10:51:10:  * Hardware stencil buffer: yes
10:51:10:    - Stencil depth: 8
10:51:10:    - Two sided stencil support: yes
10:51:10:    - Wrap stencil values: yes
10:51:10:  * Hardware vertex / index buffers: yes
10:51:10:  * Vertex programs: yes
10:51:10:    - Max vertex program version: vs_2_0
10:51:10:  * Fragment programs: yes
10:51:10:    - Max fragment program version: ps_2_0
10:51:10:  * Texture Compression: yes
10:51:10:    - DXT: yes
10:51:10:    - VTC: no
10:51:10:  * Scissor Rectangle: yes
10:51:10:  * Hardware Occlusion Query: yes
10:51:10:  * User clip planes: yes
10:51:10:  * VET_UBYTE4 vertex element type: yes
10:51:10:  * Infinite far plane projection: yes
10:51:10:  * Hardware render-to-texture: yes
10:51:10:  * Floating point textures: yes
10:51:10:  * Non-power-of-two textures: yes (limited)
10:51:10:  * Volume textures: yes
10:51:10:  * Multiple Render Targets: 4
10:51:10:  * Point Sprites: yes
10:51:10:  * Extended point parameters: yes
10:51:10:  * Max Point Size: 256
10:51:10:  * Vertex texture fetch: no
10:51:10: ResourceBackgroundQueue - threading disabled
10:51:10: Particle Renderer Type 'billboard' registered
10:51:10: Creating viewport on target 'Ogre Soft Shadowing', rendering from camera 'Mgr::cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
10:51:10: Creating resource group Media
10:51:10: Added resource location '../../data' of type 'FileSystem' to resource group 'Media'
10:51:10: Initialising resource group Media
10:51:10: Parsing scripts for resource group Media
10:51:10: Parsing script 00ambient.material
10:51:10: Parsing script 00diffuse.material
10:51:10: Parsing script blur.material
10:51:10: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program blur_ps: CG ERROR : The compile returned an error.
(0) : error C6001: Temporary register limit of 12 exceeded; 49 registers needed to compile program
 in CgProgram::loadFromSource at D:\Ogre_CVS\ogrenew\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 66)
10:51:10: High-level program blur_ps encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program blur_ps: CG ERROR : The compile returned an error.
(0) : error C6001: Temporary register limit of 12 exceeded; 49 registers needed to compile program
 in CgProgram::loadFromSource at D:\Ogre_CVS\ogrenew\PlugIns\CgProgramManager\src\OgreCgProgramManagerDll.cpp (line 66)
10:51:10: Parsing script metal.material
10:51:10: Parsing script ogre.material
10:51:10: Parsing script robot.material
10:51:10: Parsing script shadow_caster.material
10:51:10: Parsing script white.material
10:51:10: Parsing script blur.compositor
10:51:10: Finished parsing scripts for resource group Media
10:51:11: WARNING: Texture instance 'Ogre/ShadowTexture0' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
10:51:11: WARNING: Texture instance 'Ogre/ShadowTexture1' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
10:51:11: WARNING: Texture instance 'Ogre/ShadowTexture2' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
10:51:11: WARNING: Texture instance 'Ogre/ShadowTexture3' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
10:51:11: Creating viewport on target 'rtt/2977568', rendering from camera 'Ogre/ShadowTexture0Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
10:51:11: Creating viewport on target 'rtt/2942304', rendering from camera 'Ogre/ShadowTexture1Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
10:51:11: Creating viewport on target 'rtt/2943136', rendering from camera 'Ogre/ShadowTexture2Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
10:51:11: Creating viewport on target 'rtt/2943488', rendering from camera 'Ogre/ShadowTexture3Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
10:51:11: WARNING: material metal has no supportable Techniques and will be blank. Explanation: 
Pass 1: Fragment program diffuse_ps cannot be used - not supported.

10:51:11: Mesh: Loading level.mesh.
10:51:11: Can't assign material 01 - Default to SubEntity of level because this Material does not exist. Have you forgotten to define it in a .material script?
10:51:11: WARNING: material ogre has no supportable Techniques and will be blank. Explanation: 
Pass 1: Fragment program diffuse_ps cannot be used - not supported.

10:51:11: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with  hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
10:57:20: *-*-* OGRE Shutdown
10:57:20: Render Target 'rtt/2977568' Average FPS: 78.8239 Best FPS: 287.425 Worst FPS: 0.906755
10:57:20: Render Target 'rtt/2942304' Average FPS: 78.8239 Best FPS: 179.283 Worst FPS: 0.0458295
10:57:20: Render Target 'rtt/2943136' Average FPS: 78.8239 Best FPS: 128.231 Worst FPS: 0.0366838
10:57:20: Render Target 'rtt/2943488' Average FPS: 78.8239 Best FPS: 107.463 Worst FPS: 0.0299061
10:57:20: Unregistering ResourceManager for type Compositor
10:57:20: Unregistering ResourceManager for type Font
10:57:20: Unregistering ResourceManager for type Skeleton
10:57:20: Unregistering ResourceManager for type Mesh
10:57:20: Unregistering ResourceManager for type HighLevelGpuProgram
10:57:20: Uninstalling plugin: Cg Program Manager
10:57:20: Plugin successfully uninstalled
10:57:20: Unloading library Plugin_CgProgramManager
10:57:20: Uninstalling plugin: D3D9 RenderSystem
10:57:20: Render Target 'Ogre Soft Shadowing' Average FPS: 78.8239 Best FPS: 273.726 Worst FPS: 0.906755
10:57:20: D3D9 : Shutting down cleanly.
10:57:20: Unregistering ResourceManager for type Texture
10:57:20: Unregistering ResourceManager for type GpuProgram
10:57:20: D3D9 : Direct3D9 Rendering Subsystem destroyed.
10:57:20: Plugin successfully uninstalled
10:57:20: Unloading library RenderSystem_Direct3D9
10:57:20: Unregistering ResourceManager for type Material
OpenGL: No light! I think it's a driver bug as its driver is not updated. anyhow:
Image

Code: Select all

11:17:15: Creating resource group General
11:17:15: Creating resource group Internal
11:17:15: Creating resource group Autodetect
11:17:15: SceneManagerFactory for type 'DefaultSceneManager' registered.
11:17:15: Registering ResourceManager for type Material
11:17:15: Registering ResourceManager for type Mesh
11:17:15: Registering ResourceManager for type Skeleton
11:17:15: MovableObjectFactory for type 'ParticleSystem' registered.
11:17:15: OverlayElementFactory for type Panel registered.
11:17:15: OverlayElementFactory for type BorderPanel registered.
11:17:15: OverlayElementFactory for type TextArea registered.
11:17:15: Registering ResourceManager for type Font
11:17:15: ArchiveFactory for archive type FileSystem registered.
11:17:15: ArchiveFactory for archive type Zip registered.
11:17:15: FreeImage version: 3.9.3
11:17:15: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
11:17:15: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi
11:17:15: DDS codec registering
11:17:15: Registering ResourceManager for type HighLevelGpuProgram
11:17:15: Registering ResourceManager for type Compositor
11:17:15: MovableObjectFactory for type 'Entity' registered.
11:17:15: MovableObjectFactory for type 'Light' registered.
11:17:15: MovableObjectFactory for type 'BillboardSet' registered.
11:17:15: MovableObjectFactory for type 'ManualObject' registered.
11:17:15: MovableObjectFactory for type 'BillboardChain' registered.
11:17:15: MovableObjectFactory for type 'RibbonTrail' registered.
11:17:15: *-*-* OGRE Initialising
11:17:15: *-*-* Version 1.4.6 (Eihort)
11:17:15: Loading library RenderSystem_GL
11:17:15: Installing plugin: GL RenderSystem
11:17:15: OpenGL Rendering Subsystem created.
11:17:17: Plugin successfully installed
11:17:17: Loading library Plugin_CgProgramManager
11:17:17: Installing plugin: Cg Program Manager
11:17:17: Plugin successfully installed
11:17:17: CPU Identifier & Features
11:17:17: -------------------------
11:17:17:  *   CPU ID: GenuineIntel: Intel(R) Pentium(R) M processor 1.80GHz
11:17:17:  *      SSE: yes
11:17:17:  *     SSE2: yes
11:17:17:  *     SSE3: no
11:17:17:  *      MMX: yes
11:17:17:  *   MMXEXT: yes
11:17:17:  *    3DNOW: no
11:17:17:  * 3DNOWEXT: no
11:17:17:  *     CMOV: yes
11:17:17:  *      TSC: yes
11:17:17:  *      FPU: yes
11:17:17:  *      PRO: no
11:17:17:  *       HT: no
11:17:17: -------------------------
11:17:17: *** Starting Win32GL Subsystem ***
11:17:17: GLRenderSystem::createRenderWindow "Ogre Soft Shadowing", 800x600 windowed  miscParams: FSAA=0 vsync=false 
11:17:17: Created Win32Window 'Ogre Soft Shadowing' : 800x600, 32bpp
11:17:17: GL_VERSION = 1.5.4454 WinXP Release
11:17:17: GL_VENDOR = ATI Technologies Inc.
11:17:17: GL_RENDERER = MOBILITY RADEON 9700 x86/SSE2
11:17:17: GL_EXTENSIONS = GL_ARB_multitexture GL_EXT_texture_env_add GL_EXT_compiled_vertex_array GL_S3_s3tc GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_multisample GL_ARB_occlusion_query GL_ARB_point_parameters 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_mirrored_repeat 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_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_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_ATIX_texture_env_combine3 GL_ATIX_texture_env_route GL_ATIX_vertex_shader_output_point_size 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_draw_range_elements GL_EXT_fog_coord 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_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_texgen_reflection GL_NV_blend_square GL_NV_occlusion_query GL_ARB_point_sprite GL_SGI_color_matrix GL_SGIS_texture_edge_clamp GL_SGIS_texture_border_clamp GL_SGIS_texture_lod GL_SGIS_generate_mipmap GL_SGIS_multitexture GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_extensions_string WGL_EXT_swap_control 
11:17:17: Supported WGL extensions: 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 
11:17:17: ***************************
11:17:17: *** GL Renderer Started ***
11:17:17: ***************************
11:17:17: Registering ResourceManager for type GpuProgram
11:17:17: GLSL support detected
11:17:17: GL: Using PBuffers for rendering to textures
11:17:17: RenderSystem capabilities
11:17:17: -------------------------
11:17:17:  * Hardware generation of mipmaps: yes
11:17:17:  * Texture blending: yes
11:17:17:  * Anisotropic texture filtering: yes
11:17:17:  * Dot product texture operation: yes
11:17:17:  * Cube mapping: yes
11:17:17:  * Hardware stencil buffer: yes
11:17:17:    - Stencil depth: 8
11:17:17:    - Two sided stencil support: no
11:17:17:    - Wrap stencil values: yes
11:17:17:  * Hardware vertex / index buffers: yes
11:17:17:  * Vertex programs: yes
11:17:17:    - Max vertex program version: arbvp1
11:17:17:  * Fragment programs: yes
11:17:17:    - Max fragment program version: arbfp1
11:17:17:  * Texture Compression: yes
11:17:17:    - DXT: yes
11:17:17:    - VTC: no
11:17:17:  * Scissor Rectangle: yes
11:17:17:  * Hardware Occlusion Query: yes
11:17:17:  * User clip planes: yes
11:17:17:  * VET_UBYTE4 vertex element type: yes
11:17:17:  * Infinite far plane projection: yes
11:17:17:  * Hardware render-to-texture: yes
11:17:17:  * Floating point textures: yes
11:17:17:  * Non-power-of-two textures: no
11:17:17:  * Volume textures: yes
11:17:17:  * Multiple Render Targets: 1
11:17:17:  * Point Sprites: yes
11:17:17:  * Extended point parameters: yes
11:17:17:  * Max Point Size: 64
11:17:17:  * Vertex texture fetch: no
11:17:17: Registering ResourceManager for type Texture
11:17:17: ResourceBackgroundQueue - threading disabled
11:17:17: Particle Renderer Type 'billboard' registered
11:17:17: Creating viewport on target 'Ogre Soft Shadowing', rendering from camera 'Mgr::cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:17:17: Creating resource group Media
11:17:17: Added resource location '../../data' of type 'FileSystem' to resource group 'Media'
11:17:17: Initialising resource group Media
11:17:17: Parsing scripts for resource group Media
11:17:17: Parsing script 00ambient.material
11:17:17: Parsing script 00diffuse.material
11:17:17: Parsing script blur.material
11:17:17: Parsing script metal.material
11:17:17: Parsing script ogre.material
11:17:17: Parsing script robot.material
11:17:17: Parsing script shadow_caster.material
11:17:17: Parsing script white.material
11:17:17: Parsing script blur.compositor
11:17:17: Finished parsing scripts for resource group Media
11:17:17:  Win32PBuffer::Creating PBuffer of format bits=16 float=true
11:17:17:  Win32PBuffer::PBuffer -- Chosen pixel format rgba=16,16,16,16 depth=24 stencil=8
11:17:17: Win32RenderTexture::PBuffer created -- Real dimensions 512x512
11:17:17: WARNING: Texture instance 'Ogre/ShadowTexture0' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
11:17:17: WARNING: Texture instance 'Ogre/ShadowTexture1' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
11:17:17: WARNING: Texture instance 'Ogre/ShadowTexture2' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
11:17:17: WARNING: Texture instance 'Ogre/ShadowTexture3' was defined as manually loaded, but no manual loader was provided. This Resource will be lost if it has to be reloaded.
11:17:17: Creating viewport on target 'rtt/Ogre/ShadowTexture0/10654072', rendering from camera 'Ogre/ShadowTexture0Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:17:17: Creating viewport on target 'rtt/Ogre/ShadowTexture1/4061272', rendering from camera 'Ogre/ShadowTexture1Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:17:17: Creating viewport on target 'rtt/Ogre/ShadowTexture2/4060488', rendering from camera 'Ogre/ShadowTexture2Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:17:17: Creating viewport on target 'rtt/Ogre/ShadowTexture3/10652272', rendering from camera 'Ogre/ShadowTexture3Cam', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
11:17:17: Texture: RustedMetal.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
11:17:17: Mesh: Loading level.mesh.
11:17:17: Can't assign material 01 - Default to SubEntity of level because this Material does not exist. Have you forgotten to define it in a .material script?
11:17:17: Texture: GreenSkin.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
11:17:17: Texture: spot_shadow_fade.png: Loading 1 faces(PF_R8G8B8,128x128x1) with 7 hardware generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
11:17:29: *-*-* OGRE Shutdown
11:17:29: Render Target 'rtt/Ogre/ShadowTexture0/10654072' Average FPS: 178.465 Best FPS: 248.751 Worst FPS: 135.189
11:17:29: Render Target 'rtt/Ogre/ShadowTexture1/4061272' Average FPS: 0 Best FPS: 0 Worst FPS: 999
11:17:29: Render Target 'rtt/Ogre/ShadowTexture2/4060488' Average FPS: 0 Best FPS: 0 Worst FPS: 999
11:17:29: Render Target 'rtt/Ogre/ShadowTexture3/10652272' Average FPS: 0 Best FPS: 0 Worst FPS: 999
11:17:29: Unregistering ResourceManager for type Compositor
11:17:29: Unregistering ResourceManager for type Font
11:17:29: Unregistering ResourceManager for type Skeleton
11:17:29: Unregistering ResourceManager for type Mesh
11:17:29: Unregistering ResourceManager for type HighLevelGpuProgram
11:17:29: Uninstalling plugin: Cg Program Manager
11:17:29: Plugin successfully uninstalled
11:17:29: Unloading library Plugin_CgProgramManager
11:17:29: Uninstalling plugin: GL RenderSystem
11:17:29: Render Target 'Ogre Soft Shadowing' Average FPS: 177.481 Best FPS: 245.283 Worst FPS: 103.689
11:17:29: Unregistering ResourceManager for type GpuProgram
11:17:29: *** Stopping Win32GL Subsystem ***
11:17:29: Unregistering ResourceManager for type Texture
11:17:29: Plugin successfully uninstalled
11:17:29: Unloading library RenderSystem_GL
11:17:29: Unregistering ResourceManager for type Material
Btw Ogre demos run fine and without any problem - using both D3D & OGL renderes.

Cheers.

Posted: Thu Mar 13, 2008 9:57 am
by jjp
I guess you should really update your drivers :D

Posted: Thu Mar 13, 2008 10:12 am
by CABAListic
Very nicely done, runs here on a Geforce 6600GT quite ok'ish. I didn't get the exact framerate, because out of a habit I just pressed Alt+F4 to quit the app (which it didn't, it only closed the window. Took me some time later on that the Ogre process was still running and causing problems for another game :shock: You might want to add a window event handler ;) ), but it didn't feel laggy.

I'll have to see if I can integrate this with my own project, although I fear that your shadow camera adjustment won't quite work for us. Then again, the Ogre shadow camera setups don't really, either.

By the way, some time ago, when I was investigating shadows, I stumbled upon another method for softening shadows which was inspired by VSM, but is inherently simpler. It still allows blurring the shadow texture to give smooth shadows at the edges, but the calculation is a lot simpler so that in closed scenes you might actually get away with 8bit textures, and you'll probably not see some of VSM's artifacts in border cases. The disadvantage is that it does not soften self shadowing, so is really only useful if you don't do self-shadows. But it might still be a nice fallback for machines which can't deal with VSM. I can post the details later (have to find them first) if that interests anyone.

Posted: Thu Mar 13, 2008 10:24 am
by IFASS
CABAListic wrote: By the way, some time ago, when I was investigating shadows, I stumbled upon another method for softening shadows which was inspired by VSM, but is inherently simpler. It still allows blurring the shadow texture to give smooth shadows at the edges, but the calculation is a lot simpler so that in closed scenes you might actually get away with 8bit textures, and you'll probably not see some of VSM's artifacts in border cases. The disadvantage is that it does not soften self shadowing, so is really only useful if you don't do self-shadows. But it might still be a nice fallback for machines which can't deal with VSM. I can post the details later (have to find them first) if that interests anyone.
That seems nice indeed, please post it if you can find it. :)

Posted: Thu Mar 13, 2008 10:27 am
by mehdix
jjp wrote:I guess you should really update your drivers :D
Unfortunately they forget to release Windows updates!
Anyway it's not bad for (hard condition) testing purposes. :wink:

Posted: Thu Mar 13, 2008 11:20 am
by nullsquared
mehdix wrote:[gigantic logs]
Well D3D vertex lighting screams the fact that the shader didn't get used:
10:51:11: WARNING: material ogre has no supportable Techniques and will be blank. Explanation:
Pass 1: Fragment program diffuse_ps cannot be used - not supported.
It's probably because I used ps_2_x for the pixel shader, and your card only supports vanilla ps_2_0. In data/00diffuse.material, find the shader declaration, and after profiles, try replacing ps_2_x with ps_2_0. It probably won't compile under vanilla ps_2_0 due to the low instructions limit (and there's a 3x3 blur filter in the shader itself), but I don't remember trying it, so you might as well.

As for GL, no idea why that happened. Seems like the shader compiled, yet is missing all of the dynamic lighting :|. Probably because GL uses a single fragment program "profile"/"target", instead of specific supported/unsupported ones (other than fp/vp 30).

Sorry, though, I can't really make it run on such cards :S . My X850XT, which was considered "the king of next gen" when the 9000 cards were common, barely runs the stuff right at 6FPS ;)

@ CABAListic: You can get away in simple scenes with no self shadowing by blurring a white/black texture (white is viewport background, black is any objects), and projecting that onto receiving geometry... though what you're talking about seems different. As for alt-f4, I thought I had a windowClosed catcher in there:

Code: Select all

// this tells us if the window closed (or alt-f4, for example)
    void windowClosed(Ogre::RenderWindow *window) {
        // stop running.  we don't compare any windows
        // since we only make 1 window anyways
        running = false;
    }
Seems to run fine for me... though I never tried alt and f4. Might want to special case that.

Posted: Thu Mar 13, 2008 11:30 am
by SiENcE
@All having problems with Direct3D. You should really update your DirectX 9.0c !! If an application doesn't find a d3dx9_30.dll or newer (d3dx9_33.dll) it tells you that your directx runtime is too old.

I build the MingW SDK with the Microsoft DirectX SDK (August 2006) build. So it's using the d3dx9_30.dll . You still can only download this specific dll and put it into the Demo directory.

DirectX End-User Runtimes (November 2007):
http://www.microsoft.com/downloads/deta ... laylang=de

Posted: Thu Mar 13, 2008 11:59 am
by Kojack
Opengl, 1024x768, 4 lights, geforce 8800gts 512 - around 280-315fps. With 1 light it's around 900+fps.

Posted: Thu Mar 13, 2008 12:41 pm
by CoreDumped
tested your app yesterday on my laptop (Nvidia Go 7400).

Ran smooth. didnt note the fps tough.

Posted: Thu Mar 13, 2008 5:40 pm
by CABAListic
nullsquared wrote:@ CABAListic: You can get away in simple scenes with no self shadowing by blurring a white/black texture (white is viewport background, black is any objects), and projecting that onto receiving geometry...
That's right (in fact that's part of the technique I'm refering to), but you're losing the depth information and may therefore have backprojection of shadows and such things. This only works if your shadow receiver is always behind (seen from the light) any potential shadow caster.

Anyway, I didn't succeed to find the paper I got it from, if I remember correctly, its title was "Simple soft shadows", but that didn't show up on Google. I'll keep looking and post the link, but in the meantime, the technique works like this:

You need a 2-channel shadow texture. In the first channel you store the depth from the light like with occasional shadow mapping, and in the second channel you store exactly that white/black image, except in the paper they do it reverse (i. e. they assume that the shadow texture defaults to black and store a 1 in the second channel for every caster. Naturally you can do it the other way, just need to remember to adjust the formula later). Then you blur both channels of the texture (might want to use a box filter instead of gaussian, since this is supposed to be a fallback for not-so-good hardware), and in your receiver shader, you extract the actual depth from the shadow map via this code:

Code: Select all

float4 shadow = tex2D(shadowTex, shadowUV);
float depth = (shadow.x-1) / shadow.y + 1;
If the depth check says the area is shadowed, then you use the second channel to determine the amount of shadowing.

Though, if you ask me, actually you could just NOT blur the first channel (only the second one) and save the calculation above, that should work equally well, I think.