ggarra13 / mrv2

Professional player and review tool for vfx, animation and computer graphics.
https://mrv2.sourceforge.io
BSD 3-Clause "New" or "Revised" License
197 stars 14 forks source link

Preview in DCC 3D Programs ? #169

Closed SheepDomination closed 6 months ago

SheepDomination commented 9 months ago

Is it possible to take a 3D DCC app and have it's previews sent to mrv2 ? For example, Maya / Houdini all preview renders or even USD could be sent to mrv2.

ggarra13 commented 9 months ago

Maya, last time I checked, does not provide an API for sending it (the original mrViewer supported outputing from mental ray, but I had to beg and partially reverse engineer the protocol). Houdini, I've never tried. USD can be supported through Hydra, albeit it is still a work in progress.

SheepDomination commented 9 months ago

Maya, last time I checked, does not provide an API for sending it (the original mrViewer supported outputing from mental ray, but I had to beg and partially reverse engineer the protocol). Houdini, I've never tried. USD can be supported through Hydra, albeit the only renderer that seems to be prepared for supporting that now is 3Delight, which seems to have a very nice API for doing so.

How would one do it with Houdini ? Are you saying that one can send a USD scene with a Hydra render to MRV2; the only problem is restricted with 3Delight, I would like Octane / Renderman support.

ggarra13 commented 9 months ago

How would one do it with Houdini ? Are you saying that one can send a USD scene with a Hydra render to MRV2; the only problem is restricted with 3Delight, I would like Octane / Renderman support.

Sorry. I was not clear and I got confused myself.

You can currently send an .usd scene to mrv2 for rendering (with or without animation), but it will render it with OpenGL only and from the POV of the default camera. It does not have an Hydra backend support yet. Darby Johnston was responsible for implementing the USD OpenGL backend.

If we add Hydra support into mrv2, it should be possible to use any of the current renderers, but you would have to install manually the Hydra third-party plugin (usually called render delegates) for your renderer of choice, which, at this point in time, it means compiling it from source. Prman, 3Delight, Omniverse, Cycles, Solaris, moonray and Arnold offer such plugins among others. I don't think Octane does yet. UPDATE: Octane seems like it was bought by NVidia and merged into Omniverse.

Even if we add Hydra support into mrv2, you would be limited in what you can do with it. You would still need the DCC application to change materials, move or animate objects again, etc. Once renderers become real-time as Unreal, hooking Hydra will then become more attractive.

Supporting Hydra with USD is kind of a pain as USD is kind of in flux and uses a mix of very outdated libraries, together with some cutting edge ones. It also takes more than 25 minutes to build on my 16 cpu machine. The USD API is great, but the Hydra implementation is a piece of s***, as the demos are all based on python (aaargh!), boost (aaargh!), TBB(aargh!), cutting edge Qt6 (aargh!) or older version of Qt5 (aargh!), which means it breaks on each release and is not fully compatible with modern distros like Ubuntu 22.04.

3Delight has an outdated Hydra backend but offers an alternative to USD api called NSI, which has partial plugins in all DCCs, it is free to use and link and does NOT depend on Python. I personally like that approach much better, but it is only used and supported by 3Delight, unfortunately, very much like mental ray in the past.

SheepDomination commented 9 months ago

I wasn't aware that nVidia bought Octane. Therefore it should not be impossible for Octane if now owned by nVidia to be integrated ? There is alot of praise for 3Delight, the render is not new to me, as I've heard of it many years ago. From my knowledge it was comparable to Renderman and it was also praised for its displacement speed if that is still relevant in recent versions is unknown to me.

For me OpenGL support MRV2 is fine, although full Hydra render in MRV2 would be great but at this time that is only with one render engine.

How do I send a USD scene to MRV2 though Houdini without having to load it manually ?

ggarra13 commented 9 months ago

Therefore it should not be impossible for Octane if now owned by nVidia to be integrated ?

Not likely. Its future will likely be like that of mental ray/iray. Kill it and merge the best parts of its source code or logic into Omniverse.

For me OpenGL support MRV2 is fine, although full Hydra render in MRV2 would be great but at this time that is only with one render engine.

I am afraid you will find mrv2's support still disappointing. It is barely better than the usdview utility that comes with the USD distribution. Here's an example of how the ALab scene looks in mrv2 --no textures, thou-- (actually I just opened it again and noticed that with the new USD release it looks overblown with lights and much worse than before):

ALab

And here's how it looks in the original Animal Logic's Glimpse renderer: LoopySequence02

How do I send a USD scene to MRV2 though Houdini without having to load it manually ?

USD does not support any sort of networking or piping mechanism (that's where Hydra would come in), so the best you can currently do is save out an .usd (USD binary compressed) file from Houdini, and I'm pretty sure it would allow you to run a python script from inside Houdini to call os.system("mrv2 myanim.usd").

NVidia with Omniverse and Unreal are working, at least from I gather on demos I see, on supporting USD through the internet, by sending .usd files instead of the inferior Khronos' gltf format that Meta has invested in. The idea of Omniverse and Unreal is that you will get full-raytracing, real-time through the network allowing for games and VR on a global scale (ie. imagine every gamer having an NVidia raytracing card to play the latest game or for Googlemaps to be rendered also with raytraced usd cities). NVidia has a really smart strategy, but the costs and current internet speeds make it still prohibitive.

EDITED: I confused .otioz files with binary .usd files in the post. Sorry. Actually, I don't think I am the only one. Apple's USD docs refer to binary usd files as usdz too.

ggarra13 commented 9 months ago

Here's a tutorial on how to import/export USD in houdini, albeit it does not show how to automate it with a script:

https://openusd.org/release/tut_houdini_example.html