Bugreport #4787 mentioned subpixel render issues, especially for small
images (like used for rendering icons). When working during Orange on new render pipeline, I've left this topic alone for a while... subpixel precision testing is very time consuming and needs concentration for a while. :) This commit brings back precision as it was for 2.41. Below a short explanation of the solved issues. - the window matrix for rendering is kept constant during all OSA passes, this to ensure clipping happens for each pass identically. - a subpixel offset is only applied on filling in the z-buffer - this offset is inverse corrected for shadepixel code, only on 2 places Another nasty issue is that for filtered rendering (gauss etc), the tiles (or entire image) is temporally increased 2 pixel in size. This caused a 'dark' (or sky color) edge on the rendering. During Orange that was solved with a hardcoded clipping offset value, which only corrected for larger pictures (like > 500 pixels in size). Now this clipping offset is correctly calculated, based on render size. Last issue: the view border in 3d window was calculated using integers, giving small errors in display too. Now it uses float, so visually the view border is more close to what a render shows.
This commit is contained in:
@@ -1980,14 +1980,14 @@ void set_render_border(void)
|
||||
|
||||
val= get_border(&rect, 3);
|
||||
if(val) {
|
||||
rcti vb;
|
||||
rctf vb;
|
||||
|
||||
calc_viewborder(G.vd, &vb);
|
||||
|
||||
G.scene->r.border.xmin= (float) (rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
|
||||
G.scene->r.border.ymin= (float) (rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
|
||||
G.scene->r.border.xmax= (float) (rect.xmax-vb.xmin)/(vb.xmax-vb.xmin);
|
||||
G.scene->r.border.ymax= (float) (rect.ymax-vb.ymin)/(vb.ymax-vb.ymin);
|
||||
G.scene->r.border.xmin= ((float)rect.xmin-vb.xmin)/(vb.xmax-vb.xmin);
|
||||
G.scene->r.border.ymin= ((float)rect.ymin-vb.ymin)/(vb.ymax-vb.ymin);
|
||||
G.scene->r.border.xmax= ((float)rect.xmax-vb.xmin)/(vb.xmax-vb.xmin);
|
||||
G.scene->r.border.ymax= ((float)rect.ymax-vb.ymin)/(vb.ymax-vb.ymin);
|
||||
|
||||
CLAMP(G.scene->r.border.xmin, 0.0, 1.0);
|
||||
CLAMP(G.scene->r.border.ymin, 0.0, 1.0);
|
||||
|
||||
Reference in New Issue
Block a user