Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
nuke
Halfling
Posts: 58
Joined: Wed Oct 01, 2014 1:16 am
Location: Crimea
x 1

Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Post by nuke »

Ogre Version: 1.9.0 and v1.12.12
Operating System: : Win10 x64
Render System: : old OpenGL (not OpenGL3+)

I'm a little shocked!

------------------------------------------------------------------------
Test #1
Hardware - Old slow ASUS notebook
CPU: Intel Core i7-3612QM
Video: Integrated Intel HD Graphics 4000
RAM: 8 Gb

Ogre v1.9.0 ~59 FPS
Image

Code: Select all

----------------------Profiler Results----------------------                                                   
'Frame' | Min 1 | Max 1 | Avg 2.08901                                                                          
        '_renderScene' | Min 0.419393 | Max 0.929714 | Avg 1.71438                                             
                '_findVisibleObjects' | Min 0.0386269 | Max 0.585603 | Avg 0.212531                            
                '_renderVisibleObjects' | Min 0.234547 | Max 0.664757 | Avg 0.971012                           
                '_updateSceneGraph' | Min 0.00297938 | Max 0.0232873 | Avg 0.018309                            
                'prepareRenderQueue' | Min 0.00274103 | Max 0.0196595 | Avg 0.0159377                          
                'prepareShadowTextures' | Min 0.03526 | Max 0.595113 | Avg 0.148091                            
                        '_renderScene' | Min 0.0285156 | Max 0.5637 | Avg 0.124619                             
                                '_findVisibleObjects' | Min 0.00548206 | Max 0.0574061 | Avg 0.0482216         
                                '_renderVisibleObjects' | Min 0.00898759 | Max 0.478621 | Avg 0.0363192        
                                '_updateSceneGraph' | Min 0.000193886 | Max 0.00337098 | Avg 0.000766317       
                                'prepareRenderQueue' | Min 0.000496483 | Max 0.00784572 | Avg 0.00175798       
'_findVisibleObjects' | Min 0.0021815 | Max 0.0021815 | Avg 0.001395                                           
'app update' | Min 1 | Max 1 | Avg 0.753837                                                                   
        'nature' | Min 0.846989 | Max 0.977636 | Avg 0.605021                                                  
                'sky' | Min 0.00286875 | Max 0.876677 | Avg 0.0257643                                          
                'water' | Min 0.781625 | Max 0.938453 | Avg 0.561651                                           
        'physics' | Min 0.143139 | Max 0.400602 | Avg 0.133742                                                 
'prepareRenderQueue' | Min 0.0104712 | Max 0.0104712 | Avg 0.00669601                                          
------------------------------------------------------------                                                   
Ogre v1.12.12 ~58 FPS
Image

Code: Select all

----------------------Profiler Results----------------------
Name Frame | Min 1.97174 | Max 1 | Avg 1.99031
        Name _swapAllRenderTargetBuffers | Min 0.0454665 | Max 0.652589 | Avg 0.762273
        Name main | Min 0.426738 | Max 0.853603 | Avg 1.06607
                Name _findVisibleObjects | Min 0.0681374 | Max 0.131671 | Avg 0.13707
                Name _renderVisibleObjects | Min 0.281986 | Max 0.562772 | Avg 0.725787
                Name _updateSceneGraph | Min 0.0112166 | Max 0.0130088 | Avg 0.00964807
                Name prepareRenderQueue | Min 0.0069025 | Max 0.0155695 | Avg 0.00586819
                Name prepareShadowTextures | Min 0.0279342 | Max 0.0812634 | Avg 0.0660248
                        Name Ogre/ShadowTexture0Cam | Min 0.0255514 | Max 0.0721251 | Avg 0.0531018
                                Name _findVisibleObjects | Min 0.00287146 | Max 0.0160687 | Avg 0.00960038
                                Name _renderVisibleObjects | Min 0.0113516 | Max 0.0470335 | Avg 0.0225748
                                Name _updateSceneGraph | Min 0.000142207 | Max 0.00207799 | Avg 0.000482799
                                Name prepareRenderQueue | Min 0.000183284 | Max 0.00178176 | Avg 0.000595417
