Dominic Curran | 1 Mar 2006 12:17
Picon
Favicon

WHERE TO FIND OPENGL INFORMATION - (Bi-weekly posting)

WHERE TO FIND OPENGL INFORMATION - (Bi-weekly posting)

The Official OpenGL Site - News, downloads, tutorials, books & links:- 
http://www.opengl.org/

The archive for this mailing list can be found at:- 
http://www.egroups.com/list/opengl-gamedev-l/

The OpenGL GameDev FAQ:- 
http://www.rush3d.com/opengl/

The EFnet OpenGL FAQ:- 
http://www.geocities.com/SiliconValley/Park/5625/opengl/

The Omniverous Biped's FAQ:-
http://www.sjbaker.org/steve/omniv

OpenGL 1.1 Reference - This is pretty much the Blue book on-line:- 
http://tc1.chemie.uni-bielefeld.de/doc/OpenGL/hp/Reference.html

Red Book online:-
http://fly.cc.fer.hr/~unreal/theredbook/

Manual Pages:- 
http://pyopengl.sourceforge.net/documentation/manual/reference-GL.html

Information on the GLUT API:- 
http://www.opengl.org/developers/documentation/glut.html

The Mesa 3-D graphics library:-
(Continue reading)

Balogh Péter | 6 Mar 2006 12:19
Picon

render particle

Hi

I'm working on a render engine, and I would like to write a particle 
system, but I don't know what is the optimal way of rendering particles 
in OpenGl? Mostly sparks and sprites. My minimum platform is pretty low, 
P3 1Ghz and Gef3.

All help appreciated!

Peter Balogh
----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: =?ISO-8859-1?Q?Balogh_P=E9ter?=
  INET: backinside <at> kerekperec.hu

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Michael I Gold | 6 Mar 2006 15:49

Re: render particle

http://oss.sgi.com/projects/ogl-sample/registry/ARB/point_sprite.txt

Point sprites are part of core OpenGL 2.0.


Balogh Péter wrote:
Hi

I'm working on a render engine, and I would like to write a particle system, but I don't know what is the optimal way of rendering particles in OpenGl? Mostly sparks and sprites. My minimum platform is pretty low, P3 1Ghz and Gef3.

All help appreciated!

Peter Balogh
----- FAQ and OpenGL Resources at:
 http://www.geocities.com/SiliconValley/Hills/9956/OpenGL


Balogh Péter | 6 Mar 2006 23:09
Picon

Re: render particle

I know, but is that the fastest way? What if I for example calculate a 
vertex array, that can be rendered with identity camera matrix? Can it 
be faster?

Peter Balogh

Michael I Gold wrote:
> http://oss.sgi.com/projects/ogl-sample/registry/ARB/point_sprite.txt
> 
> Point sprites are part of core OpenGL 2.0.
> 
> 
> Balogh Péter wrote:
> 
>> Hi
>>
>> I'm working on a render engine, and I would like to write a particle 
>> system, but I don't know what is the optimal way of rendering 
>> particles in OpenGl? Mostly sparks and sprites. My minimum platform is 
>> pretty low, P3 1Ghz and Gef3.
>>
>> All help appreciated!
>>
>> Peter Balogh
>> ----- FAQ and OpenGL Resources at:
>>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>
> 
> 
----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: =?ISO-8859-1?Q?Balogh_P=E9ter?=
  INET: backinside <at> kerekperec.hu

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Andras Balogh | 7 Mar 2006 00:49
Picon

Re: render particle

First, you'll probably be limited by fillrate way before you'll be limited  
by vertex transforms. But even if not, next you'll be limited by bus  
bandwidth, and points need 4 times less bandwidth than quads. Finally, the  
only time you might want to micro-optimize like this, is when you're  
competing with johnc, but then you probably wouldn't need our advice ;)

