> Is there a way of putting things to the GPU such that they're only
> computed once per frame?

You can use opengl calls to calculate matrices etc, but then you don't
know if they are really calculated on the GPU or on the CPU by the
driver. There are things like Cuda to do maths on the GPU, but that's
anotehr story, and most likely does not work in this context.

> For instance, for every cloud vertex we compute
> the eye position by multiplying zero with the inverse model view matrix -
> although it doesn't change from vertex to vertex! That's a few thousand
> matrix multiplications per frame which we actually don't really need to
> do.

The normal way to do things like this is to calculate the matrix on
the CPU, e.g. in the clouds' update code do it with OSG. Then bind
that matrix to an uniform in the shader, so it is used by every
cloud/cloudlet, whatever the rendering unit is. If you know what you
need to calculate, it is most likely quite straightforward to add the
code and binding.

Though I'm not sure if "inverse model view matrix" etc. are available
like that on the C++/OSG/CPU side, might need some other ways to do
the calculation. If they are, the same calculation can be transfered
very easily.

Zan
-- 
Lauri Peltonen
lauri.pelto...@gmail.com

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2dcopy2
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to