To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 14275
14274  |  14276
Subject: 
Re: LDD vs LDraw
Newsgroups: 
lugnet.cad
Date: 
Thu, 14 Dec 2006 06:45:01 GMT
Viewed: 
1961 times
  
In lugnet.cad, Leonardo Zide wrote:
   Unfortunately this is a tradeoff between quality and speed, if I
sorted by triangle it would give better results but would also be
much slower to render. There are other options for transparency
sorting, like doing a Z init pass or rendering only front faces.

You might be surprised about the performance.  LDView cheats and only sorts the
centroids of the transparent triangles, but it does do a brute force sort (via
qsort()) of all transparent triangles every frame (assuming you have that option
turned on).  I calculate the distance squared to all the centroids with the
current matrix prior to the sort in order to avoid having to calculate that in
the comparison function.  It takes a whole lot of transparent parts in the model
for the sorting to have a significant impact on performance.

Of course, my implementation is ugly, since all the transparent bits in the
model have to be converted to triangles, and those all have to get yanked from
the main part geometry and moved into a big huge list.  But it's nowhere near as
slow as I originally thought it would be.


   Also, for #3 in LeoCAD if you use the Zoom Extents before rotating
you'll rotate around the model center.

Hey, that's the opposite of LDView.  If you do a "Zoom to Fit" in LDView, it
STOPS rotating about the model center.  (I think I'm going to fix that, though.)
Just out of curiosity, what does "Zoom Extents" do?  Does it zoom so that the
bounding box of the whole model fills most of the window based on the current
viewing angle?  I know it zooms to different levels based on the viewing angle,
but I don't think any geometry actually makes it to the edge of the window.

--Travis



Message has 1 Reply:
  Re: LDD vs LDraw
 
(...) I don't even keep a copy of the vertices in system memory, I upload them all to the video card and forget about them. It might not be terribly bad to sort the triangles per frame since usually there aren't that many translucent pieces but I (...) (18 years ago, 15-Dec-06, to lugnet.cad)

Message is in Reply To:
  Re: LDD vs LDraw
 
(...) Unfortunately this is a tradeoff between quality and speed, if I sorted by triangle it would give better results but would also be much slower to render. There are other options for transparency sorting, like doing a Z init pass or rendering (...) (18 years ago, 13-Dec-06, to lugnet.cad)

33 Messages in This Thread:












Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR