Better use of viewport ZBuffer functionality please

Hi,

I find the current state of ShowZBuffer a kind of ‘tease’ command that lets me imagine and wish for a whole range of good uses but none of them is possible now due to one limitation.
We would like to be able to set the Min-Max distance range for camera, and not one that is currently based on varying view objects scene bounding box. That would turn it into a really useful one. If making UI for it is too much, maybe a simple command line input for distance range would do? @jeff - is that control already possible but not exposed with the display pipeline?

Having that implemented I would also expect the larger-than-screen screencaptures on ZBuffer would be no longer ‘tiled’ as it currently is.

In a long run I also wish for a ‘fog’ addition for display modes - overlaying Zbuffer depth on regular display for better depth perception. Very common in various 3D software packages.

Thanks!

-jarek

Hi @Jarek,

No control exists to adjust the physical near and far clipping planes…It’s been on the todo list for a long time but just hasn’t found its way to the top… However, I don’t believe this will fix any of the tiling seams…but maybe…won’t really know until it’s tried. I’ve already got in place a way to tell Rhino what the near and far values are (which was an attempt to fix the tiling seams), but it didn’t work. Apparently even having two adjacent viewports using the exact same near and far values still does not generate the exact same z-values along the seam(s).

It was not my intention to “tease” anyone with the ShowZBuffer command…It started out as a debugging tool I made and used when working on the real time shadows architecture…Somehow the test command got leaked, which eventually caused it to become a real command due to its popularity. My point? It’s initial design was for viewport only, WYSIWYG output, and it was never meant to be used to capture huge (larger than physical monitor size) resolutions. In order to do that, I think a completely new, more robust design is in order.

Thanks,
-Jeff

Hi @jeff,

Thanks for the explanation. If you already have the min-max control working, it would be fantastic to have it exposed in some way, even crude testcommand,… before more fancy UI and more controls come along. We would make use of it daily! With 4K monitors you can get nice results just with screen-size screenshots…

For the larger-than-screen viewcaptures tiling - sounds odd that this does not fix it but obviously it all depends on how the captures are created ‘under the hood’. I guess the camera is moving in original camera plane to cover each ‘tile’ of the hi-res screen. In that case, if min-max zbuffer is calculated as distance from camera point, then we would get tiling. But if it is calculated as distance from ‘camera plane’ then it should not (if camera moves only within its plane). I may be totally wrong on this one ; )

In a long run, do you see any chance of having a ‘fog’ as a part of the display mode settings ? (with control of color, intensity and min-max distance…)

Thanks,

–jarek

1 Like

Is there a way to do this yet (set min/max?)? As a workaround I can of course just scale something in Z, for the time being, with the help of some other topics for constraining a square viewport and SetZoomExtentsBorder to 1 in parallel, I can get a nice result. With some help from Illustrator.

I’ve made a little command that can help you achieve part of what you’re looking for:


ZBuffer.rhp (43.5 KB)
2 Likes

Will it work with WiP?

Yes, It works.

Hi @Mahdiyar,

Thanks for sharing the plugin - looks interesting but on my end (Rhino 6 latest SR) it doesn’t work.
The command runs but nothing happens. Is there anything to try to make it work?
Does your plugin allow for high-resolution Zbuffer captures?

Also I am curious how did you make it work, are you using any of this:
https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Display_ZBufferCapture.htm

Best,

–jarek

  • Sorry to hear that I’m not sure what the problem is. I’m using Rhino 6 latest SR too.
  • unfortunately no.
  • Yes, I’m using ‘ZBufferCapture’ class. if you’re interested here I’ve attached my code.
    ZBuffer.zip (5.8 MB)

Hi @Mahdiyar,

thanks for sharing your plugin code! I only do scripting but should be able to distill how you are using the ZBuffer Min-Max settings from there. Very helpful…

Would you ever consider adding custom-resolution zbuffer captures to your plugin ?

cheers,

–jarek

Hi @jeff Jeff, would you consider exposing the Min-Max settings for ZBuffer, even as a test command, in V7? Being able to control this along with hi-res ZBuffer captures that now work without tiling effect would be very powerful.

–jarek