Re: Plotting results from z-buffer are diffrenet than xwindow. [message #89031 is a reply to message #89030] |
Wed, 16 July 2014 17:16   |
Karl[1]
Messages: 79 Registered: October 2005
|
Member |
|
|
Since the colors look right, I don't think it is a color issue. But Jason set DECOMPOSED to 1 before calling Bart's function for the Z device. In order for polyfill to use a color index into the color table for a color, I think the device needs to have DECOMPOSED set to 0.
Bart, do you do a DEVICE, DECOMPOSED=0 in your function?
What I really think is happening is rasterization differences for polyfill on the two devices. The X (or WIN) device would likely use hardware-assist to draw polygons. On the Z device, I would think that it uses (IDL) software to perform the rasterization.
Regardless of the details of the device implementations, the important point is that the rasterization paths are different, and that means that each implementation will make different decisions about what pixels to turn on when drawing lines or shapes.
For example, if one of these radar bins is so small that it barely covers a pixel on the target device, the rasterizer needs to make a decision about whether to draw that pixel or not. More generally, whenever a polygon covers a fraction of a pixel, a decision must be made about that pixel.
Anyway, the software implementation for the Z device looks like that it *might* be making decisions that turn on more pixels than the X device. That's what I gather from comparing the two images.
Another observation that supports this idea is that the dotted line styles are rendered differently between the two devices.
I can't think of an easy way to verify this other than perhaps drawing a simple shape like a large rectangle with non-orthogonal sides on the X and Z devices and comparing the images to see how many rasterization differences there are by XORing the images. Could also try it for very small rectangles and see if there are significant differences. In other words, simplify the dataset to a few examples for easier comparison.
If that turns out to be the problem, then I might suggest separating your radar bins in terms of size and draw only the ones larger than a pixel with polyfill. The ones that are smaller can be drawn with something that sets only a single pixel. You might have to play with this threshold. For example, anything bigger than 4 square pixels can be done with polyfill, and then draw a single pixel for the others, etc.
The IDL documentation for polyfill suggests that there are rules about interior filling and to avoid them, use DRAW_ROI. You could try using DRAW_ROI to see if the polygon fill gives more consistent results without separating. If you still need to draw the sub-pixel bins differently, DRAW_ROI has a point primitive.
I can't think of any other approaches at the moment. I'm sort of surprised at how different the Z device is from the others in this respect. I would have expected some pixels to be different, but not this many.
Hope this helps (and is half-right)
|
|
|