Announcement

Collapse
No announcement yet.

V-Ray for GH and Rhino safe frame different

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

  • V-Ray for GH and Rhino safe frame different

    I noticed that there is a difference in how V-Ray for Grasshopper and V-Ray for Rhino interpret the safe frame.

    In Grasshopper if you render a square image it will take the width of the viewport and make a square view using that:

    Click image for larger version

Name:	render_in_GH.jpg
Views:	660
Size:	287.1 KB
ID:	1088101

    In Rhino it (correctly) takes the height of the viewport (as it is usually smaller than the width) and creates the square based on that.

    Click image for larger version

Name:	render_in_rhino.jpg
Views:	590
Size:	911.1 KB
ID:	1088102

    Notice the different crops, even though the camera is not changed between the 2 renders.

    Thanks for fixing!

  • #2
    Hi seltzdesign

    The issue underlies in the fact that Grasshopper does not take into account the safe frames and renders in respect to the render output and Rhino's viewport as it is.
    In Rhino, the safe frames are adapted to the settings of the render output

    Comment


    • #3
      Okay, I understand. But shouldn't Grasshopper in that case do just that, so that both work the same way? In Grasshopper you always take the longer of the viewports dimensions and create a new view (in my case square) and Rhino always takes the smaller of the viewports dimensions to build the safe frame. So why doesn't Vray for GH just use the smaller of the 2 as well and instead uses the larger?

      Comment


      • #4
        Basically, Grasshopper takes the Rhino viewport as it is and disregards safe frames which are established on the bases of NeUI's render output. If you use the Match Viewport aspect ratio, you should get the same result in Rhino and Grasshopper

        Comment


        • #5
          Originally posted by georgi.georgiev View Post
          Basically, Grasshopper takes the Rhino viewport as it is and disregards safe frames which are established on the bases of NeUI's render output. If you use the Match Viewport aspect ratio, you should get the same result in Rhino and Grasshopper
          Haha, well of course. If you make the viewport the same aspect ratio it will be the same in both, but only because then its not obvious that one calculates based on frame height and one on frame width. That was my workaround too. It just means that my viewport always has to have the same aspect ratio as my output and if thats the case than I don't need the safe frame any longer.

          So I see it as not something that fixes the problem, but a workaround that means the bug is not obvious. Its really not difficult to calculate the correct camera view if you know the aspect ratio of the viewport and the aspect ratio of the output (I assume the renderer in GH still knows that). So then you just check if the aspect ratio of the output is higher or lower than the aspect ratio of the viewport. If the aspect ratio is higher you take the viewport height and recalculate the width and if the aspect ratio is lower you take the viewport width and recalculate the height. It appears that the bug is that GH always calculates the view based on viewport width.

          Comment


          • #6
            Originally posted by seltzdesign View Post
            I noticed that there is a difference in how V-Ray for Grasshopper and V-Ray for Rhino interpret the safe frame.

            In Grasshopper if you render a square image it will take the width of the viewport and make a square view using that
            This is expected. The V-Ray Render component's 'Output Res' input requires a pair of integers for width and height. If you wish to control both height and width with a single input to get a 1:1 output size ratio, simply run that input through a sequence component of your choice and set the length or count to 2.
            Alternatively, if you wish to control only the height value and achieve a predetermined output size ratio, run that number input through a Multiplication operator to get the desired width and plug the result as a first value in the 'Output Res' input, then plug the original height value input second, e.g:
            Click image for larger version

Name:	simplest_aspect_ratio_calculator_based_on_height.png
Views:	521
Size:	30.3 KB
ID:	1088604

            I'll forward this thread to our dev team to discuss the necessity to improve this control or perhaps add a more obvious way to control the image width/height ratio.

            Kind regards,
            Peter
            Last edited by Peter.Chaushev; 19-10-2020, 09:34 AM.
            Peter Chaushev
            V-Ray for SketchUp | V-Ray for Rhino | Product Owner
            www.chaos.com

            Comment


            • #7
              Peter.Chaushev how to set the resolution is not the problem and is pretty obvious. The problem is related to the actual viewport you are trying to render and what happens if what you want to render has a DIFFERENT aspect ratio then the viewport/view you are rendering.

              Rhino interprets it as always fitting the output INTO the viewport. Grasshopper always interprets it as FILLING the viewport (and rendering parts that are outside the Rhino viewport as well.

              Also, I think it would be great if you could choose WHICH viewport or named view to render in Rhino and in Grasshopper. Its already possible in the Batch Renderer, so why not the normal renderer. It could default to "Selected viewport", but it should be possible to have it fixed on a different view.

              Lastly, related to this: how can I see/edit/clear the camera animation that you export from GH? I can't find that anywhere!?
              Last edited by seltzdesign; 20-10-2020, 03:28 AM.

              Comment


              • #8
                Originally posted by georgi.georgiev View Post
                Basically, Grasshopper takes the Rhino viewport as it is and disregards safe frames which are established on the bases of NeUI's render output. If you use the Match Viewport aspect ratio, you should get the same result in Rhino and Grasshopper
                georgi.georgiev just coming back to this. The weird thing is that if I set my viewport to square its still not correct. There is definitely some calculation going on in the way it gets the view when rendering in Grasshopper that is different to how it does it in Rhino.

                After a lot of experimentation I have come across the error. It is in the way that you calculate the camera view from the V-Ray Camera component. Since for some reason you decided to use FOV instead of Lens Length, which is how you specify a camera in Rhino, you have to calculate the FOV based on the vertical angle and assuming a normal sensor format of 3:2. Not so easy to figure that one out.

                In case anyone ever needs to do the conversion in GH, its:

                Click image for larger version

Name:	lense_length_to_FOV.jpg
Views:	387
Size:	90.1 KB
ID:	1110048
                Last edited by seltzdesign; 08-04-2021, 04:15 AM.

                Comment

                Working...
                X