Announcement

Collapse
No announcement yet.

VRayDomeCamera: Ray Start

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • VRayDomeCamera: Ray Start

    Hi,

    I have a problem with the vrayDomeCamera. Everything works fine, except that the start point of the ray doesn't seem to matter. If I'm not mistaken 'mint' should set the start point of the ray, whereas 0.0f is the camera center. Here is the part of the source where I set the start and end point of the ray:

    Code:
    // This is called to compute the actual ray:
    //   xs, ys - the point in screen (pixel) coordinates
    //   time - the time in the motion blur interval (0-1); VRay will do automatic moblur for camera motion, use this for the other camera params
    //   dof_uc, dof_vc - if DOF is on, these are additional lens sampling vars
    //   ray - this is where the computed ray must be stored; it's good to make the direction a unit direction
    //   mint - this is the start point along the ray (typically 0.0f)
    //   maxt - this is the end point along the ray (typically a large value, 1e18f)
    //   rayDeriv - derivatives of the point and direction with respect to xs and ys, may be computed numerically if there is no other way
    
    int VRayCamera::getScreenRay(double xs, double ys, double time, float dof_uc, float dof_vc, VR::Ray &ray, VR::Ireal &mint, VR::Ireal &maxt, VR::RayDeriv &rayDeriv, VR::Color &multResult) {
    ...
    //	mint=0.0f;
      mint = -1e18f;
      maxt=1e18f;
    
    	return true;
    }
    To verify the implementation I have created a simple scene with a plane at (0,0,0) with the normal (0,0,1). The camera is located at (0,0,100), facing to (0,0,0). The background color is set to yellow and the plane is turquoise. Here is the rendered image:



    Now I have moved the camera to (0,0,-100). The plane is therefore behind the camera. If the ray would really start at -1e18f the plane should be visible in the rendered image:



    Sadly the plane does not show up
    Is this a bug or have I done something wrong? Are there additional render settings I have to take into account?

    Sincerely yours,
    bob

  • #2
    I think mint should really be zero or greater than zero. If you want the ray to start somewhere else, just move the starting point of the ray itself. If you want a ray to always start outside the scene, you can get the scene bounding box from the V-Ray ray server.

    Best regards,
    vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Thanks, that worked like a charm

      You are not mistaken - with positive values 'mint' works as expected.

      Sincerely yours,
      bob

      Comment


      • #4
        Ok, glad it's sorted out.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment

        Working...
        X