Trust me, getting rid of camera transformation is not an optimization.  
There's so much more going on that this won't make the slightest  
difference! I'm sure you've heard this before: "Premature optimization is  
the root of all evil". Always go with the simplest solution, and then  
optimize the bottleneck. It makes no sense to optimize something that is  
not even the bottleneck! You'll end up with more complicated, less  
flexible and probably slower code.

Of course, sprites have their problems, like HW dependent size limit (most  
cards max out at 64x64 pixels), but that's not a speed issue, but a  
feature issue.

Andras

On Mon, 06 Mar 2006 15:09:24 -0700, Balogh Péter  
<backinside <at> kerekperec.hu> wrote:

> I know, but is that the fastest way? What if I for example calculate a  
> vertex array, that can be rendered with identity camera matrix? Can it  
> be faster?
>
> Peter Balogh
>
> Michael I Gold wrote:
>> http://oss.sgi.com/projects/ogl-sample/registry/ARB/point_sprite.txt
>>  Point sprites are part of core OpenGL 2.0.
>>   Balogh Péter wrote:
>>
>>> Hi
>>>
>>> I'm working on a render engine, and I would like to write a particle  
>>> system, but I don't know what is the optimal way of rendering  
>>> particles in OpenGl? Mostly sparks and sprites. My minimum platform is  
>>> pretty low, P3 1Ghz and Gef3.
>>>
>>> All help appreciated!
>>>
>>> Peter Balogh
>>> ----- FAQ and OpenGL Resources at:
>>>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>>
>>
> ----- FAQ and OpenGL Resources at:
>   http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: Andras Balogh
  INET: andras.balogh <at> gmx.net

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Kent Quirk | 7 Mar 2006 04:44

Re: render particle

Andras has good advice.

But if you're reluctant to use OpenGL sprites because you want to use 
OpenGL 1.1, then you could also consider rendering each particle as a 
single billboarded (always facing the camera) triangle.

You can render them with alpha on and use a texture with a circular 
gradient (solid in the middle, transparent at the edges). If you use the 
"Flyweight" pattern you can treat all the particles in one as having 
common attributes and minimize state changes.

It's old technology, but it's been proven in many games. And if your 
target is that low, you probably want to consider it.

    Kent

Andras Balogh wrote:

> First, you'll probably be limited by fillrate way before you'll be 
> limited  by vertex transforms. But even if not, next you'll be limited 
> by bus  bandwidth, and points need 4 times less bandwidth than quads. 
> Finally, the  only time you might want to micro-optimize like this, is 
> when you're  competing with johnc, but then you probably wouldn't need 
> our advice ;)
>
> Trust me, getting rid of camera transformation is not an 
> optimization.  There's so much more going on that this won't make the 
> slightest  difference! I'm sure you've heard this before: "Premature 
> optimization is  the root of all evil". Always go with the simplest 
> solution, and then  optimize the bottleneck. It makes no sense to 
> optimize something that is  not even the bottleneck! You'll end up 
> with more complicated, less  flexible and probably slower code.
>
> Of course, sprites have their problems, like HW dependent size limit 
> (most  cards max out at 64x64 pixels), but that's not a speed issue, 
> but a  feature issue.
>
>
> Andras

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: Kent Quirk
  INET: kent_quirk <at> cognitoy.com

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Balogh Péter | 7 Mar 2006 23:29
Picon

Re: render particle

My main concern is the state changes, if I have to use n sizes for the 
system. Because what if I have 100 particles, all with different sizes. 
As far as I know, I can't render 100 particles with different sizes 
unless for every particle I call

glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, fAdSize);
glBegin(GL_POINTS);
glColor4fv((float *)&ptmp->color);
glVertex3fv((float *)&ptmp->pos);
glEnd();

wich seems pretty expensive, considering the alternative that I could 
precalculate the 100 particles to 400 vertices, while rendering huge 
meshes(while the card is rendering), and after the meshes I simlpy 
render the 400 vertices as a vertexarray.

