高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】jaggy lines in gsmodel
jaggy lines in gsmodel
jaggy lines in gsmodel
hi,
we often encounter dwg files where the drawing is located on large coordinates (e.g +/-500,000,000). rendering these files with gsmodel enabled results in very jaggy lines, in both the opengl and directx renderer. (disabling gsmodel fixes the rendering problem, but since this is too slow for complex drawings it is not an option for us).
are there any plans to fix this in future versions?
(i have attached an example with a single text object)
attached files
yes it is a known bug. it is connected with fp precision: gl as well as dx use float for coordinate representation, and when coordinates are too large, precision loss causes artifacts.
i can't imagine a simple solution, but there is a workaround at the device level:
at the first vectorization you may remember worldtoeyetransform matrix at the entd of odgsopenglvectorizeview::loadviewport(), and load identity matrix instead, then, at the next vectorizations, before loading model matrix, you should multiply current worldtoeyetransform by the inverse of the stored matrix.
additionalyy you should manually apply that transform to all the input coordinates in the *out fuctions (triangleout, polygonout, etc.).
this would slow down cache building a bit, but the gl coordinates will be more reasonable.
in directx device, the same idea can be implemented.
vladimir
thanks, this seems like a fairly universal solution, at least for drawings with large coordinates. i guess the same method could be applied for extreme scales.
it is not quite universal. the problem is - when to rebuild cache?
in autocad they introduced the notion of the 'working area', and when user pans or zooms the drawing out of the working area, regen is called.
here, similar mechanism may be implemented at the applications level, but it would be non-trivial, because we are lacking farmework support for it in dd.
but you may try, it doesn't seem to be overcomplicated, just ugly.
vladimir
|