[GSoC 2012] Off-Screen Particles project - continuation

Threads related to Google Summer of Code
User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Wed Aug 22, 2012 4:48 pm

This is the right behavior, it selects the first shader model that is supported, ps_2_0 is supported - so this is not an error.
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 5:36 pm

You are right.
My mistake - i thought examination of used pixel shaders was done in render_quad (and not in render_scene) before accepting choice of profile ;).
It turns out that in render_quad everything happens just the same.

I just found the reason why shader with "if()" statement worked in render_quad pass (It was not examination of shaders).
Karol Badowski 1989 wrote:(...)

Code: Select all

fragment_program OSP_DepthTestForParticles_fp_cg cg            
{
	source OSP.cg  
    entry_point OSP_DepthTestForParticles_fp
	
    profiles ps_2_0 ps_3_0 ps_1_1 arbfp1                   
}
Worked in render_quad, but not in render_scene ;)
(...) I hope it helps to find potential bug (/possibility to make profile chooser even better :) ).
Real reason was that I used profile 2_x, [not 2_0] there.
False allert.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 7:18 pm

DirectX tepth test i ready too now.

I tested definition of depth (it was based on closest and furthest element on the scene).

Code: Select all

param_named_auto depthRange scene_depth_range 
There was a risk that for rendering particles and solid objects in separate pases, it might be a slightly different range - however it was the same - it would be much better and universal solution (for adjusting range of depth - to dynamically change quality depending on range).

I am still doing tests to be sure (Now i think that I have found perspective from where this range is different).
If it is true, I'll replace it back to standard solution which is clip depth far and depth close parameter ;).


Image
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 7:36 pm, edited 1 time in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 7:36 pm

Ok, tests are ready - it turns out, I'll replace depth definition with far and close clip distance. Depth range works as I suspected (depth range is different fow pass where particles are rendered and where solid objects are rendered ;) ).
This shows the proof:
Image
Above we see difference in depth range, below we see a little closer view where range is similar. To understand reason, look on right side.
Image

Substitution will be easy - after that I'll upload update code and scripts ;).
Another step is adding "smooth particles" effect - (it is just a little modification) - I'll show you results on stencil buffer output.
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 7:57 pm, edited 2 times in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Wed Aug 22, 2012 7:38 pm

This is actually very nice progress.
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 9:14 pm

Now, when I am mixing some techniques I see difference in speed between different levels of downsample.
Finally - earlier there was no difference.

I've prepared description for material modiffication (there are 4 rules : 2 off-screen target methods X 2 possible initial kinds of blending)

This is description for two of them (in originally alpha-blended particles).

Code: Select all

//THESE MATERIALS SHOW HOW TO MODIFY MATERIALS FOR OFF_SCREEN RENDERING
//(3 examples - 1st and 3rd are nearly the same - they are additive, 2'nd one shows how to hande additive effects)

material Fumes
{
	technique
	{
		pass
		{
			lighting off
			
	  //-A------BLENDED_OFF_SCREEN----------------ORIGINALLY_ALPHA_BLEND-------	
		/*
			Thanks to this operation we create semi-transparent output for "BLENDED OFF SCREEN PASS" that can be later BLENDED to background layer.
				new.rgb=old.rgb*(1-delta.a) + delta.rgb*delta.a;
				new.a=old.a*(1-delta.a) + delta.a;
			Where delta is output of a shader, old is current frame buffer and new is new value to save in frame buffer.
		*/
			separate_scene_blend src_alpha one_minus_src_alpha one one_minus_src_alpha //USE FOR BLENDED OFF SCREEN PASS
	  //-A----------------------------------------------------------------------
		
			
	  //-B-------ADDITIVE_OFF_SCREEN---------------ORIGINALLY_ALPHA_BLEND-------
		/*
			Thanks to this operation we create additive rgb output for "ADDITIVE OFF SCREEN PASS" that can be ADDED to background layer,
			and temporary alpha channel used only for calculations, which is not added to backround level
				new.rgb=old.rgb;
				new.a=old.a*(1-delta.a) + delta.a;
			Where delta is output of a shader, old is current frame buffer and new is new value to save in frame buffer.
		*/
			//separate_scene_blend zero one one one_minus_src_alpha //USE FOR ADDITIVE OFF SCREEN PASS
	  //-B----------------------------------------------------------------------
			

	  //-C-------ORIGINAL--------------------------ALPHA_BLEND------------------
		/*
			THIS IS ORIGINAL BLENDING - "ALPHA BLEND",
			SUCH TEMPLATE IS REPLACED WITH TWO ABOVE (FOR TWO DIFFERENT OFF SCREEN PASSES)
		*/
			//scene_blend alpha_blend 
	  //-C----------------------------------------------------------------------
			
			depth_write off
			diffuse vertexcolour
			
	  //-D-------SHADERS--------------------------------------------------------
		/*
			ORIGINALLY THERE ARE NO SHADERS DEFINED (DEFAULT ONE ARE EXECUTED, REPLACE THEM WITH THESE BELOW)
		*/
			vertex_program_ref OSP_DepthTestForParticles_vp 
            {
					param_named_auto worldViewProjection worldviewproj_matrix
					param_named_auto depthRange scene_depth_range  
            }
            fragment_program_ref OSP_DepthTestForParticles_fp{}
	  //-D----------------------------------------------------------------------

			texture_unit 0
			{
				filtering linear linear linear
				texture fog.png
				tex_address_mode clamp
			}
			
	  //-E--------DEPTH-OF-BACKGROUND-TEXTURE-----------------------------------
			//THIS ONE BELOW IS ADDITIONAL TEXTURE UNIT ADDED FOR OFF SCREEN TECHNIQE
			texture_unit 1
			{
				filtering linear linear linear
				content_type compositor OSP_AllInOne depthDownsampledTexture
				tex_address_mode clamp
			}
	  //-E----------------------------------------------------------------------
	  
		}
	}
}
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 10:00 pm, edited 1 time in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 9:40 pm