Does the POINT_SPRITE method stalls the gpu? Is there a way, to batch 
the different size/color attributes with positions, and render with a 
small number of render calls like huge triangle meshes? I don't really 
have bus or fillrate or cpu limitation yet (lack of final concept of 
visual requirements). I'm trying to find and implement the overall 
cheapest particle system for few 1000 particles.

All help appreciated!

Peter Balogh

Kent Quirk wrote:
> Andras has good advice.
> 
> But if you're reluctant to use OpenGL sprites because you want to use 
> OpenGL 1.1, then you could also consider rendering each particle as a 
> single billboarded (always facing the camera) triangle.
> 
> You can render them with alpha on and use a texture with a circular 
> gradient (solid in the middle, transparent at the edges). If you use the 
> "Flyweight" pattern you can treat all the particles in one as having 
> common attributes and minimize state changes.
> 
> It's old technology, but it's been proven in many games. And if your 
> target is that low, you probably want to consider it.
> 
>    Kent
> 
> 
> 
> 
> Andras Balogh wrote:
> 
>> First, you'll probably be limited by fillrate way before you'll be 
>> limited  by vertex transforms. But even if not, next you'll be limited 
>> by bus  bandwidth, and points need 4 times less bandwidth than quads. 
>> Finally, the  only time you might want to micro-optimize like this, is 
>> when you're  competing with johnc, but then you probably wouldn't need 
>> our advice ;)
>>
>> Trust me, getting rid of camera transformation is not an 
>> optimization.  There's so much more going on that this won't make the 
>> slightest  difference! I'm sure you've heard this before: "Premature 
>> optimization is  the root of all evil". Always go with the simplest 
>> solution, and then  optimize the bottleneck. It makes no sense to 
>> optimize something that is  not even the bottleneck! You'll end up 
>> with more complicated, less  flexible and probably slower code.
>>
>> Of course, sprites have their problems, like HW dependent size limit 
>> (most  cards max out at 64x64 pixels), but that's not a speed issue, 
>> but a  feature issue.
>>
>>
>> Andras
> 
> 
> 
> ----- FAQ and OpenGL Resources at:
>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
> 
----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: =?ISO-8859-2?Q?Balogh_P=E9ter?=
  INET: backinside <at> kerekperec.hu

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Dave Astle | 8 Mar 2006 02:39
Favicon

Re: render particle

Other than distance-based attenuation, there isn't a way to change the 
point size within a single draw call in the fixed function pipeline*, 
but with a vertex shader, you can easily use one of the generic 
attributes to set an arbitrary per-point size value.

With a shader, you should be able to easily render a large number of 
particles in a single call.

(* - in desktop GL, anyway. OpenGL ES includes a fixed-function 
extension that does exactly this).

Dave Astle

-------------------------------------------------------------------------
Staff Engineer, ATI Research
Executive Producer, GameDev.net, LLC: http://www.gamedev.net/
Four-time author, Course Technology PTR
-------------------------------------------------------------------------

