POV-Ray : Newsgroups : povray.unofficial.patches : Changing the order of block rendering (not starting always top left) : Re: Changing the order of block rendering (not starting always topleft) Server Time
23 Sep 2021 22:32:56 EDT (-0400)
  Re: Changing the order of block rendering (not starting always topleft)  
From: clipka
Date: 22 Jul 2010 06:29:41
Message: <4c481d95$1@news.povray.org>
Am 22.07.2010 10:38, schrieb Le_Forgeron:

> Code is provided; it's basically adding 2 functions to replace the
> previous computation made inline with modulo, twice in the code
> (duplicating such code is a call for trouble in the futur).
> Each function (one for X, the other for Y) is a switch statement which
> choose how the bloc number is converted into X,Y block coordinates.
> If you want more mode(s), just add your own case(s) in the switch, and
> expand the clipped-range used for the option.

I just found time to actually look at the code, and I must say it looks 
like a pretty elegant, "minimally-invasive" solution.

Yes, the other modules are perfectly unaware of the mapping of "block 
numbers" vs. screen coordinates; some are actually aware of block 
nubers, but all they know (or expect) is that the number is unique for 
each block - plus a special mode of operation in which radiosity 
pretrace code expects the numbers to be consecutive and in the same 
order in which the blocks are actually dispatched to the individual threads.

I have only two points of critique:

(1) I think the computation of blockX and blockY should be done in one 
single function, to prevent "fragmentation" of the mapping rules for 
each case. (It is not uncommon in the POV-Ray code for a function to 
have multiple output values.)

(2) Your code does not match the files' overall code formatting style :-P


Post a reply to this message

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