Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport Renderer for MatchMove #231

Closed
david-cattermole opened this issue Dec 21, 2021 · 6 comments
Closed

Viewport Renderer for MatchMove #231

david-cattermole opened this issue Dec 21, 2021 · 6 comments
Assignees
Labels
enhancement maya plugin Maya API Plug-In (C++) user interface Related to a User Interface (Maya or Qt)
Milestone

Comments

@david-cattermole
Copy link
Owner

Feature

The goal is to add features to the Maya viewport that improve the quality, and the ability to inspect the scene in helpful ways for use of MatchMove tasks.

This renderer will use Maya's viewport 2.0 rendering, but provide a layer (stack)-based system for compositing sets of objects with different shaders/display properties assigned.

Since this is a layer/stack-based system, the order of the Display layers matters and the layers are composited from bottom-to-top, just like in Photoshop or GIMP.

Each Display layer should have some attributes, such as:

  • Blend Mode (Z-Depth, Over, Multiply, Add, etc)
  • Color
  • Opacity/Alpha
  • Display / Shader Override (see below)

Examples of planned Display/Shader overrides are:

  • Wireframe Mode.
  • Shaded Mode.
  • Hidden line Mode.
  • Object Silhouette / Edges.
  • Facing Ratio.
  • "Use Background" shader

All objects in the Display Layer will share the same shader/layer properties.
Each object in the scene can only be in one Display Layer, and therefore is rendered only once.

By default the Blend mode will be "Z-Depth", which would composite the layers based on the Z-depth that is rendered in each, however this can be changed to "Over", "Multiply" or "Add". Using these non-Z-Depth modes would allow users to force some objects to be visible in front of others, even if the depth of the object is physically farther away.
For example, it would be possible to place image planes on the bottom-most layer which forces them to be drawn and composted on-top of, or we could add an object on a front layer and be sure it will always be on-top of a background.

Usage Steps

  1. Switch the Viewport to use the "mmRenderer" renderer.
  2. Create Display Layers and assign objects.
  3. Dynamic attributes are added to the display layers. Users can change the attributes to change how each display layer is rendered.
  4. The viewport updates in realtime. Users can playblast whatever they can see. The system is WYSIWYG.
  5. If the user wishes to disable "mmRenderer" simply change the "renderer" back to Viewport 2.0.

If a user opens the Maya file without mmSolver installed, all display layers will still be visible and will retain all metadata.

Software Versions

  • mmSolver version: v0.4.x
  • Maya version: All supported.
  • Operating System (OS): All supported.
@david-cattermole david-cattermole added enhancement maya plugin Maya API Plug-In (C++) labels Dec 21, 2021
@david-cattermole david-cattermole added this to the v0.4.0 milestone Dec 21, 2021
@david-cattermole david-cattermole self-assigned this Dec 21, 2021
@david-cattermole
Copy link
Owner Author

Current development of this tool has been happening in the vp_renderer.
https://github.com/david-cattermole/mayaMatchMoveSolver/tree/vp_renderer

@david-cattermole david-cattermole added the user interface Related to a User Interface (Maya or Qt) label Dec 21, 2021
david-cattermole added a commit that referenced this issue Jan 30, 2022
On Linux without the NVidia GPU Drivers the shader manager will not
load. This change allows the plug-in to still load, even if the
custom viewport renderer will not work.

Issue #231.
@david-cattermole david-cattermole modified the milestones: v0.4.0, v0.4.3 Nov 6, 2022
@david-cattermole david-cattermole modified the milestones: v0.4.3, v0.4.4, v0.4.5 Jan 29, 2023
@david-cattermole
Copy link
Owner Author

david-cattermole commented Jan 29, 2023

I've been working on this again recently and I have a beta version of MM Renderer that will be released in "v0.4.4.beta1".

The current bugs/limitations are below.

  • Issue The objects in the Display Layer "defaultLayer" are ignored.

    • Workaround: You must create a new Display Layer and add the objects into it.
    • This will be fixed in a later release.
  • Display Layers may not have MM Renderer attributes added.

    • In this beta release Display Layers will have attributes automatically added when the viewport renderer is toggled.
    • Workaround: Set your viewport renderer to Viewport 2.0, then back to "MM Renderer (beta)".
    • This will be fixed in a later release.
  • The Maya HUD is not displayed.

    • This will be fixed in a later release.
  • Performance with many objects and/or Display Layers will reduce the speed of the viewport.

    • This will be fixed in a later release.
  • On Maya 2022.0, you may have some incorrect visuals

    • Workaround: Upgrade to at least Maya 2022.1+
  • "ZDepth" Layer Mode doesn't work.

    • When you have multiple Display Layers in a scene the order of the layers matters. The objects in each layer are rendered and then composited "over" the previous layer - like a Photoshop layer. This is correct when the Layer mode is "Over", but is not currently working as expected with the "ZDepth" layer mode (which should not do that).
    • This will be fixed in a later release.

@david-cattermole
Copy link
Owner Author

In the release v0.4.5.beta1 there are a number of changes to MM Renderer.

The targeted capabilities have been significantly reduced to just support for MM Image Plane nodes to be rendered in the "background", behind objects with the Maya native useBackground shader. This feature is critical and allows users to use MM ImagePlane nodes when rendering "hidden line" effects.

As well as MM ImagePlane supporting the useBackground shader this change also allows any custom plug-in (or shape node) to opt-in for rendering in the "background" by adding the string "imageplane" into the draw classification string that is registered with plugin nodes.

The logic for determining which objects are rendered in the "background" is here:
https://github.com/david-cattermole/mayaMatchMoveSolver/blob/master/src/mmSolver/render/ops/scene_utils.cpp#L75


While developing the other planned features it became clear that the performance overhead is simply not worth the effort and the overall viewport override was becoming increasingly complex and brittle to develop. As a result I have made the plan to postpone the other features such as:

  • Display Layers used as 2D "Photoshop-style" layering effects, including:
    • Layer transparency/alpha
    • Layer display shading mode override.
  • 3D or 2D "Edge" silhouette rendering.

Such features may be added in the future.

@david-cattermole david-cattermole modified the milestones: v0.4.5, v0.5.0 Sep 24, 2023
@david-cattermole
Copy link
Owner Author

A bug in v0.5.0.beta3 is showing that Silhouette rendering is not updating each frame when rendering a playblast, but it updates correctly in the viewport.

From testing in Maya 2024, the current frame used when running the playblast is has correct silhouette rendering, but all others are not updated.
Likewise, the Maya background colour is incorrectly removed after the first frame of the playblast and is replaced with opaque black.

@david-cattermole
Copy link
Owner Author

The above mentioned bugs have been fixed.
The viewport renderer is now working in the develop branch.

This is ready for a v0.5.0-betaX release, and potentially a v0.5.0 release. Lets keep this issue open until the beta testing is finished.

@david-cattermole
Copy link
Owner Author

This has been released in v0.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement maya plugin Maya API Plug-In (C++) user interface Related to a User Interface (Maya or Qt)
Projects
None yet
Development

No branches or pull requests

1 participant