Balogh Péter wrote:
> My main concern is the state changes, if I have to use n sizes for the 
> system. Because what if I have 100 particles, all with different sizes. 
> As far as I know, I can't render 100 particles with different sizes 
> unless for every particle I call
> 
> glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, fAdSize);
> glBegin(GL_POINTS);
> glColor4fv((float *)&ptmp->color);
> glVertex3fv((float *)&ptmp->pos);
> glEnd();
> 
> wich seems pretty expensive, considering the alternative that I could 
> precalculate the 100 particles to 400 vertices, while rendering huge 
> meshes(while the card is rendering), and after the meshes I simlpy 
> render the 400 vertices as a vertexarray.
> 
> Does the POINT_SPRITE method stalls the gpu? Is there a way, to batch 
> the different size/color attributes with positions, and render with a 
> small number of render calls like huge triangle meshes? I don't really 
> have bus or fillrate or cpu limitation yet (lack of final concept of 
> visual requirements). I'm trying to find and implement the overall 
> cheapest particle system for few 1000 particles.
> 
> All help appreciated!
> 
> Peter Balogh
> 
> Kent Quirk wrote:
> 
>> Andras has good advice.
>>
>> But if you're reluctant to use OpenGL sprites because you want to use 
>> OpenGL 1.1, then you could also consider rendering each particle as a 
>> single billboarded (always facing the camera) triangle.
>>
>> You can render them with alpha on and use a texture with a circular 
>> gradient (solid in the middle, transparent at the edges). If you use 
>> the "Flyweight" pattern you can treat all the particles in one as 
>> having common attributes and minimize state changes.
>>
>> It's old technology, but it's been proven in many games. And if your 
>> target is that low, you probably want to consider it.
>>
>>    Kent
>>
>>
>>
>>
>> Andras Balogh wrote:
>>
>>> First, you'll probably be limited by fillrate way before you'll be 
>>> limited  by vertex transforms. But even if not, next you'll be 
>>> limited by bus  bandwidth, and points need 4 times less bandwidth 
>>> than quads. Finally, the  only time you might want to micro-optimize 
>>> like this, is when you're  competing with johnc, but then you 
>>> probably wouldn't need our advice ;)
>>>
>>> Trust me, getting rid of camera transformation is not an 
>>> optimization.  There's so much more going on that this won't make the 
>>> slightest  difference! I'm sure you've heard this before: "Premature 
>>> optimization is  the root of all evil". Always go with the simplest 
>>> solution, and then  optimize the bottleneck. It makes no sense to 
>>> optimize something that is  not even the bottleneck! You'll end up 
>>> with more complicated, less  flexible and probably slower code.
>>>
>>> Of course, sprites have their problems, like HW dependent size limit 
>>> (most  cards max out at 64x64 pixels), but that's not a speed issue, 
>>> but a  feature issue.
>>>
>>>
>>> Andras
>>
>>
>>
>>
>> ----- FAQ and OpenGL Resources at:
>>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>
> ----- FAQ and OpenGL Resources at:
>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
> 

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: Dave Astle
  INET: dave <at> gamedev.net

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Malcolm Bechard | 8 Mar 2006 03:14

RE: render particle

Hi Dave,
	Can you (or someone else) elaborate on this? If I pass a point size
into the vertex shader using a generic attribute when drawing POINT_SPRITES,
what is the best way to use this value to scale the resulting sprite? I was
thinking of using it to scale the texture coordinates in the pixel shader to
shrink the texture, but the problem is I can't grow the sprite beyond the
current value of POINT_SIZE. Is there some way to control the sprite size by
doing something in the vertex shader?

Thanks

Malcolm

-----Original Message-----
Astle
Sent: Tuesday, March 07, 2006 8:39 PM
To: Multiple recipients of list OPENGL-GAMEDEV-L

Other than distance-based attenuation, there isn't a way to change the 
point size within a single draw call in the fixed function pipeline*, 
but with a vertex shader, you can easily use one of the generic 
attributes to set an arbitrary per-point size value.

With a shader, you should be able to easily render a large number of 
particles in a single call.

(* - in desktop GL, anyway. OpenGL ES includes a fixed-function 
extension that does exactly this).

Dave Astle

-------------------------------------------------------------------------
Staff Engineer, ATI Research
Executive Producer, GameDev.net, LLC: http://www.gamedev.net/
Four-time author, Course Technology PTR
-------------------------------------------------------------------------

