Feedback

What's your question?

By: Asked

How do I render a panoramic environment map in renderman?

How do you create a lat long environment map with a single render in renderman?

Add comment viewed 970 times Latest activity 11 months ago

or Cancel

3 answers

  • 3

dan bethell [ Editor ]

Check out section 16.2.3 of Advanced RenderMan.

It explains how you can implement alternate camera models (in any RenderMan renderer that supports the trace() shadeop) using a clip plane shader. Essentially, this involves shading a geometry patch located just beyond the near clip plane. The book has an example panorama shader which can render a scene 360' around the y-axis.

Here is a lat-long shader based on that idea:

surface latlong()
{
    // our ndc-space point
    point _Pndc = transform( "NDC", P );

    // our parametric coordinates
    float _u = xcomp( _Pndc );
    float _v = ycomp( _Pndc );

    // our vector components
    float rayx = -cos( _u * PI * 2 ) * sin( _v * PI );
    float rayy = cos( _v * PI );
    float rayz = sin( _u * PI * 2 ) * sin( _v * PI );

    // our trace point/vector
    point _Pt = point "object" ( 0, 0, 0 );
    vector _It = vector "world" ( rayx, rayy, rayz );

    // trace a colour
    Ci = trace( _Pt, _It );
    Oi = Os;
    Ci *= Oi;
}

This particular shader uses the transform of the shaded object (presumably the clip plane geometry) to set the center of the projection. If you decide to use this method, be sure to set the trace visibility of objects so everything is visible to the trace() call.

A test scene with a pink dot marking the center of environment:

a scenethe clip plane

The rendered latlong map and a quick test using it as a reflection map:

the latlong maptesting the result

or Cancel
  • 2

luke emrose [ Editor ]

To add to the first answer, because the renderer uses a linear transformation to transform the projected points from world into camera space, there is no way to create such a camera without firing trace rays as mentioned by Dan. This is because such a camera ( as well as cameras like fish-eye etc. ) would require a non-linear transform.

However, the multiple camera option is definitely a good way to go, as for some scenes firing trace rays ( i.e. complex scenes ) it far too costly, especially where the scene is already basically maxing our your machine resources.

or Cancel
  • 1

gpedder

hmmm not sure if prman supports a camera like that. I haven't tried this but you may be able to set up a 6 camera rig then render all the views in one go if the outputs are all setup at the top of the rib. Then you'd could stitch them into a cross type environment map and transform that into a lat long type. hdr shop will do that.

or Cancel