At the moment I am checking something:
For red-blue smoke and for white fumes left by jetpack - I see mirrored depth in y axis. This is independant from rendering system (I already unified Y axis calculation in OpenGL and DirectX).
If i invert it back, then depth test on the colorfull smoke will be inverted.
I wonder if it is reason of influence from *.particle program.
Image
Another picture is little different (looks little 'funny'), however shows better the inverted y-axis depth test for fumes here: Image








EDIT: (23.08.2012 00:23 GMT+2)
I insert here the "inverted" situation I mentioned before - where smoke receives y-mirrored depth and other particle effects receive good one): Image
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 11:24 pm, edited 3 times in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 9:42 pm

double post (deleted)
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 11:21 pm, edited 5 times in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Wed Aug 22, 2012 9:48 pm

Why are you posting the same image over and over?
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 9:52 pm

I have really bad internet connection, so I had some double post I try to delete that posts, but it fails.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Wed Aug 22, 2012 9:55 pm

no prob.
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 10:42 pm

I've uploaded version where y axis is the same for ALL particle effects among one shader system.
Since then there were some updates that I've already descibed here (about 2 offscreen targets).
Now I'll have to normalise y axis between render systems - but this time using good parameters. (I calculate coordinates for multiple textures in one shader, so I hope this was just a tiny mistake).

Currently uploaded version works for off-screen particles only (do not turn the normal renderin on). Looks nice.
Of course after applying shaders, influence of *.particle script colour+transparency over time modifiers are disabled. In background there is a soblel of solid objects (edges) so we could spot the effect easier.
Last edited by Karol Badowski 1989 on Wed Aug 22, 2012 11:14 pm, edited 4 times in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Wed Aug 22, 2012 11:06 pm

Now I go to sleeping place, this is how I leave uploaded version of presentation (described above) for today:
Image
(I also marked what I'm going to improve tomorrow - another extension).
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 10:55 am

I wanted to write one universal shader for both directx3d and opengl (to invert y axis only in Direct3D), based on signum function:
inputPosition.xy = sign(inputPosition.xy);
This operation also does scaling, so you do not have to divide the output (the less dividing operations, the better).
(like it is done in render_quad operations with use of Ogre/Compositor/StdQuad_vp)

Instead, for now I wrote 2 shaders and defined one profile for openGL and one for DirectX version - in one of the programs I multiply final y axis * (-1).



However I am wondering, If when I multiply input value properly , I would receive the same perspective as in render_quad and be able to use the same trick.
I mean proper order of:
- doing trick: inputPosition.xy = sign(inputPosition.xy);
- multiplying by world, projection and view matrixes (or their iverted / transposed versions).
That solution would be just cooler and easier to read.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Thu Aug 23, 2012 11:17 am

Better as little in the shader as you can.
Can you give a short summary where does this project stands now?
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 12:10 pm

A the moment:
-preserving background colour - ready
-depth acquisition ready (dynamic change of solid objects material) - ready
-simple depth downsampling - ready
-maxofdepth downsampling - ready
-rendering to offscreen texture - ready >> rendering to offscreen downsampled texture - ready >> rendering to offscreen downsampled texture with depth test - ready
-concatenation of background and offscreen target - ready

OffScreen particle Templates:
-prepared particle materials template (with instructions how to modify oroginal materials) to provide offscreen alpha-blending - ready
Additional prepared templates:
-prepared template to provide correct offscreen additive rendering - ready
-prepared own idea mixed-offscreen-technique template (modified two templates above to provide mixed-technique offscreen rendering for handlin additive and blended at the same time) - ready


Reductions of halo effects:
-max of depth (mentioned above) - ready
-linear filtering added to smooth the edges - ready
-Sobel filter to detect sharp edges ready >> concatenation of x,y,x-mirrored,y-mirrord Sobel to improve detection - ready

Applications:
-presentation with scene, animation, adjusted particle effects for observetions - ready;
-application using completely application-level version for proof of concept - ready
-application using compositor chain - ready >> upgraded into application using everything merged to one compositor - ready (newer version)
-application modified for SampleBrowser (also upgraded to one compositor version) - ready >> prepared file structure and cmake files - ready
-added contorls (mouse in non-SampleBrowser version and buttons in SampleBrowser version) - ready

-works for both: DirectX (DX9 too) and for OpenGL -ready

To do (upgrades- Offscreen particles works, but can be better):
a) Swap particle materials (just use different suffix in name of material) - function executed from MaterialSchemeListener.cpp in already prepared section.
b) Optimalisations. EDIT: and performance tests


