Hi Loinel,

High number of uniforms will be the bottleneck, changing uniforms in
OpenGL is relatively expensive.  If you shader parameter various
changing per drawable then use vertex attributes rather than uniforms.

Robert.

On 6/11/07, Lionel Lagarde <[EMAIL PROTECTED]> wrote:
It's seems that nobody has this problem.

High number of drawables + high number of uniforms = bad performances




Lionel Lagarde wrote:
> Hi,
>
> Problem description:
> We have a scene with a lot of drawables (>1500). The stateset of the
> root of the
> scene graph contains a shader program.
>
> When we increase the number of uniform variables used by the shader,
> the application performance drop down.
>
> A little debugging session after, it appears that for each drawable
> that has a stateset
> defined, the uniform variables are applied.
>
> They are not really applied, (their modifiedCount has not changed) but
> the
> osg::Program::PerContextProgram (line 163) do a "find" on a std::map
> (std::string -> GLint)
> to retrieve the uniform location.
>
> It seems that it is this access to the std::map that cause the
> performance drop.
>
> Does someone has encountered this problem ?
> Is there a way to disable the uniform application for each drawables ?
>
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to