> 
>  > As well as hardware state
> > changes he also talks about the CPU cost of doing the 
> sorting being an 
> > issue. That was what my suggestion will help with as it 
> means that OSG 
> > has less states to sort, as all objects of the same type 
> will have the 
> > same state as opposed to having state where the uniform changes.
> 
> Of course state sorting has some CPU cost, however except in 
> pathological cases this should be minimal compared to other 
> things your app does on the CPU. Perhaps you were heavily CPU 
> limited (that is, a severe imbalance between CPU power and 
> GPU power, in favor of the GPU). 

For the delivery system I was dealing with that was the case, however on
my dev systems which had modern fast CPUs I still was better off using
this trick.

> That shouldn't be the general case though, so you can't go 
> around recommending that everyone use vertex attributes 
> instead of uniforms in all cases - most of the time people 
> will want to use uniforms for things that can change per 
> object, and vertex attributes for things that can change per vertex.
> 

If this isn't faster on other people's apps I'd like to know ( to
improve my own knowledge if nothing else ). It was Robert who suggested
that I use this technique and he said that Uniforms can be expensive and
that State changes should be minimised.

However using a Uniform per object is far easier, if it gives comparable
performance it is certainly the better option. It's more a case of
letting people know that there is a gotcha that comes with the heavy use
of Uniforms and that there is a way around it using techniques in the
osgexamples.

Colin.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to