EDIT:
Ideas for additional upgrades for future:
-It would be cool to upgrade to mixed-resolution for even better reduction of halos (one Pass that uses already prepared Sobel filter for stenciling).
-What would be really splendid is automatic material generator that analyses *.particle script, *.material script, etc. - it would be simmilar to one used in DefferedShading.
Last edited by Karol Badowski 1989 on Mon Aug 27, 2012 9:40 am, edited 4 times in total.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
saejox
Goblin
Posts: 260
Joined: Tue Oct 25, 2011 1:07 am

Re: [GSoC 2012] Off-Screen Particles project

Post by saejox » Thu Aug 23, 2012 12:49 pm

i like this project. but i have a concern;

may i ask about the performance improvement with off-screen particles?
a simple table of performance comparisons on high resolutions and low resolutions would be great.

thanks.
0 x
Nimet - Advanced Ogre3D Mesh/dotScene Viewer
asPEEK - Remote Angelscript debugger with html interface
ogreHTML - HTML5 user interfaces in Ogre

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Thu Aug 23, 2012 1:06 pm

You should always check performance in release compile.
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 1:32 pm

I'm addin tests to "To do" list.

Currently the fragment shaders are very light, so they have little influence on performance.
We can see the bigger influence now from sequentional passes (I'm preparing optimalisations to these passes to reduce their impact - one is prepared (merge of depth and colour generation) ).

For tests of most important part I'll enable only this downsampled off-screen texture generation and put some complicated calculations in pixel shader, so the difference could be noticeable.
I'll do the test for different levels of downsampling and different pixels amount tested in each "maxofdepth" pass - cose this one has big influence on performance too (that is why now constant amount of pixels is tested per program = 16).

EDIT:
Idea for configuration for test would be swapping input to non-downsampled texture
and downsampling it inside of our particle rendering pass.

Yes, that is great idea for test (It reduces 1 pass and puts the heavy stuff in shader that we want to test).

Most practical use of offscreen particles is especially when we calculate something:
We may use this off-screendownsampled target when we want to filter it somehow, or calculate impact of its fimal, accumulated alpha-level on the surroundings:

(i did not realise that few weeks ago, but now when I watched new presentation of CryEngine, they told that they have real-time generation of volumetric clouds shadows and this idea just popped into my mind that downsampling off-screen targets is best solution there cose multiple calculations are done for each pixel there).
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 3:15 pm

In this minutes I'm sending update.
It is the one that works the same way in Direct3D and in OpenGL. I've added some more descriptions to script.

Displayed layers:
Background: - stencil buffer
OffScreen: - "blended off screen" (however for jet i set rendering mode appropriate for second render target - this way, in dense fog, it imitates also blended particle)
Colour and transparency modifiers: - dependant on XY position and DEPTH of particle, also on her original texture (the one from *.meterial script, not one from *.particle).
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Thu Aug 23, 2012 3:21 pm

I don't understand, the whole idea is to lower the fill rate frame drop, why do you write:
...Most practical use of offscreen particles is especially when we calculate something...
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 4:23 pm

Assaf Raman wrote:the whole idea is to lower the fill rate frame drop
That is true also.
And is achieved for high amount of particles.

Using multiple passes always slows down rendering, however rendering only solid objects in first pass is faster than rendering everything in first pass.

The remaining part is pass for depth downsampling and pass for rendering particles downsampled.
For example when we have 4x4 downsample, time of rendering particles to offscreen target should be approximately 16 times faster (but remember that we make own depth test and reading form depth texture, it will be a little slower than simple rendering) - however the higher is amount of particles, the closer we get to 16 times faster rendering.

Later there is next pass (rendering quad of offscreen target to the background).
At this moment loss from multiple passes is higher than gain from reducing amount of pixels even for pretty high amount of particles - it is faster for some high amont.

I'll bring some optimalisations now to reduce amount of passes, so the "amount of particles worht to be offf-screen rendered" would become much lower one.


EDIT:

Here I'll mention all optimalisations that I wish to bring to the code, to provide higher scalability.

Optimalisations i know that will help are:
-rendering texture straight to the screen (not to other debug off-screen target and then back again to screen).
-using prepared version of first pass, that renders depth to alpha channel (to preserve colours, the material generator is needed - but it will be always 1 less pass, so it is worth it);
Now I can simmulate efficiency of this one even without original material transformer (one that rewrites all original materials with all their possible combinations).
In this simmulation I'll render depth to botth: colour value and alpha, on the screen.

-The downsampling pass will use "previous" parameter was input (that mens that first input texture will be output of previous pass).
-Then I'll render offscreen texture straight to the screen.
These are all optimalisations that I could think of now, to reduce the "rewarding amount of particles".

EDIT:
It is just swapping of 3-5 parameters in the compositor, disabling some of the debug views ;) - it could be ready till tomorrow (temporarily without * material original colour generator).
That is pretty good reduction of amount of passes.
Even one pass reduction - still worth it, cose the lower is sequentional part, the more scalable is the solution (the higher becomes the proportion of that parallel part).