Name app update | Min 1 | Max 1 | Avg 0.738879
        Name nature | Min 0.847181 | Max 0.975952 | Avg 0.598181
                Name sky | Min 0.00185357 | Max 0.852246 | Avg 0.0348158
                Name water | Min 0.792155 | Max 0.752983 | Avg 0.543956
        Name physics | Min 0.147379 | Max 0.308806 | Avg 0.130092
------------------------------------------------------------
------------------------------------------------------------------------
Test #2 - Very strange!
Hardware - Middle PC Desktop
CPU: Intel Core i7-6700
Video: Integrated Intel HD Graphics 530 (~x2 times faster than HD Graphics 4000)
RAM: 16 Gb

Ogre v1.9.0 ~107 FPS
Image

Code: Select all

----------------------Profiler Results----------------------
'Frame' | Min 1 | Max 1 | Avg 1.71369
        '_renderScene' | Min 0.50409 | Max 0.863012 | Avg 1.05861
                '_findVisibleObjects' | Min 0.0436776 | Max 0.133566 | Avg 0.0917632
                '_renderVisibleObjects' | Min 0.25409 | Max 0.440111 | Avg 0.524112
                '_updateSceneGraph' | Min 0.00738238 | Max 0.0504759 | Avg 0.0166704
                'prepareRenderQueue' | Min 0.0103618 | Max 0.0174632 | Avg 0.0156215
                'prepareShadowTextures' | Min 0.0718051 | Max 0.185798 | Avg 0.102282
                        '_renderScene' | Min 0.0565352 | Max 0.16685 | Avg 0.0834485
                                '_findVisibleObjects' | Min 0.0101691 | Max 0.051926 | Avg 0.0245786
                                '_renderVisibleObjects' | Min 0.00937879 | Max 0.0673695 | Avg 0.0225471
                                '_updateSceneGraph' | Min 0.000613779 | Max 0.0028865 | Avg 0.000998974
                                'prepareRenderQueue' | Min 0.00109071 | Max 0.0104691 | Avg 0.00154135
'_findVisibleObjects' | Min 0.00306644 | Max 0.00306644 | Avg 0.00162528
'app update' | Min 1 | Max 1 | Avg 0.6762
        'nature' | Min 0.819055 | Max 0.971912 | Avg 0.567265
                'sky' | Min 0.00284414 | Max 0.879304 | Avg 0.0212771
                'water' | Min 0.813307 | Max 0.914469 | Avg 0.53152
        'physics' | Min 0.146771 | Max 0.31616 | Avg 0.0972549
'prepareRenderQueue' | Min 0.011925 | Max 0.011925 | Avg 0.00632056
------------------------------------------------------------
Ogre v1.12.12 ~37 FPS !!!
Image

Code: Select all

----------------------Profiler Results----------------------
Name Frame | Min 1 | Max 21.4077 | Avg 6.4971
        Name _swapAllRenderTargetBuffers | Min 0.00843553 | Max 0.0643347 | Avg 0.0806272
        Name main | Min 0.968452 | Max 20.9954 | Avg 6.27649
                Name _findVisibleObjects | Min 0.00950317 | Max 0.0367395 | Avg 0.091677
                Name _renderVisibleObjects | Min 0.877677 | Max 20.0449 | Avg 5.96748
                Name _updateSceneGraph | Min 0.00113003 | Max 0.00428841 | Avg 0.0100388
                Name prepareRenderQueue | Min 0.00074118 | Max 0.00359098 | Avg 0.00670015
                Name prepareShadowTextures | Min 0.0077284 | Max 0.0394403 | Avg 0.068858
                        Name Ogre/ShadowTexture0Cam | Min 0.00586531 | Max 0.0337129 | Avg 0.0535987
                                Name _findVisibleObjects | Min 0.000766922 | Max 0.00489364 | Avg 0.0078464
                                Name _renderVisibleObjects | Min 0.00283126 | Max 0.129594 | Avg 0.0236778
                                Name _updateSceneGraph | Min 3.51902e-05 | Max 0.000797393 | Avg 0.000444386
                                Name prepareRenderQueue | Min 6.408e-05 | Max 0.000699091 | Avg 0.000580342
