stride3d / stride3d/stride

single-pass-wireframes in shader

Open
#698 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-GameStudio area-Graphics enhancement
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

This is an issue to track a feature I plan to add sometime soon.

The goal is to add Single-Pass Wireframe Rendering to Xenko's shaders, and use that for wireframes in the Studio, instead of 2-pass xray wireframes. Here is an example...

image

Why?

There are many advantages to single-pass wireframes.

  • they are massively faster than 2-pass drawing of LINE primitives
  • they look much nicer
  • they don't have any z-fighting issues, so they can be z-clipped
  • they can support advanced wireframe features, like contrast coloring, or depth-test occlusion coloring
  • automatic back-face line rejection, independent of z-test

The most immediate problem this will fix is the fact that the current x-ray wireframes make placing objects very very confusing. Take a look at two screenshots..

Here is one with a character standing on a surface.

image

Here is one with the character "submerged" up to the waist. The x-ray wireframes make this very hard to see.

image

I'm guessing the current wireframes are x-ray because non-xray 2-pass wireframes have many z-fighting issues, and also it may be advantageous to see the wireframes through objects.

My plan is to add single-pass wireframes to the shader, and add some features, such as:

  • allowing occluded lines to be an alternate (muted) color, or culled
  • contrast-coloring lines (so on yellow objects they will appear black)

Notes:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading WireframePipelineProcessor.cs and RasterizerStates.cs, then trace the Studio integration through WireframeRenderFeature.cs and EditorGameModelSelectionService.cs. Compare the current two-pass x-ray behavior with the linked single-pass wireframe approach. Done means Studio uses single-pass wireframes with the intended depth and occlusion behavior, including the proposed line-color or culling options.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.