( * - Rewriting of the original colours is something time-consuming not for one day, cose it just parses all possible material attributes, all possible colour modifiers ;) and puts them back - just some longer parser coding - I wish to do that too, cose it will be cooler to use it for reducing that one pass).
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 6:38 pm

At the moment I've tested what is current difference between standard renderning and compositor that renders only solid objects:

Code: Select all

compositor OSP_AllInOne
{
    technique
    {
		target_output // solidTexture//
		{
			input none
			shadows off
			pass clear{}

			pass render_scene
			{
				first_render_queue 10
				last_render_queue  10            
			}
		}
	}
}
So particles are not rendered....

Original one has 37-38 FPS.
One renedring only solid objects has 38 FPS.
The one rendering first solid objects and then particles on them (uses backbuffer for depth test): Also 39 FPS.
I also tested rendering where only particles are rendered without any filter : it has 39-40 FPS too.

I just guess that this difference shoud be bigger (rendering every offscreen target with clear() pass drops the FPS much more).
For example: If I render objects to solidTexture (cummented above), and then I render particles to the screen:
I get about 27 FPS.
Rendering solid objects ONLY to offscreeen target, without rendering anything to output:
Also takes about 38 FPS.
So it seems that the more targets the higher (nearly twice) is loss of speed.

In our case even in MRT solution I will render something to output and something to MRT - at least once changing the vertex program and at least once changing target (even one MRT target).

That is why I have question for you to give me advice (about rendering to different targets (but not MRT - we talk about DX9) - some of them on output, some of them to offscreen, but preserving queue order):

Should I catch event of rendering in the material scheme listener and switch the mask on viewport (like it was done similar way in proof of concept) or setting fitst_render_queue and last_render_queue is enough?

I am not sure if in this current case every object is calculated again anyway even if it is outside of the range from first to last render queue. It seems that it happens (Or that renering to separate targets brings so big difference in framerate).

If everything turns out to be ok as it is in this part, then I'll just run tests on some simpler scene, where vertex shader would have less to do (here I have a lot of encapsulated rotations). Perhaps some scene smiliar to example from sample browser "Volume Textures" would be best for test (less rotations - movement defined only in *.particle script without any encapsulation, millions of particles).
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

User avatar
Assaf Raman
OGRE Team Member
OGRE Team Member
Posts: 3092
Joined: Tue Apr 11, 2006 3:58 pm
Location: TLV, Israel

Re: [GSoC 2012] Off-Screen Particles project

Post by Assaf Raman » Thu Aug 23, 2012 9:04 pm

Do you run in debug or release?
0 x
Watch out for my OGRE related tweets here.

Karol Badowski 1989
Google Summer of Code Student
Google Summer of Code Student
Posts: 185
Joined: Fri Apr 06, 2012 3:04 pm

Re: [GSoC 2012] Off-Screen Particles project

Post by Karol Badowski 1989 » Thu Aug 23, 2012 9:47 pm

In debug.
0 x
Google Summer of Code 2012 Student
Topic: "Implementation of Off-Screen Particles"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman

Post Reply