[osg-users] Computing Normals for Drawables
aburnettthompson at googlemail.com
Mon Nov 9 09:01:53 PST 2009
> Well you're kind of juggling conflicting requirements. You want the app
to run on low-end graphics, but you want to reduce its CPU-side memory
usage to a minimum by not storing normals.
Well it's just a typical project really, everyone wants the moon on a stick
and they don't understand the concept of engineering compromise! I think the
overriding limit is memory usage. If the app cannot load the models it needs
to, then its no good. Rendering performance is quite good (we aggressively
cull and get 35 frames per second on an nVidia 9600. The most amount of time
spent is cull) and so long as the frame rate remains above 5 FPS (ie: just
about interactive) its ok ...
> *Simon Hammett*
> The only way to do it with the fixed pipeline I can think of, is basically
just sort all your geometry into group's by the approximate normal, then
you don't have to store the normal index at all so you'd save more memory.
Simon I'm not sure I 100% follow what you're saying here. Could you clarify
what you meant?
Ok thanks all for your excellent suggestions. I think I will take a look at
implementing an "Index to shared Normal Array" using setNormalIndices, even
if this drops us down to slow paths, as I would be interested to see just
how bad an effect it has on performance. If it's several orders of
magnitude, well I will chalk that up to experience and move on.
The other idea I like is to use the same method (Indices to normals) in a
vertex shader. Not quite sure how I will do this but I believe the hardware
we are operating on will be Shader Model 1.0 or 2.0 as a minimum.
Thanks a lot,
On Mon, Nov 9, 2009 at 2:14 PM, Jean-Sébastien Guay <
jean-sebastien.guay at cm-labs.com> wrote:
> Hi Andrew,
> Just to throw another requirement into the mix, I don't think we can use
>> vertex shaders, as we cannot guarantee what hardware the software will be
>> run on. Basically integrated graphics is the lowest possible hardware, so
>> what's that, DirectX 8? 9? Vertex shaders run on DX8 but you won't get many
> Well you're kind of juggling conflicting requirements. You want the app to
> run on low-end graphics, but you want to reduce its CPU-side memory usage to
> a minimum by not storing normals. Generally you have a trade-off to make by
> using more memory and getting good performance, and getting lower
> performance but using less memory. That's just the way it goes, but you'll
> have to try to know for sure. No one has a situation exactly like yours, we
> can only offer guidance.
> We've given you a few different alternatives, now you have to weigh the
> pros and cons yourselves. Perhaps try a few of the alternatives in a little
> test program before making changes in your software itself, and test the
> alternatives in realistic settings (with lots of objects for example)
> looking at the stats each time.
> If you really want to use normal indices, try it out, but as Robert said
> (and I and others have said before in this thread) this will drop you down
> to slow paths. If that's good enough for you, then fine, but you won't know
> unless you try it.
> Hope this helps,
> Jean-Sebastien Guay jean-sebastien.guay at cm-labs.com
> osg-users mailing list
> osg-users at lists.openscenegraph.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the osg-users