Balogh Péter wrote:
> My main concern is the state changes, if I have to use n sizes for the 
> system. Because what if I have 100 particles, all with different sizes. 
> As far as I know, I can't render 100 particles with different sizes 
> unless for every particle I call
> 
> glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, fAdSize);
> glBegin(GL_POINTS);
> glColor4fv((float *)&ptmp->color);
> glVertex3fv((float *)&ptmp->pos);
> glEnd();
> 
> wich seems pretty expensive, considering the alternative that I could 
> precalculate the 100 particles to 400 vertices, while rendering huge 
> meshes(while the card is rendering), and after the meshes I simlpy 
> render the 400 vertices as a vertexarray.
> 
> Does the POINT_SPRITE method stalls the gpu? Is there a way, to batch 
> the different size/color attributes with positions, and render with a 
> small number of render calls like huge triangle meshes? I don't really 
> have bus or fillrate or cpu limitation yet (lack of final concept of 
> visual requirements). I'm trying to find and implement the overall 
> cheapest particle system for few 1000 particles.
> 
> All help appreciated!
> 
> Peter Balogh
> 
> Kent Quirk wrote:
> 
>> Andras has good advice.
>>
>> But if you're reluctant to use OpenGL sprites because you want to use 
>> OpenGL 1.1, then you could also consider rendering each particle as a 
>> single billboarded (always facing the camera) triangle.
>>
>> You can render them with alpha on and use a texture with a circular 
>> gradient (solid in the middle, transparent at the edges). If you use 
>> the "Flyweight" pattern you can treat all the particles in one as 
>> having common attributes and minimize state changes.
>>
>> It's old technology, but it's been proven in many games. And if your 
>> target is that low, you probably want to consider it.
>>
>>    Kent
>>
>>
>>
>>
>> Andras Balogh wrote:
>>
>>> First, you'll probably be limited by fillrate way before you'll be 
>>> limited  by vertex transforms. But even if not, next you'll be 
>>> limited by bus  bandwidth, and points need 4 times less bandwidth 
>>> than quads. Finally, the  only time you might want to micro-optimize 
>>> like this, is when you're  competing with johnc, but then you 
>>> probably wouldn't need our advice ;)
>>>
>>> Trust me, getting rid of camera transformation is not an 
>>> optimization.  There's so much more going on that this won't make the 
>>> slightest  difference! I'm sure you've heard this before: "Premature 
>>> optimization is  the root of all evil". Always go with the simplest 
>>> solution, and then  optimize the bottleneck. It makes no sense to 
>>> optimize something that is  not even the bottleneck! You'll end up 
>>> with more complicated, less  flexible and probably slower code.
>>>
>>> Of course, sprites have their problems, like HW dependent size limit 
>>> (most  cards max out at 64x64 pixels), but that's not a speed issue, 
>>> but a  feature issue.
>>>
>>>
>>> Andras
>>
>>
>>
>>
>> ----- FAQ and OpenGL Resources at:
>>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>
> ----- FAQ and OpenGL Resources at:
>  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
> 

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: Dave Astle
  INET: dave <at> gamedev.net

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing)

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: Malcolm Bechard
  INET: malcolm <at> derivativeinc.com

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Dave Astle | 8 Mar 2006 06:59
Favicon

Re: render particle

You don't need to do anything like that in the fragment shader. In the 
vertex shader, you can write to a value (gl_pointSize in GLSL, 
result.pointsize in ARB_vertex_program) that sets the size of the point 
in pixels, up to whatever the implementation max is. You could just pass 
through the per-vertex attribute that you specified in the generic 
stream, or you could attenuate that value, or whatever.

Dave

