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

Feature DynamicBufferMesh with DrawArgsOption (Indirect Drawing) #682

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

kopffarben
Copy link
Contributor

PR Details

This enables indirect drawing

sponsored by mbox

This PR extends the DynamicBufferMesh node with the option to use a DrawArgsBuffer. This enables a dynamic mesh with a variable DrawCount, which is fully controlled by a ComputeShader.

This is especially important to make the complete compute pipeline of VL.Fuse indirect. Without the need for ugly ReadBacks.

All changes should not break any existing patches, as I have only added features.

HelpPatch

VL.Stride\help\Rendering\HowTo Dynamic Buffer Mesh with Indirect Draw Option.vl

Description

Changes in the source code

I have created two new classes in VL.Stride.Runtime.

  • MeshDrawIndirect
    • which inherits from MeshDraw and adds a DrawArgs buffer.
  • MeshRenderFeature
    • which in turn inherits MeshRenderFeature from Stride
    • there I handle the method Draw(RenderDrawContext context, RenderView renderView, RenderViewStage renderViewStage, int startIndex, int endIndex) a little differently than in Stride, otherwise it is a copy of Stride
    • I make a difference in the DrawCall whether it is a MeshDraw or a MeshDrawIndirect
    • The MeshRenderFeature node is automatically replaced because the new one in VL.Stride.Rendering is automatically referenced in the CompositingNodes

Changes in VL

Customized nodes:

  • DynamicBufferMesh in VL.Stride.Rendering.vl
    • here I have added the option for a DrawArgsBuffer
  • MeshRenderer in VL.Stride.Rendering.vl
    • here, too, the DrawCall distinguishes whether it is a DrawMesh or a MeshDrawIndirect

Added Nodes:

  • DynamicDrawArgsBuffer in VL.Stride.Graphics.vl

Motivation and Context

Make VL.Fuse and VL.Stride more awsome

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant