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

Very poor VP2 performances with point instancers and "Depth Peeling" or "Alpha Cut" #3414

Open
jufrantz opened this issue Oct 25, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jufrantz
Copy link
Contributor

Describe the bug

We notice huge VP2 performance loss on scenes containing large point instancers when switching to Depth Peeling or Alpha Cut transparency.

The issue does not appear when world consolidation is enabled, but we need to disable it in some cases.

Steps to reproduce

  1. Create a mayaUsd proxyShape with 100K point instances.
import random
import pxr.UsdGeom
import maya.cmds
import mayaUsd.ufe
import mayaUsd_createStageWithNewLayer
maya.cmds.loadPlugin("mayaUsdPlugin", quiet=True)

proxyShape = mayaUsd_createStageWithNewLayer.createStageWithNewLayer()
shapeStage = mayaUsd.ufe.getStage(proxyShape)
shapeStage.GetRootLayer().ImportFromString('''#sdf 1
(
    defaultPrim="PI"
)
def PointInstancer "PI"
{
    rel prototypes = [</PI/Protos/Sphere>]
    def Scope "Protos" 
    { 
        def Sphere "Sphere" {}
    }
}
''')

instancer = pxr.UsdGeom.PointInstancer(shapeStage.GetDefaultPrim())
instCount = 100000
instBounds = (-1000.0, 1000.0)
instancer.CreateProtoIndicesAttr().Set([0] * instCount)
instancer.CreatePositionsAttr().Set([ 
    (random.uniform(*instBounds), 0.0, random.uniform(*instBounds)) 
    for i in range(instCount)
])
  1. Disable VP2 consolidation. I beleive it is hiding the issue.
maya.cmds.setAttr("hardwareRenderingGlobals.consolidateWorld", 0)
  1. Draw the scene with default Object Sorting transparency.
maya.cmds.setAttr("hardwareRenderingGlobals.transparencyAlgorithm", 1)
maya.cmds.ogs(traceRenderPipeline=True)
maya.cmds.refresh()
maya.cmds.ogs(traceRenderPipeline=False)
# -- VP2 Trace[modelPanel4][3d Beauty Pass]
# Count for list: [Opaque] = 1
  1. Check VP2 performances:
  • traceRenderPipeline shows a unique (instanced) opaque item.
  • maya profiler shows
    • VP2UpdateScene ≈ 300us
    • VP2Draw3dBeautyPass ≈ 400us
    • VP2ClearRenderLists ≈ 2us
  1. Draw the scene with Depth Peeling transparency (or ALpha Cut)
maya.cmds.setAttr("hardwareRenderingGlobals.transparencyAlgorithm", 3)
maya.cmds.ogs(traceRenderPipeline=True)
maya.cmds.refresh()
maya.cmds.ogs(traceRenderPipeline=False)
# -- VP2 Trace[modelPanel4][3d Beauty Pass]
# Count for list: [Opaque] = 100000
# Count for list: [Opaque] = 100000
  1. Check VP2 performances:
  • traceRenderPipeline shows 100000 (non-instanced) opaque items.
  • maya profiler shows
    • VP2UpdateScene ≈ 120ms
    • VP2Draw3dBeautyPass ≈ 500ms
    • VP2ClearRenderLists ≈ 40ms

Specs (if applicable):

  • CentOS 7.8
  • Maya 2023.3
  • maya-usd 0.25
  • USD 22.11
@jufrantz jufrantz added the bug Something isn't working label Oct 25, 2023
@neilh-adsk neilh-adsk moved this to Needs triage in maya-usd Nov 6, 2023
@github-project-automation github-project-automation bot moved this to Needs triage in Issue Triage Aug 28, 2024
@Autodesk Autodesk deleted a comment from maya-usd-git-sync bot Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs triage
Status: Needs triage
Development

No branches or pull requests

2 participants