Malcolm Bechard wrote:
> Hi Dave,
> 	Can you (or someone else) elaborate on this? If I pass a point size
> into the vertex shader using a generic attribute when drawing POINT_SPRITES,
> what is the best way to use this value to scale the resulting sprite? I was
> thinking of using it to scale the texture coordinates in the pixel shader to
> shrink the texture, but the problem is I can't grow the sprite beyond the
> current value of POINT_SIZE. Is there some way to control the sprite size by
> doing something in the vertex shader?
> 
> Thanks
> 
> Malcolm
> 
> 
> -----Original Message-----
> Astle
> Sent: Tuesday, March 07, 2006 8:39 PM
> To: Multiple recipients of list OPENGL-GAMEDEV-L
> 
> Other than distance-based attenuation, there isn't a way to change the 
> point size within a single draw call in the fixed function pipeline*, 
> but with a vertex shader, you can easily use one of the generic 
> attributes to set an arbitrary per-point size value.
> 
> With a shader, you should be able to easily render a large number of 
> particles in a single call.
> 
> (* - in desktop GL, anyway. OpenGL ES includes a fixed-function 
> extension that does exactly this).
> 
> Dave Astle
> 
> -------------------------------------------------------------------------
> Staff Engineer, ATI Research
> Executive Producer, GameDev.net, LLC: http://www.gamedev.net/
> Four-time author, Course Technology PTR
> -------------------------------------------------------------------------
> 
> Balogh Péter wrote:
> 
>>My main concern is the state changes, if I have to use n sizes for the 
>>system. Because what if I have 100 particles, all with different sizes. 
>>As far as I know, I can't render 100 particles with different sizes 
>>unless for every particle I call
>>
>>glPointParameterfARB( GL_POINT_SIZE_MAX_ARB, fAdSize);
>>glBegin(GL_POINTS);
>>glColor4fv((float *)&ptmp->color);
>>glVertex3fv((float *)&ptmp->pos);
>>glEnd();
>>
>>wich seems pretty expensive, considering the alternative that I could 
>>precalculate the 100 particles to 400 vertices, while rendering huge 
>>meshes(while the card is rendering), and after the meshes I simlpy 
>>render the 400 vertices as a vertexarray.
>>
>>Does the POINT_SPRITE method stalls the gpu? Is there a way, to batch 
>>the different size/color attributes with positions, and render with a 
>>small number of render calls like huge triangle meshes? I don't really 
>>have bus or fillrate or cpu limitation yet (lack of final concept of 
>>visual requirements). I'm trying to find and implement the overall 
>>cheapest particle system for few 1000 particles.
>>
>>All help appreciated!
>>
>>Peter Balogh
>>
>>Kent Quirk wrote:
>>
>>
>>>Andras has good advice.
>>>
>>>But if you're reluctant to use OpenGL sprites because you want to use 
>>>OpenGL 1.1, then you could also consider rendering each particle as a 
>>>single billboarded (always facing the camera) triangle.
>>>
>>>You can render them with alpha on and use a texture with a circular 
>>>gradient (solid in the middle, transparent at the edges). If you use 
>>>the "Flyweight" pattern you can treat all the particles in one as 
>>>having common attributes and minimize state changes.
>>>
>>>It's old technology, but it's been proven in many games. And if your 
>>>target is that low, you probably want to consider it.
>>>
>>>   Kent
>>>
>>>
>>>
>>>
>>>Andras Balogh wrote:
>>>
>>>
>>>>First, you'll probably be limited by fillrate way before you'll be 
>>>>limited  by vertex transforms. But even if not, next you'll be 
>>>>limited by bus  bandwidth, and points need 4 times less bandwidth 
>>>>than quads. Finally, the  only time you might want to micro-optimize 
>>>>like this, is when you're  competing with johnc, but then you 
>>>>probably wouldn't need our advice ;)
>>>>
>>>>Trust me, getting rid of camera transformation is not an 
>>>>optimization.  There's so much more going on that this won't make the 
>>>>slightest  difference! I'm sure you've heard this before: "Premature 
>>>>optimization is  the root of all evil". Always go with the simplest 
>>>>solution, and then  optimize the bottleneck. It makes no sense to 
>>>>optimize something that is  not even the bottleneck! You'll end up 
>>>>with more complicated, less  flexible and probably slower code.
>>>>
>>>>Of course, sprites have their problems, like HW dependent size limit 
>>>>(most  cards max out at 64x64 pixels), but that's not a speed issue, 
>>>>but a  feature issue.
>>>>
>>>>
>>>>Andras
>>>
>>>
>>>
>>>
>>>----- FAQ and OpenGL Resources at:
>>> http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>>
>>
>>----- FAQ and OpenGL Resources at:
>> http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
>>
> 
> 
> 
> ----- 
> FAQ and OpenGL Resources at:
>   http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
> 

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

--

-- 
Author: Dave Astle
  INET: dave <at> gamedev.net

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru <at> fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).


Gmane