Arbitrary Output Variables

2006-03-03
2013-04-25
  • AKHmetgaleev ILdar

    Arbitrary Output Variables from aqsis wiki page doesn't work property with pixie. I'll post link on pixe's wiki in issuesList.

     
    • George Harker

      George Harker - 2006-03-03

      Hi there,

      AOVs should work just fine for Pixie.  I assume you mean the page here:

      http://www.aqsis.org/xoops/modules/wikimod/index.php?page=ArbitraryOutputVariables

      Try replacing the preeamble with the following

      #Quantize "Cs" 255 0 255 0            #not legal, 1st arg is "rgba" or "z"

      Declare "myval" "varying float"        #myval must be predeclared so that the display knows about its

      FrameBegin 0
      Display "aov.tif" "framebuffer" "rgba"
      Display "+aov.tif" "file" "rgba"
      Display "+aovN.tif" "file" "N" "quantize" [128 255 0 255]
      #Display "+aovCs.tif" "file" "Cs"
      Display "+aovCs.tif" "file" "Cs" "quantize" [0 255 0 255]
      Display "+aovs.tif" "file" "s" "quantize" [0 255 0 255]
      #Display "+aovmyval.tif" "file" "float myval" "quantize" [0 255 0 255]    #this won't work if myval us unknown
      Display "+aovmyval.tif" "file" "myval" "quantize" [0 255 0 255]

      The issues are as follows:

      1. In Pixie, Quantize takes "rgba" , "z" or "custom" as the first argument.  "custom" allows you to modify the quantization of the last set display.  Basically I don't think the first argument can take a variable name (according to the spec).  Use "quantize" as an argument to Display instead.

      2. N is output fine.

      3. Cs is output fine (but see comment on quantizing in the Display declaration)

      4. s.  We do not set s unless the shader needs it (s = u by default).  Pixie will only set up s if it knows it's needed.  So given that it's neither used, nor output to, the image you get is blank.  Arbitrary output variables should usually be output... either use s in the shader, or output u.

      5. AOVs must be declared at the point they are referenced by the Display call.  Use Declare before display so that the renderer knows what entity to output.

      Hope that helps

      George

       
    • AKHmetgaleev ILdar

      All works fine except N's quantize
      I have same result with
      Display "+aovN.tif" "file" "N" "quantize" [128 255 0 255]
      and with
      Display "+aovN.tif" "file" "N"

      and again I'll show images in wiki

       
      • George Harker

        George Harker - 2006-03-05

        Hi there,

        You're right - there is a bug in the quantization.  It's a one line fix if you're compiling Pixie yourself (src/file/file.cpp line 252)

        data[i]            =    qzero + (qone - qzero)*data[i] + dither;

        rather than

        data[i]            =    (qone - qzero)*data[i] + dither;

        However, you almost certainly want to be visualising a normalized version of N.  Ie. create another output variable

        varying ouput normal NN

        and have the shader set

        NN=normalize(N);

        Because N may not be unit - in which case the quantization settings would need to be different for all primitives (which they can't be).

        I've also added support for the next version of Pixie to inline-declare the variable in a Display call.  The type should match that in the shader, so the following would be needed

        Display "+aovmyval.tif" "file" "varying float myval"

        rather than

        Display "+aovmyval.tif" "file" "float myval"

        Hope that helps

        George

         
    • AKHmetgaleev ILdar

      How to add arbitrary output to additional channels to TIFF or EXR file formats?

       
      • George Harker

        George Harker - 2006-04-17

        Hi there,

        If you mean to combine multiple AOVs to a file, you should be able to do this using the RiDisplayChannel RIB call:

        DisplayChannel "color AovOne"
        DisplayChannel "color AovTwo"
        Display "foofile.tif" "file" "AovOne,AovTwo"

        Hope that helps

        George

         
    • AKHmetgaleev ILdar

      Thanks! This exactly what I need.

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks