environment() w/ 4 texture coordinates?

Help
2008-10-14
2013-04-25
  • Eric Hochhalter

    Eric Hochhalter - 2008-10-14

    Does Pixie support a call to environment() that uses 4 texture coordinates?
    I attempted this in my shader, but I cannot compile. The compiler does not consider my call to the function valid. I find this odd, because this format is explicitly listed in the RenderMan Specification.
    Any assistance is welcome (especially if it's just a stupid mistake in my code).

    My RSL:
        vector R0 = vtransform("object", envspace, R);
        vector R1 = R0 + Du(R)*du;
        vector R2 = R0 + Dv(R)*dv;
        vector R3 = R1 + R2 - R0;
        C = color environment(envname, R0, R1, R2, R3, "blur", blur);

    The RMan Spec:
    float environment( string name[channel];
    texture coordinates, [parameterlist] )
    color environment( string name[channel];
    texture coordinates, [parameterlist] )

    where texture coordinates is one of the following:

    point R;
    point R1, R2, R3, R4;

    Return the filtered texture value from an environment map. The cast before the function determines the type returned, either a float or a color. The name is the name of the texture map created using RiMake...Environment. The channel selector is optional; if it is not present, the brackets are also omitted and channel 0 is assumed. channel selects the starting channel in the texture. The number of channels returned depends on whether the texture is interpreted as a float or a color. This function expects either a single texture coordinate or four texture coordinates. These are points that are used to define a direction in space. The length of this vector is unimportant. parameterlist is a list of name-value pairs which allow greater control over texture access.

     
    • Nicholas Yue

      Nicholas Yue - 2008-10-14

      I don't have the rest of your shader code but I reconstructed the following and compile it with the 3Delight shader as a cross check and it compiled fine.

      surface mytexture(string envspace = "shader";
           string envname = "";
           float blur = 0.1;
           varying vector R = (0,1,0))
      {
          vector R0 = vtransform("object", envspace, R);
          vector R1 = R0 + Du(R)*du;
          vector R2 = R0 + Dv(R)*dv;
          vector R3 = R1 + R2 - R0;
          color C = color environment(envname, R0, R1, R2, R3, "blur", blur);
      }

       
      • Eric Hochhalter

        Eric Hochhalter - 2008-10-15

        Nicholas,

        Thanks for the input.
        Just to be thorough, I tried your version of the code with Pixie's sdrc. It still does not compile in Pixie.
        I also confirm that 3Delight's shaderdl does compile this code.

        This code was suggested by ILM for PRMan (Landis, SIGGRAPH 02 Course 16, Listing 5.4)

        The errors from sdrc:
        mytexture.sl(11) : error : Function environment not found
        mytexture.sl(11) : error : Unable to cast a vector

        George/Okan, will Pixie be updated to use a 4-coordinate environment() call?

         

Log in to post a comment.