Re: [Aqsis-commits] [SCM] Aqsis Renderer branch, master, updated. CVS_Tip-2543-g36401c7

View: New views
2 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: [Aqsis-commits] [SCM] Aqsis Renderer branch, master, updated. CVS_Tip-2543-g36401c7

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, Sep 14, 2009 at 9:26 AM, Paul Gregory
<pgregory@...> wrote:

[...]

>    Fix bug #2853239.
>
>     * Apply Chris Foster's patch to reintroduce dof offset shuffling.
>     * Switch the jittering based on the Hider "jitter" option, as
>       for other jittering.

>
> @@ -334,6 +333,33 @@ void CqImagePixel::Combine( enum EqDepthFilter depthfilter, CqColor zThreshold )
>
>  void CqImagePixel::setSamples(IqSampler* sampler, CqVector2D& offset)
>  {
> +       static CqRandom rnd(123);
> +       TqInt nSamps = numSamples();
> +
> +       for(TqInt i = 0; i < nSamps; ++i)
> +               m_DofOffsetIndices[i] = i;
> +
> +       bool jitter = true;
> +
> +       const TqInt* jitterOption;
> +       if((jitterOption = QGetRenderContext()->poptCurrent()->
> +                       GetIntegerOption("Hider", "jitter")) != NULL && jitterOption[0] == 0)
> +               jitter = false;

I reckon it'd be better to pass the jitter in as an argument to setSamples.
Reasoning:
1) It restricts the use of global state (ie, QGetRenderContext())
2) Option lookup isn't all that cheap, so avoiding doing it once per
pixel is a good thing.

~Chris

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development

Re: [Aqsis-commits] [SCM] Aqsis Renderer branch, master, updated. CVS_Tip-2543-g36401c7

by Paul Gregory-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

2009/9/14 Chris Foster <chris42f@...>

I reckon it'd be better to pass the jitter in as an argument to setSamples.
Reasoning:
1) It restricts the use of global state (ie, QGetRenderContext())
2) Option lookup isn't all that cheap, so avoiding doing it once per
pixel is a good thing.

~Chris


I agree, on reflection calling out to global options every pixel is a bad idea, however I didn't like the idea of passing in an extra flag, when we're already abstracting the sampling via the sampler interface passed in. I decided instead to extend the sampler interface to include a "shuffled indices" array, that works in much the same way as the existing 2d and 1d samples array, i.e. returns a constant array from as list of pre-filled ones.

Cheers


Paul
 
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Aqsis-development mailing list
Aqsis-development@...
https://lists.sourceforge.net/lists/listinfo/aqsis-development