Name app update | Min 1 | Max 1 | Avg 0.72446
        Name nature | Min 0.84466 | Max 0.966464 | Avg 0.611044
                Name sky | Min 0.00119904 | Max 0.844107 | Avg 0.0309364
                Name water | Min 0.832524 | Max 0.835964 | Avg 0.568624
        Name physics | Min 0.144828 | Max 0.0742142 | Avg 0.106566
------------------------------------------------------------
It's very strange! (((
Please tell me what is the problem here? ((((
Projects are almost identical - 99.9% (except Ogre), shaders the same (but i get many warnings in the console from Ogre about GLSL version, on Intel HD 530 only).
The only thing i've changed during migration from v1.9.0 to v1.12.12 is a texture's pixel format for SkyX and ImGui, nothing more.
Maybe I need use build-in Ogre profiler to localize the bottlenecks?
Help!

UPDATE:
Added profiler results

UPDATE #2:
I use old OpenGL renderer, not OpenGL3+

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
UPDATE #3:
I've re-built my application + Ogre v1.12.12 but all architecture is x64
Rendering System is the same: old OpenGL
And tested on 'problem' configuration with low FPS - Intel Core i7-6700 / 16 Gb RAM / Integrated Intel HD 530
The results are almost the same: 40 FPS
The bitness of the architecture does not affect in any way. 32 bits or 64 bits does not matter, FPS is low in both cases.
The problem is in the OpenGL Rendering System (i mean old OpenGL not an OpenGL3+)
Last edited by nuke on Mon Oct 11, 2021 9:33 pm, edited 3 times in total.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 232
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 67

Re: Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Post by sercero »

Hello,

Please post your ogre.log.

One thing that might be slowing you down is if OGRE is constantly spewing warnings (console printing is slow), it happened to me with OpenGL, the culprit was the driver.

Perhaps it would be best if you migrate your shaders to OpenGL3+, nowadays OpenGL 1.x is very outdated.
User avatar
nuke
Halfling
Posts: 58
Joined: Wed Oct 01, 2014 1:16 am
Location: Crimea
x 1

Re: Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Post by nuke »

Hello!
Thanx for your answer!
Please post your ogre.log.
Thanx, a little bit later
One thing that might be slowing you down is if OGRE is constantly spewing warnings (console printing is slow), it happened to me with OpenGL, the culprit was the driver.
Yes I know about it, but there are no messages in the console while the main loop of the application is running, only at startup (shader errors, outdated mesh format, etc.)
Perhaps it would be best if you migrate your shaders to OpenGL3+, nowadays OpenGL 1.x is very outdated.
Yes, I recompiled the project to work with the OpenGL3+ but immediately got a runtime error :(
Note that simple things (from point of view/in terms of materials) like ImGui (I use pure latest ImGui + Ogre::Renderable not as a part of Ogre.Overlay) work well, but as soon as it comes to rendering scene objects (Hydrax, SkyX and other objects inherited from BumpMaterial), I get an exception :(

Code: Select all

------------------- EXCEPTION  ------------------
POINT   : SceneManager::_setPass
MESSAGE : [main()]
RenderSystem does not support FixedFunction, but technique of 'BaseWhiteNoLighting' has no Vertex Shader. Use the RTSS or write custom shaders.
FILE    : Src\Common\Ogre\OgreMain\src\OgreSceneManager.cpp
-------------------------------------------------
I do not understand anything :)
I found the place in the hydrax where this stuff is assigned and commented it out.
Hydrax.cpp

Code: Select all

....
//mMesh->setMaterialName("BaseWhiteNoLighting");
mMaterialManager->createMaterials(mComponents, MaterialManager::Options(mShaderMode, mModule->getNormalMode()));
mMesh->setMaterialName(mMaterialManager->getMaterial(MaterialManager::MAT_WATER)->getName());
....
}
And all the same ( :( ) , see exception below:

Code: Select all

------------------- EXCEPTION  ------------------
POINT   : SceneManager::_setPass
MESSAGE : [main()]
RenderSystem does not support FixedFunction, but technique of 'BaseWhiteNoLighting' has no Vertex Shader. Use the RTSS or write custom shaders.
FILE    : Src\Common\Ogre\OgreMain\src\OgreSceneManager.cpp
-------------------------------------------------
I have heard about a fixed pipeline, but I have no idea what it is.
Here is my Hydrax.material

Code: Select all

vertex_program Hydrax/Water/VP glsl {
    source HydraxWater_VP.glsl
    default_params {
		param_named_auto 	uWorld 			world_matrix
		param_named_auto 	Fog_Color		fog_colour
		param_named_auto 	Fog_Params		fog_params
	}
}
fragment_program Hydrax/Water/FP glsl {
    source HydraxWater_FP.glsl
	default_params {
		param_named 		uReflectionMap 			int 	0
		param_named 		uRefractionMap 			int 	1
		param_named 		uDepthMap 			int 	2
		param_named 		uFoamMap 			int 	3
		param_named 		uBumpMap 			int 	4	// added 					
		
		param_named_auto 	uEyePosition 			camera_position_object_space
		param_named 		uNormalDistortion 		float 	0.0
		param_named 		uWaterColor 			float3 	0.0 0.0 0.0

		param_named 		uFoamMaxDistance 		float 	0.0
		param_named 		uFoamRange 			float 	0.0
		param_named 		uFoamScale 			float 	0.0
		param_named 		uFoamStart 			float 	0.0
		param_named 		uFoamTransparency 		float 	0.0
		param_named 		uSunArea 			float 	0.0
		param_named 		uSunColor 			float3 	0.0 0.0 0.0
		param_named 		uSunPosition 			float3 	0.0 0.0 0.0
		param_named 		uSunStrength 			float 	0.0
		param_named 		uCausticsPower 			float 	0.0

		param_named_auto 	uTime 				time			// added
	}
}
material Hydrax/Water {
	receive_shadows off   				
	transparency_casts_shadows off		
	technique {
		scheme Normal
		pass {
			//cull_hardware none 

			vertex_program_ref 		Hydrax/Water/VP { } 

			fragment_program_ref	Hydrax/Water/FP { }

			texture_unit {
				texture 			HydraxReflectionMap						// NOTE: generated by HYDRAX RTTManager
				tex_address_mode 	clamp
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}

			texture_unit {
				texture 			HydraxRefractionMap						// NOTE: generated by HYDRAX RTTManager
				tex_address_mode 	clamp
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}

			texture_unit {
				texture 			HydraxDepthMap							// NOTE: generated by HYDRAX RTTManager
				tex_address_mode 	clamp
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}
			texture_unit {
				texture 			Foam512.png 
				tex_address_mode 	wrap
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}
			texture_unit{
				tex_coord_set 0
				texture waves6a_contrasted.png
				
				tex_address_mode	wrap
				
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}			
		}
	}
}
And here is my main base material from which other materials of rigid objects are inherited.
This material is based on OGRE's v1.9 examples.
BumpMapping.material:

Code: Select all

// Bump map vertex program, support for this is required
vertex_program Shader/BumpMapVPCg cg {
	source 		BumpMapping.cg
	entry_point main_vp
	profiles 	vs_4_0 vs_1_1 arbvp1
}
vertex_program Shader/BumpMapVP unified {
	delegate Shader/BumpMapVPCg
}

// Bump map vertex program, with tangent parity support for this is required
vertex_program Shader/BumpMapVPTangentParityCg cg {
	source 				BumpMapping.cg
	entry_point 		main_vp
	profiles 			vs_1_1 arbvp1
	compile_arguments 	-DTANGENTS_HAVE_PARITY=1
}
vertex_program Shader/BumpMapVPTangentParity unified {
	delegate Shader/BumpMapVPTangentParityCg
}

// Bump map fragment program, support for this is optional
fragment_program Shader/BumpMapFPCg cg {
	source 		BumpMapping.cg
	entry_point main_fp
	profiles 	ps_4_0 ps_2_0 arbfp1 fp20
}
fragment_program Shader/BumpMapFP unified {
	delegate Shader/BumpMapFPCg
}

// Bump map vertex program shadow receiver
vertex_program Shader/BumpMapVPShadowRcvCg cg {
	source 		BumpMapping.cg
	entry_point main_shadowreceiver_vp
	profiles 	vs_1_1 arbvp1
}
vertex_program Shader/BumpMapVPShadowRcv unified {
	delegate Shader/BumpMapVPShadowRcvCg
}

// Bump map fragment program shadow receiver, support for this is optional
fragment_program Shader/BumpMapFPShadowRcvCg cg {
	source 		BumpMapping.cg
	entry_point main_shadowreceiver_fp
	profiles 	ps_2_0 arbfp1 fp20
}
fragment_program Shader/BumpMapFPShadowRcv unified {
	delegate Shader/BumpMapFPShadowRcvCg
}


//------------------------------------------------------------------------------------------------------------------------------------------------------------------
// Any number of lights, diffuse
material Material/BumpMapping/MultiLight {
	
	technique Simple {
		scheme Simple
		pass 
		{
			texture_unit 
			{
				texture mock.jpg
			}
		}	
	}
	
	// This is the preferred technique which uses both vertex and
	// fragment programs, supports coloured lights
	technique Full {
		scheme Full
		
		// Base ambient pass
		pass ambient {
			// base colours, not needed for rendering, but as information
			// to lighting pass categorisation routine
			ambient 0 0 0 0
			diffuse 0 0 0 
			specular 0 0 0 0 

			texture_unit 
			{
				texture MOCK
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}

		}
		
		// Now do the lighting pass
		// NB we don't do decal texture here because this is repeated per light
		pass perlight {
			// base colours, not needed for rendering, but as information
			// to lighting pass categorisation routine
			ambient 0 0 0 
			
			// do this for each light
			iteration once_per_light
		
			scene_blend add

			// Vertex program reference
			vertex_program_ref Shader/BumpMapVP {
				param_named_auto lightPosition 	light_position_object_space 0
				param_named_auto worldViewProj 	worldviewproj_matrix
			}

			// Fragment program
			fragment_program_ref Shader/BumpMapFP
			{
				param_named_auto lightDiffuse 	light_diffuse_colour 0 
			}

			// texture shadow receiver program
			shadow_receiver_vertex_program_ref Shader/BumpMapVPShadowRcv {
				param_named_auto lightPosition 	light_position_object_space 0
				param_named_auto worldViewProj 	worldviewproj_matrix
				param_named_auto worldMatrix	world_matrix
				param_named_auto texViewProj 	texture_viewproj_matrix
			}
			// Additive texture shadow receiver program
			shadow_receiver_fragment_program_ref Shader/BumpMapFPShadowRcv {
				param_named_auto lightDiffuse 	light_diffuse_colour 0 
			}
			
			// Base bump map
			texture_unit normalmap {
				texture NMBumpsOut.png
				colour_op replace
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}
		}
		
		// Decal pass
		pass decal {
			// base colours, not needed for rendering, but as information
			// to lighting pass categorisation routine
			lighting off
			scene_blend dest_colour zero
			texture_unit decalmap {
				texture MOCK.jpg 
				filtering anisotropic anisotropic anisotropic
				max_anisotropy 16
			}			
		}
	}
}

Maybe Hydrax is too old and not designed to work with OpenGL3+?
I have no idea how to migrate from OpenGL to OpenGL3+ :(

P.S.
About x86 / x64 and v1.12.12+old OpenGL - see Update #3 of my first message in this topic.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 232
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 67

Re: Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Post by sercero »

Ouch, you seem to be mixing different type of shaders.

On one hand Hydrax is using glsl and the BumpMapping is CG.

It is true that CG should be converted to glsl, but I don't know if you can mix shaders like that.

The Fixed Function Pipeline was the old way of shading 3D objects using fixed functions, for example you only had per vertex lightning.

The FFP is very old, pre DirectX7 and it was deprecated and removed in OpenGL3+ and DirectX11.

So when using an OGRE rendersystem that is superior to DirectX9 or OpenGL1.x if you have any materials that do not use shaders then you will get exceptions like the ones you are getting.

One possible solution to this is to use the OGRE RTSS (Real Time Shader System) https://ogrecave.github.io/ogre/api/1.12/rtss.html.

The RTSS is the OGRE solution to having no FFP, what it does is generate the shaders on the fly.

You can read all about it in the link I provided.
User avatar
nuke
Halfling
Posts: 58
Joined: Wed Oct 01, 2014 1:16 am
Location: Crimea
x 1

Re: Ogre v1.9.0 vs v1.12.12 FPS comparison on my application (VERY STRANGE!)

Post by nuke »

Thank you very much for the detailed answer! :D
I will study what you wrote, I will write to you later!
Post Reply