Re: [Aqsis-commits] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

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

Parent Message unknown Re: [Aqsis-commits] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

by Matthias Baas-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Here's a little "code review" (just a few minor things):  :)

c42f@... wrote:

> --- trunk/testing/regression/RIBs/Procedurals/detailproc.py 2009-08-09 07:46:36 UTC (rev 2863)
> +++ trunk/testing/regression/RIBs/Procedurals/detailproc.py 2009-08-09 08:06:13 UTC (rev 2864)
> @@ -4,7 +4,6 @@
>  
>  import sys
>  import Image, ImageDraw
> -from cgkit.ri import *
>  
>  def createImage(imgname, detail):
>      img = Image.new("RGB", (200,100))
> @@ -24,12 +23,9 @@
>  
>      createImage("tmp_tex.tif", detail)
>  
> -    RiBegin(RI_NULL)
> -    RiSurface("constanttex", "string mapname", "tmp_tex.tif")
> -    RiPatch(RI_BILINEAR, P=[-2,1,0, 2,1,0, -2,-1,0, 2,-1,0])
> +    print 'Surface "constanttex" "string mapname" ["tmp_tex.tif"]'
> +    print 'Patch "bilinear" "P" [-2 1 0  2 1 0  -2 -1 0  2 -1 0]'
> +    print '#\377'

This will break once people start using Python 3 because print is not a
statement anymore but just a normal function.
So to be ready for the move to Python 3 I would suggest to write print
statements so that they look like functions (i.e. put parentheses around
the argument):

  print ('Surface "constanttex" "string mapname" ["tmp_tex.tif"]')

Then the line will work with all versions of Python (as long as there is
just one argument).

> -    RiArchiveRecord(RI_COMMENT,"\377")
>      sys.stdout.flush()

An alternative to the above prints would be to write sys.stdout.write().
This is a regular method call anyway (so it also works with Python 3)
and it makes it clearer that the above flush() flushes the data written
by the print statements/functions.

- Matthias -


------------------------------------------------------------------------------
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] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Aug 9, 2009 at 7:12 PM, Matthias Baas<matthias.baas@...> wrote:
> Here's a little "code review" (just a few minor things):  :)

Thanks, I like code reviews :)  Well, particularly when they contain good
advice like this one.

> This will break once people start using Python 3 because print is not a
> statement anymore but just a normal function.

Oops, I forgot about python 3, good point.

>> -    RiArchiveRecord(RI_COMMENT,"\377")
>>      sys.stdout.flush()
>
> An alternative to the above prints would be to write sys.stdout.write().
> This is a regular method call anyway (so it also works with Python 3)
> and it makes it clearer that the above flush() flushes the data written
> by the print statements/functions.

Yes, I like this a little better than the print() possibility.  Does something
like the following look good to you?

    out = sys.stdout
    out.write('Surface "constanttex" "string mapname" ["tmp_tex.tif"]')
    out.write('Patch "bilinear" "P" [-2 1 0  2 1 0  -2 -1 0  2 -1 0]')
    out.write('#\377')
    sys.stdout.flush()

If so, I'll commit it.

~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] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Ah, duh, I meant the following:

    out = sys.stdout
    out.write('Surface "constanttex" "string mapname" ["tmp_tex.tif"]')
    out.write('Patch "bilinear" "P" [-2 1 0  2 1 0  -2 -1 0  2 -1 0]')
    out.write('#\377')
    out.flush()

------------------------------------------------------------------------------
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] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

by Matthias Baas-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Foster wrote:
> Ah, duh, I meant the following:
>
>     out = sys.stdout
>     out.write('Surface "constanttex" "string mapname" ["tmp_tex.tif"]')
>     out.write('Patch "bilinear" "P" [-2 1 0  2 1 0  -2 -1 0  2 -1 0]')
>     out.write('#\377')
>     out.flush()

That looks nice, clean and portable to me.
The only thing is that you have to add newlines to the strings as
write() really just writes what you pass into it and doesn't add a
newline automatically.

- Matthias -


------------------------------------------------------------------------------
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] SF.net SVN: aqsis:[2864] trunk/testing/regression/RIBs/Procedurals

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Sun, Aug 9, 2009 at 8:35 PM, Matthias Baas<matthias.baas@...> wrote:

> Chris Foster wrote:
>> Ah, duh, I meant the following:
>>
>>     out = sys.stdout
>>     out.write('Surface "constanttex" "string mapname" ["tmp_tex.tif"]')
>>     out.write('Patch "bilinear" "P" [-2 1 0  2 1 0  -2 -1 0  2 -1 0]')
>>     out.write('#\377')
>>     out.flush()
>
> That looks nice, clean and portable to me.
> The only thing is that you have to add newlines to the strings as
> write() really just writes what you pass into it and doesn't add a
> newline automatically.

Good catch.  The funny thing is I did actually test this and just by
chance the result was valid RIB in both cases without the newlines.

Fixed now and committed.
~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

Future GPUs bringing REYES mainstream

by Ray Gardener :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all, I came across this Siggraph presentation PDF which seemed
interesting, it's about future graphics hardware boosting REYES-style
rendering (micropolys, cam optics, etc.).

http://s09.idav.ucdavis.edu/talks/08_kayvonf_mpTalk.pdf

Ray

------------------------------------------------------------------------------
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: Future GPUs bringing REYES mainstream

by Chris Foster-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Aug 11, 2009 at 4:38 AM, Ray Gardener<rayg@...> wrote:
> Hi all, I came across this Siggraph presentation PDF which seemed
> interesting, it's about future graphics hardware boosting REYES-style
> rendering (micropolys, cam optics, etc.).
>
> http://s09.idav.ucdavis.edu/talks/08_kayvonf_mpTalk.pdf

Thanks for pointing this out Ray, we've come across a lot of
reyes-on-GPU style papers in the last year and this just adds to the
list of interesting material.

I'm particularly intrigued by their "diagsplit" replacement for
splitting and dicing, though the slides don't really explain it
well...  Also their commentary on parallel micropolygon sampling is
interesting.
~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