About Store Forum Documentation Contact



Post Reply 
100k+ Particle Rendering Performance Issue
Author Message
Esenthel Online
Administrator

Post: #31
RE: 100k+ Particle Rendering Performance Issue
init:
rp.create

update:
rp.set

draw:
rp.draw
10-20-2011 03:30 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #32
RE: 100k+ Particle Rendering Performance Issue
Im pretty sure I got something wrong here.
It is being really heavy on performance.

PHP Code:
    height-=Time.d()*10;
    if(
height<0)height=10;
    
REP(500)
    {
        
particleArray[i].radius Random.f(0.04,0.08);
        
particleArray[i].vel    = -Vec(0,25,0);
        
particleArray[i].color  Color(153,153,153,116);
        
particleArray[i].pos    Vec(Random.f(-10,10),height*Random.f(0,1),Random.f(-10,10));
        
rp.set(&particleArray[i],500);
    } 
10-21-2011 08:22 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #33
RE: 100k+ Particle Rendering Performance Issue
Call set only once
10-21-2011 09:37 AM
Find all posts by this user Quote this message in a reply
llynx Offline
Member

Post: #34
RE: 100k+ Particle Rendering Performance Issue
(10-21-2011 08:22 AM)b1s Wrote:  Im pretty sure I got something wrong here.
It is being really heavy on performance.

PHP Code:
    height-=Time.d()*10;
    if(
height<0)height=10;
    
REP(500)
    {
        
particleArray[i].radius Random.f(0.04,0.08);
        
particleArray[i].vel    = -Vec(0,25,0);
        
particleArray[i].color  Color(153,153,153,116);
        
particleArray[i].pos    Vec(Random.f(-10,10),height*Random.f(0,1),Random.f(-10,10));
        
rp.set(&particleArray[i],500);
    } 

Yes, you call set() once your array is finalized (the entire particleArray, not just one entry). I get ~30 fps @ 200k particles updated in realtime (nearly half of that is advection on the cpu though)
(This post was last modified: 10-21-2011 04:31 PM by llynx.)
10-21-2011 04:22 PM
Find all posts by this user Quote this message in a reply
b1s Offline
Member

Post: #35
RE: 100k+ Particle Rendering Performance Issue
Yeah I got it to work finally.. Thank you guys. Much heavier rain.
I now have something like 7500 particles and it does not affect much fps.
Tho over 10k I started seeing some effects.
10-22-2011 08:03 AM
Find all posts by this user Quote this message in a reply
Post Reply