POV-Ray : Newsgroups : povray.unix : Mosaic Preview : Re: Mosaic Preview Server Time
28 Apr 2024 09:04:52 EDT (-0400)
  Re: Mosaic Preview  
From: clipka
Date: 21 May 2010 10:26:52
Message: <4bf6982c$1@news.povray.org>
Am 21.05.2010 15:28, schrieb Jim Holsenback:

> I'm rendering a scene (no radiosity) using these command line options:
> +sp64 +ep16 +bs16
>
> I'd expect to get several course looking passes before the final render,
> instead I get a solid colored display that blinks several times (the
> number of times I'd expect with the sp/ep settings I'm using) then a
> final pass with the expected behavior (smaller blocks being rendered
> because I'm using +bs16 rather than the default of +bs32)
...
> Can anyone else confirm this?

I think I can confirm from the Unix source code, which looks somewhat 
fishy and would indeed fit that bill if I understand it right.

The implementation of UnixSDLDisplay::DrawFilledRectangle() in 
disp_sdl.cpp, which should draw a single-colored rectangle in the 
preview window, looks corrupted to me:

- It trims the coordinates to fit inside the image rectangle, which is ok.

- It scales the coordinates to screen coordinates if necessary, which 
looks ok as well.

- It calls the function UnixSDLDisplay::UpdateCoord(), which seems to 
keep track of a (single) display region that needs to be re-painted. 
There seems to be nothing wrong here either.

- It apparently converts the pixel color to the format expected by Unix, 
which looks trivial.

- It fills the *entire* rectangle marked for update with the converted 
colour, which seems utterly wrong to me.

- It seems to restart a delay timer to prevent all-too-frequent 
re-painting of the display.


Can you please try changing the code as follows: Replace the line in 
unix/disp_sdl.cpp, function UnixSDLDisplay::DrawFilledRectangle() 
(somewhere around line 513) reading:

     SDL_FillRect(m_display, &m_update_rect, sdl_col);

with the following code:

     SDL_Rect tempRect;
     tempRect.x = ix1;
     tempRect.y = iy1;
     tempRect.w = ix2 - ix1; // might need an additional +1
     tempRect.h = iy2 - iy1; // might need an additional +1
     SDL_FillRect(m_display, &tempRect, sdl_col);

I /think/ that should fix it. Feedback would be very much appreciated 
(please also feel invited to file a bug report).


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.