Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 32

Thread: Vertex cache optimization

  1. #21
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Vertex cache optimization

    aren't there some ready to use classes for that? seems NVTriStrip can also output lists instead of strips or AMD Tootle?

  2. #22
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Vertex cache optimization

    Quote Originally Posted by _NK47
    aren't there some ready to use classes for that? seems NVTriStrip can also output lists instead of strips or AMD Tootle?
    Last time I messed with NVTriStrip (3Q06), the alg it used was expensive and used mesh topology to build the triangle list. It blows up in cases like two intersecting planes with a shared axis (std tree technique). It appears it was last updated 2004, so that's probably still the case.

    Implementing Forsyth's optimizer is well worth the time. I think I've seen other implementations of it elsewhere on the net. Try googling ("forsyth triangle optimization"). Failing that, feel free to ask questions, MarkS, and I'll help you out. It isn't really that hard, and actually kinda fun.

    Up at the top of google hits, here's one link, with full source code:

    * Triangle Order Optimization (source code)

    I haven't verified his implementation, but his times look really suspect.

    Here's another one:

    * Vertex cache optimization library (source code)

  3. #23
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Vertex cache optimization

    <deleted>

  4. #24
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Vertex cache optimization

    Dark Photon thanks for the effort and suggestions.

  5. #25
    Member Regular Contributor Jackis's Avatar
    Join Date
    Sep 2005
    Location
    Saint-Petersburg, Russia
    Posts
    279

    Re: Vertex cache optimization

    Here are our versions of that algorithm (quite fast for me, but can be done much faster).
    http://slil.ru/27912469

  6. #26
    Advanced Member Frequent Contributor _NK47's Avatar
    Join Date
    Mar 2008
    Posts
    574

    Re: Vertex cache optimization

    Thank you Jackis.
    while still reading more on this topic found some ACMR vs. ATVR comparisons here.
    seems like Forthys algorithm is quite good in many situations considering that on todays cards (and less current) vertex cache size is > 32.

  7. #27
    Intern Contributor
    Join Date
    Oct 2010
    Posts
    60

    Re: Vertex cache optimization

    Tell me please, what a MaxSizeVertexCache constant in Forthys algorithm do you use? 32?

  8. #28
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Vertex cache optimization

    Around that.

    Look above for what it was 5-8 generations of GPU ago. Then consider that the incremental improvement once you get into sizes that large isn't that much, and if you pick a number "too big" you thrash the cache. So those numbers should be decent sizes to optimize for.

    I think I read someplace that on recent GPUs, the post-vertex-shader cache size effectively varies depending on the amount of "varying" data that needs passed between the shaders (that is, it's probably tied to a specific maximum amount of memory in bytes, not in verts). But I don't remember where. Anybody got a ptr, or know differently? If true, there is no official "best" number for todays GPUs. You just pick a "really good" number, like those old numbers ~32.

  9. #29
    Intern Contributor
    Join Date
    Oct 2010
    Posts
    60

    Re: Vertex cache optimization

    I have written Forthys algorithm, ACMR changed form 2.0 to 0.67, but FPS and time for model rendering didn`t change. What can it be?

  10. #30
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,882

    Re: Vertex cache optimization

    Quote Originally Posted by Itun.itu
    I have written Forthys algorithm, ACMR changed form 2.0 to 0.67, but FPS and time for model rendering didn`t change. What can it be?
    That just suggests that you're probably not vertex transform bound. Other possibilities: fill, texture fetch, setup, state change, batch submit, etc. -- some are GPU bottlenecks, some are GPU bottlenecks. Lots of ptrs out there for identifying where the bottleneck is. Start at the end of the pipe and work your way back (e.g. start by shrinking the window). But first flip rendering of your model on and off and make sure it dominates the frame time. If not you may need to render it a number of times to pump the frame time up so you can focus on it specifically.

    BTW, ATVR is probably a better measure of vertex cache efficiency. For more details, see Ignacio's post here). 1.0 being optimal of course.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •