Giter Club home page Giter Club logo

mixedreality-graphicstools-unity's Introduction

MRTK

What is Graphics Tools?

MRTK Graphics Tools for Unity is a Unity engine package with code, shaders, assets, and samples created to help improve the visual fidelity of mixed reality applications while staying within performance budgets.

Graphics Tools

Getting started with Graphics Tools

Graphics Tools is normally ingested as a Unity package. To import Graphics Tools into your Unity project follow the below steps:

Note

The Graphics Tools package requires Unity 2021.3 and above.

  1. Open your Unity project and select Window > Package Manager from the file menu bar

  2. Click the '+' icon within the Package Manager and select "Add package from git URL..."

    Package Manager Add

  3. Paste https://github.com/microsoft/MixedReality-GraphicsTools-Unity.git?path=/com.microsoft.mrtk.graphicstools.unity#v0.4.0 into the text field and click "Add"

    Package Manager Paste

  4. Graphics Tools will now be installed within your Unity project as an immutable package within the project's Packages folder named MRTK Graphics Tools.

It is advised you use a specific release of the Graphics Tools package to ensure your project is locked to a stable release. Release version 0.4.0 is suggested in step three above. You can also pull another version, specific branch, or git commit hash by altering the URL as demonstrated below:

Syntax URL example
Specific version https://github.com/microsoft/MixedReality-GraphicsTools-Unity.git?path=/com.microsoft.mrtk.graphicstools.unity#vX.Y.Z
Specific branch https://github.com/microsoft/MixedReality-GraphicsTools-Unity.git?path=/com.microsoft.mrtk.graphicstools.unity#my_branch
Git commit hash https://github.com/microsoft/MixedReality-GraphicsTools-Unity.git?path=/com.microsoft.mrtk.graphicstools.unity#badc0ffee0ddf00ddead10cc8badf00d1badb002

Documentation

Documentation can be found on Microsoft's technical documentation website.

Documentation Category Link
Conceptual MRTK Unity
API Reference Microsoft.MixedReality.GraphicsTools

Importing samples

To view the samples contained within Graphics Tools select Window > Package Manager from the Unity file menu bar. Click on the MRTK Graphics Tools package and expand the Samples list. Finally, click the Import button for any samples you would like to try:

Package Manager Samples

Example project

A Unity project named GraphicsToolsUnityProject lives at the root of this repository. The project serves as sandbox to test and validate the Graphics Tools package. This project can also assist in developing contributions to this repo. See below to learn more about contributing.

Tip

See GraphicsToolsUnityProject/ProjectSettings/ProjectVersion.txt to inspect the Unity version used for the example project.

Feedback and contributions

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Updating the package samples

Samples exist under the Samples~ subfolder as outlined by Unity's sample recommendations. The '~' character prevents the Samples~ folder for being imported by Unity.

If you wish to contribute changes to the samples you must make a temporary local change to the Unity project's directory structure.

  1. Open the GraphicsToolsUnityProject in Unity. The Samples folder will not be visible in the MRTK Graphics Tools package by default. To show the samples select Window > Graphics Tools > Show Samples from the file menu bar.
  2. Make any desired changes to the samples.
  3. Important: When finished and before committing your changes, remember to hide the samples. Select Window > Graphics Tools > Hide Samples from the file menu bar.

License agreement

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

mixedreality-graphicstools-unity's People

Contributors

amollis avatar breezinstein avatar cameron-micka avatar chuksok avatar cimiox avatar holomoto avatar jverral avatar keveleigh avatar palmerdesigns avatar pinkwerks avatar railboy avatar scm2217 avatar shaynie avatar species521 avatar tayomadein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mixedreality-graphicstools-unity's Issues

Mesh tiling and combining utilities

Describe the problem

Many projects require meshes be combined or split up (into tiles) for performance reasons. Writing code to do this can be a burden for developers.

Describe the solution you'd like

Provide scripts and processes to combine meshes (and materials) as well as split up large meshes into tiles which can be shown/hidden based on viewing perspective.

Describe alternatives you've considered

Don't provide these tools.

Additional context

See @Cameron-Micka for MeshTiler and MeshCombiner examples.

Material versioning to avoid breaking changes

Describe the problem

Graphics Tools is used by a bunch of projects that cannot take breaking changes but would like new features and improved workflows. To adopt this, we need a smarter material upgrade system.

Describe the solution you'd like

One way to achieve this is to build a similar system to what is found in Unity's SRP MaterialPostprocessor.

Describe alternatives you've considered

None at the moment.

Additional context

With a solution like this we can run special logic when a project updates the Graphics Tools package to also update the materials.

Improved backplate edge smoothing docs

Describe the issue

Need to document when and why to enable edge smoothing for backplates.

Feature area

Missing nuances between when and how edge smoothing works for backplates on various endpoints.

Existing doc link

https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/mrtk3-graphicstools/architecture/mrdl-mrgt#back-plate

Additional context

When smooth edges are enabled, the backplate should be alpha blended unless the display treats black as transparent.

Interactive documentation examples (using web technologies)

Describe the problem

This is a stretch goal, but our docs have always tried to represent 3D concepts in 2D. How amazing would it be if our docs contained BabylonJS or WebGL frames that display Graphics Tools components and concepts in 3D?

Describe the solution you'd like

Investigate, if possible, in markdown to embed BabylonJS frames. And if it is possible, place one as an example in our docs (this page might be a great first place to demo this functionality). We can then populate other examples in docs as appropriate.

For example, being able to rotate a backplate in 3D:
image

Or expand a buttons components in 3D?
image

Describe alternatives you've considered

n/a

Additional context

BabylonJS is a great place to start since we want to evolve that technology. WebGL is another option: https://microsoft.github.io/MixedReality-GraphicsTools-Unity/

Re-think gradient application to base and stroke

Describe the problem

Right now, the Graphics Tools/Standard and Graphics Tools/Standard Canvas shaders apply base colors/gradients and strokes (border lights) using paradigms convenient to HoloLens 1 and 2 but are not very flexible.

Describe the solution you'd like

We should spend some time to reevaluate how base colors and stokes are selected/enabled/disabled. This will take some refactoring of the shader code and inspector. This might even be a good opportunity to add shader graph nodes for these effects.

Describe alternatives you've considered

Live with the existing workflow.

Additional context

See how stoke gradients are currently hidden in the UI:
image

Easy-to-read documentation in Japanese

Describe the issue

I love the MRGT project.
When I look up information, I read the Microsoft Docs documentation, but as far as I can tell, the Japanese documentation is often machine-translated, and some of the expressions, phrasing, and grammar are difficult to read.
Also, for example, proper nouns and words that should be expressed in katakana, such as file names, have been forcibly translated into Japanese.

branch => ブランチ○ 分岐×(It is correct as Japanese "word" translate, but not used in developer word.)

In some cases, it is easier to understand by reading the original English documentation.

I will create documentation with the correct Japanese language and intent so that it is easy to read for other Japanese developers.

Feature area

・Examples of correct but not appropriate translations

"資産 フォルダー"× "アセットフォルダー" or "Assets フォルダー"○

・Example of unstable notation git Git

Failing to invoke the Window > Graphics Tools > Hide Samples menu item after editing samples will result in git thinking all sample files have changed. Once samples are hidden the actual files changed should be apparent in git.

スクリーンショット 2022-07-08 185054

Existing doc link

For example, with respect to documentation of contributions

https://docs.microsoft.com/ja-jp/windows/mixed-reality/mrtk-unity/mrtk3-graphicstools/contributing

image

The word clone is translated as "複製" which is similar in nuance to Duplicate.
Clone should be written in katakana as "クローン"(clone).

The following is a modification to make it easier to understand with these intentions.

From these, can fix the document as follows, as an example for clarity.

1.リポジトリをフォークし、ブランチを作成します。ブランチのネーミングはuser/username/featureの形を推奨しています。

2.GraphicsToolsUnityProjectのサンプルプロジェクトをUnityでクローンして開きます。

3.必要な変更を加えます。デフォルトでは、MRTK Graphics Tools パッケージ内のすべての編集は、Graphics Toolsパッケージに公開されます。(サンプルを更新したい場合は、以下のセクションを参照してください)。

4.あなたのブランチをあなたのフォークにプッシュし、プルリクエストを作成します。プルリクエストに変更点の説明を追加してください。画像やGIFの使用は歓迎されます。

Additional context

I have share other community members in Japan about MRGT: "It's useful!" URP and build-ins are all in one package! You can use it for projects other than HoloLens! I introduced MRGT to other community members in Japan, and some developers were interested in it.

I am sure that correct documentation in Japanese will help not only myself but also many other developers.

The documentation can be found in the docs branch of mrtk!
If MRGTTeam geve me OK to work on it .
I would appreciate it if you could let me know where I can contribute the Japanese documentation.

Provide new 3D models

Describe the problem

Some 3D models in the MRGT (also the MRTK) live in the packages for several years now. New models would visualize the progress being made in the packages and might even be nicer to look, e.g. the Outline scene.

Describe the solution you'd like

Create a set of new 3D models that fit well the scene, aren't too prominent but emphasize the purpose of the scene.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Solve 'self overlap' with transparent 3D objects

Describe the problem

Usually semitransparent shaders do not write into the depth buffer. However, this can create draw order problems, especially with complex non-convex meshes. If you want to fade in & out meshes like that, then using a shader that fills in the depth buffer before rendering transparency might be useful.

image

Semitransparent object; left: standard Transparent/Diffuse shader; right: shader that writes to depth buffer.

Describe the solution you'd like

Unity recomends a solution like below: https://docs.unity3d.com/2017.2/Documentation/Manual/SL-CullAndDepth.html

Shader "Transparent/Diffuse ZWrite" {
Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}
SubShader {
    Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
    LOD 200

    // extra pass that renders to depth buffer only
    Pass {
        ZWrite On
        ColorMask 0
    }

    // paste in forward rendering passes from Transparent/Diffuse
    UsePass "Transparent/Diffuse/FORWARD"
}
Fallback "Transparent/VertexLit"
}

But! Multi-pass shaders are not supported by URP. There are some alternatives like using the draw objects render pass with light tags. But we'll need to find a solution that works for both URP and built-in pipelines.

Describe alternatives you've considered

n/a

Additional context

Original issue: microsoft/MixedRealityToolkit-Unity#6285

If adding an extra depth pass we need to ensure it's not enabled by default. This API might be able to do that? But it is still unclear.

Aliasing and artifacts with independent round corners and automatic edge smoothing

Describe the bug

Graphics Tools/Standard shader materials with independent round corners and automatic edge smoothing exhibit aliasing artifacts:

image

To reproduce

Steps to reproduce the behavior:

  1. Create a new material using the Graphics Tools/Standard or Graphics Tools/Standard Canvas shader
  2. Enable Round Corners
  3. Enable Independent Corners
  4. Ensure Edge Smoothing Mode is set to automatic
  5. Set one corner to be a different value than the other coroners (example 0, 3, 3, 3)

Expected behavior

No aliasing on edges and artifact line though center.

Screenshots

image

Your setup

  • Unity Version [e.g. 2020.3.6f1]
  • Graphics Tools Version [e.g. v0.4.8]

Target platform

  • Editor

Additional context

n/a

Box projection for reflection probes

Original issue: microsoft/MixedRealityToolkit-Unity#9150

Describe the problem

Box projection doesn't seem to work on the MRTK standard shaders, which causes really bad reflective surfaces for head mounted displays (especially in rooms)

Describe the solution you'd like

Enable box projection for reflection probes to work with the MRTK standard shader

Describe alternatives you've considered

Writing some custom shader

Additional context

the MRTK/Standard shader does not account for box projection (or reflection probe blending). We should call this out in the docs.

To properly support box projection we need to introduce a call to the BoxProjectedCubemapDirection method within UnityStandardUtils. There is a great example of the changes need on this page: https://catlikecoding.com/unity/tutorials/rendering/part-8/

Thanks @Cameron-Micka I tweaked the shader so the worldReflection parameter reads as follows:

float3 worldReflection = BoxProjectedCubemapDirection(reflect(incident, worldNormal), i.worldPosition, unity_SpecCube0_ProbePosition, unity_SpecCube0_BoxMin, unity_SpecCube0_BoxMax);

I didn't add blending as I didn't need it (yet), so this does the trick so far

Wireframe shader depth offset issues

Original issue: microsoft/MixedRealityToolkit-Unity#8392

Describe the bug

The MRTK Wireframe Shader has artifacts when colliding with other geometries. In Editor and in Build

The rendered sphere looks edgy
image

To reproduce

Steps to reproduce the behavior:

Add a sphere GO
Add a Material with Wireframe Shader from MRTK
Add a cube or plane GO that intersects with the sphere

Expected behavior

The rendered sphere should look round

Additional context

Could be the depth offset values. Not sure the history as to why they default to 50, 100.

Support light masks

Describe the problem

The Graphics Tools/Standard and Graphics Tools/Standard Canvas shaders support Unity directional lights but not their light masks. This doesn't give developers flexibility to light parts of the scene differently. For example light the UI vs the environment differently.

Describe the solution you'd like

The shader should loop though all lights looking for the light which is active for the current layer (aka doesn't have a distanceAttenuation of zero).

Describe alternatives you've considered

Looping though all available lights may prove expensive for mobile stereo devices. As an alternative a custom directional light behavior could be made that can be used rather than the default Unity directional light. The shader GUII would allow the user to choose if they want to use the current Unity directional light or custom directional light.

Additional context

Note light masks are handled differently in URP vs built-in (light lists vs multiple passes). This solution should work with both pipelines.

Iridescence in Standard shader is not recorded correctly with render from PV camera

Original issue: microsoft/MixedRealityToolkit-Unity#9719

Describe the bug

When recording a video on HoloLens 2 with Render From PV Camera enabled the iridescence part of the MRTK Standard shader is not recorded correctly. When Render From PV Camera is disabled the recorded video is as expected.

Expected behavior

When recording with Render From PV Camera enabled I would like to see the same outcome in the recorded video as what a user sees in HoloLens.

Screenshots

Here's a demo in Unity and a recording afterwards (with Render From PV Camera enabled)
https://www.youtube.com/watch?v=3ustSanqxD0

Your setup (please complete the following information)

Unity Version 2019.4.20f
MRTK Version 2.7.0-preview.3

Target platform (please complete the following information)

  • HoloLens 2

Additional context

n/a

CanvasElementMesh.cs does not use vertex colors

Describe the bug

Vertex colors do not appear on CanvasMeshElement when using a mesh and material with vertex colors

To reproduce

  1. Assign a mesh with vertex colors to a CanvasMeshElement.
  2. Assign a material using a vertex enabled shader to the CanvasElementMesh
  3. mesh shows without vertex colors

Target platform

  • Editor

Additional context

Add any other context about the problem here.

Support material changes on CanvasMaterialAnimators

Describe the problem

Right now, when changing a material at runtime, a CanvasMaterialAnimator logs Material swapped after initialization. Animation will not be applied.

Describe the solution you'd like

I'd like to swap material at runtime and have animations still work.

Describe alternatives you've considered

None

Additional context

image

Port Graphics Tools-Unreal's lighting model to Unity

Describe the problem

Would be nice to have the same lighting model from Graphics Tools-Unreal used in Graphics Tools-Unity. It is a lot more accurate than what we currently have for PBR.

Describe the solution you'd like

Use the same GTLighting.ush header in Graphics Tools for Unreal in Unity for consistency and improved PBR support.

Describe alternatives you've considered

Use Unity's PBR lighting methods. Might prove difficult to support in URP and built-in.

Additional context

None.

Port MRDL bounding box to Graphics Tools

Describe the problem

Right now the new MRDL bounding box lives in standard assets package. This shader could live in Graphics Tools with the other MRDL shaders.

Describe the solution you'd like

Move https://github.com/microsoft/MixedRealityToolkit-Unity/blob/mrtk3/com.microsoft.mrtk.standardassets/Shaders/Bounds/Shell_Rounded_Bound.shader and supporting assets to Graphics Tools and create samples/docs.

Describe alternatives you've considered

Keep the shader in the standard assets pacakge.

Additional context

n/a

Check that reflections are correct when rendering in stereo

Original issue: microsoft/MixedRealityToolkit-Unity#8207

Describe the bug

a PBR material using the MRTK Standard Shader with reflections enabled feels right in the Unity Editor (2019.4.4f)
looking throught the Oculus Quest headset however shows that the reflections are being rendered from the same origin point for both eyes. This results in having no depth to the reflection and it looks really weird and wrong.

When previewing using Oculus Link (so running from the PC) the depth does look correct so it's something introduced when building the shaders for mobile (android).

To reproduce

Steps to reproduce the behavior:

Create a VR project for Oculus Quest using Unity 2019.4.4f, Single pass, forward rendering, NO URP
Create a highly reflective MRTK Standard Shader material with or without a channel map.
Create a scene where you have something to reflect of and attach the material.
Build for the Quest and run on device.
Move around the scene and look at the reflection. It feels like something is moving on top of the material instead of a clear reflection both eyes are seeing the same reflecting image and the illusion of reflection is gone. Close one eye and move sideways and you'll see the reflections feels okay again.

Expected behavior

a reflection that looks different for each eye

Screenshots

Very hard to take a screenshot explaining the problem as the quest only allows me to screenshot one eye.

Your setup (please complete the following information)

  • Unity 2019.4.4f
  • Single pass, forward rendering, Standard Rendering Path, No URP.
  • MRTK Version 2.3.0
  • Oculus Utilities

Target platform (please complete the following information)

  • Oculus Quest VR SDK
  • Android

Additional context

Fixed it by adding this to the shader:
Starting on line 987:

#if defined(_NORMAL) || defined(_REFLECTIONS) || defined(_ENVIRONMENT_COLORING)
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
#endif

Better handling of excess proximity lights

Describe the problem

Previously, if the shader's maximum proximity light limit was reached, a warning would be logged. This has been changed in MRTKv2 to keep all lights around on the CPU side and only send the first two valid ones to the shader. This helps with race conditions where multiple lights are added and removed in a single frame and eliminates a warning that was spamming to the log and degrading performance.

Describe the solution you'd like

Port this PR to Graphics Tools: microsoft/MixedRealityToolkit-Unity#10241

Describe alternatives you've considered

Keep behavior as is.

Additional context

None

Sample scene 'Acrylic' improvements

Describe the problem

Improve the acrylic example scene. Adjust placement, add new background elements, etc.

Describe the solution you'd like

Set up scene for Hololens usability

  • camera and environment settings
  • make plates interactable
  • thinning out unnecessary objects/plates in scene

Describe alternatives you've considered

Keep as is.

Additional context

Request from @Species521.

`backplane_curved` import FBX warnings

Describe the bug

ImportFBX Warnings:
Can't import tangents and binormals, because mesh 'backplane_curved' doesn't have any.

To reproduce

Steps to reproduce the behavior:

  1. Clean your temporary files (git clean -xdf)
  2. Open the GraphicsToolsUnityProject
  3. Select Window > Graphics Tools > Show Samples
  4. See warning in console

Expected behavior

No console warnings.

Screenshots

n/a

Your setup (please complete the following information)

  • Unity Version 2021.3.3f1
  • Graphics Tools Version v0.4.0

Target platform (please complete the following information)

  • Editor

Additional context

None

Update the Graphics Tools/Standard AssignNewShaderToMaterial method to auto-migrate URP Lit shaders

Describe the problem

Right now the Graphics Tools/Standard and Graphics Tools/Standard Canvas shader GUIs have logic to auto-migrate shader properties from the Unity/Standard shader and old HoloToolkit/Fast Configurable shader but not the URP/Lit shader.

Describe the solution you'd like

AssignNewShaderToMaterial should be updated to pull properties that can be migrated from URP/Lit.

Describe alternatives you've considered

Live without.

Additional context

None

Environment coloring have local position option

Original issue: microsoft/MixedRealityToolkit-Unity#9768

Describe the problem

Making an environment and using environment coloring to get some cool 'free' (as in no rasterized textures) coloring effects. For example, I set up the scene how I like it from our default position, using the environment coloring to add a slight orange hue on the mesh on the X-axis. This effect at the default position is only viewable along the edges of the viewable space. However, this project has a movable magic window, and as soon as you move the window it moves the environment as well. Moving the window at a 90 degree 'Y' rotation takes my subtle orange hue and cranks it to full orange. For this use case, it makes the feature unpredictable.

Describe the solution you'd like

I would love a local position option, so no matter how much the objects parent rotates, the visuals of the mesh with environment coloring active doesnt change.

Describe alternatives you've considered

n/a

Additional context

n/a

MeshSmoother destroys original mesh

Original issue: microsoft/MixedRealityToolkit-Unity#9307

Describe the bug

I am currently using the MeshSmoother together with the Outline shading using the MRTK2 shader. In our scenario, this needs to be done and undone programatically and leaving the original mesh untoched. It just so happens that when the MeshSmoother component is destroyed, its OnDestroy method wipes out the object mesh and I can't show the original object anymore.

Expected behavior

MeshSmoother.OnDestroy not having the desctructive behavior.

Additional context

I realize that the smoothed normals are written to the UV2 channel and I might as well just keep them until the object is actually destroyed but I don't think the fix I suggested as any downsides and has the upside of being able to safely remove a MeshSmoother component without issues.

Another problem is that you can't use MeshOutlineHierarchy if you want to disable outlines since it can only be destroyed. It doesn't implement OnEnable/OnDisable. My workaround is to disable MeshOutline components instead of destroying them.

Programmatically remove banding with noise

Describe the problem

Banding is present in our texture based iridescence features and gradient features:
image

Describe the solution you'd like

Would be good to have an option in the GT/Standard and GT/Standard Canvas shaders to remove banding via a technique like this: Removing Banding in Linelight | pixelmager.github.io

Means we can use compressed textures and not worry about banding as much.

Describe alternatives you've considered

Use uncompressed textures or deal with banding.

Additional context

Related to: #21

I feel it would be useful if GraphicsToolsShader's Emmision had an EmmisionMap function.

Describe the problem

GraphicsToolsShader has many functions and is very attractive, but it does not currently have an emission map, which many shaders with emission functions, such as URP/LitShader, have.

untitleds2

 I feel that the availability of EmmittionMap allows for more complex and attractive graphics.
 In fact, with the use of external resources such as Holographic Remoting and Azure RemoteRendering, as well as PCVR, HoloLens 2 apps can now use very high definition graphics. I found myself wishing for EmissionMap when using emission for these applications.

 However, if EmmittionMap is not intentionally employed, please teach me know. (load, etc.?)
 currently using ChannelMap to manage this, but we think it would be useful to have EmmittionMap.

Describe the solution you'd like

I want to incorporate an Emmittion Map into Graphics/StandardShader.

Specifically, in GraphicsToolsStandardProgram.hlsl, per line 400 can be implemented by processing the EmissionMap following .

    half3 emission = GTsRGBToLinear(_EmissiveColor.rgb);
   ///emitton Map Process

However, GraphicsTools/StandardShader is managed by "Microsoft.MixedReality.GraphicsTools.Editor.StandardShaderGUI". StandardShaderGUI". I need understand this .

 If this proposal is approved, I will incorporate the functionality and publish a PR while also learning GraphicsTools.

MeshOutline is hard-coded to only work with MeshRenderers

Describe the bug

MeshOutline only works with MeshRenderers, when it doesn't have to. It also works with SkinnedMeshRenderers (and I presume other types of generic Renderers!)

To reproduce

Attempt to add MeshOutline to a skinned mesh.

Expected behavior

Ideally you should be able to use MeshOutline on skinned meshes. I tested with a local fork and it seems fine to replace MeshRenderer with Renderer.

Screenshots

If applicable, add screenshots to help explain your problem.

Your setup (please complete the following information)

  • Unity 2020.3.30f1
  • Graphics Tools 0.3.0

Port the channel packer tool

Describe the problem

The Channel Packer tool found in MRTKv2 is useful for packing textures when access to other tools, like Photoshop, is not available.

Describe the solution you'd like

Move the Channel Packer: Channel Packer Editor + Other Shader Features by Cameron-Micka · Pull Request #3382 · microsoft/MixedRealityToolkit-Unity (github.com) from MRTK v2 to Graphics Tools.

Describe alternatives you've considered

Just use other image authoring tools like Photoshop or Gimp.

Additional context

Related issue: microsoft/MixedRealityToolkit-Unity#8079

Investigate MeshRenderer RectTransform layout that supports traditional batching

Describe the problem

Investigate if it is possible to write a meshrender/shader pair that would play nice with UnityUI rect transforms. This would allow for rect transform layouts and mesh renderer batching.

Describe the solution you'd like

From @Zee2 -

Is there any way to create a meshrenderer shader that will make a quad/etc obey RectTransforms in the way that a Graphic would?

If we could use RT layout, but traditional meshrenderer-like batching, that would be the ideal.

I feel like for 90% of usecases, we don't care at all about the actual Canvas-y features, we really just care about RT layout

Describe alternatives you've considered

Explore other ways to batch 3D UI efficiently.

Additional context

As Unity UI operates entirely in the transparent queue, any quads that have unbatchable quads overlaid atop them must be drawn before the unbatchable quads, and therefore cannot be batched with other quads placed atop the unbatchable quads.

Consider a case of three quads, A, B, and C. Assume all three quads overlap one another, and also assume quads A and C use the same material while quad B uses a separate material. Quad B therefore cannot be batched with A or C.

If the order in the hierarchy (from top to bottom) is A, B, C then A and C cannot be batched, because B must be drawn atop A and beneath C. However, if B is placed before or after the batchable quads, then the batchable quads can actually be batched – B needs only to be drawn before or after the batched quads and does not interpose them.

Source: https://learn.unity.com/tutorial/optimizing-unity-ui

Spatial mesh shaders

Describe the problem

MRTK2 has a few shaders for the spatial mesh that should be ported to Graphics Tools.

Describe the solution you'd like

We should move all shaders and supporting assets/scripts for this feature: https://docs.microsoft.com/en-us/windows/mixed-reality/mrtk-unity/mrtk2/features/rendering/pulse-shader?view=mrtkunity-2022-05 to this repository.

We will also want docs and samples to go along with these features.

Describe alternatives you've considered

We might also want to ensure at minimum these effects are also possible with Graphics Tools: https://github.com/microsoft/MixedReality-GraphicsTools-Unreal/blob/main/Docs/SpatialPerception.md

Additional context

We should check for updated MRDL designs for spatial meshes before proceeding.

Add programmatic iridescence support

Describe the problem

Banding is present in our texture based iridescence feature:
image

Switching to programmatic iridescence gradient look ups would alleviate this issue.

Describe the solution you'd like

Add a new gradient mode to this list which is maybe called "Iridescence Procedural"?

image

Implemented like so from @maluoi -

The sharp edges on the gradient were kinda bothering me, and I finally realized smoothstep was the answer! 😄

Anyhow, I thought I'd share the HLSL shader code I use for the iridescence gradient in StereoKit, in case it's helpful.

Another note here, using an array of float3s for the gradient color is how I'm avoiding banding, that's the ir_gradient variable here.

static const int    ir_gradient_count = 5;
static const float3 ir_gradient[] = { float3(0,0,0), float3(0,0,0),  float3(0.065,0.018,0.429), float3(0,0,0), float3(0.013,  0.117,  0.597), float3(0,0,0) };
float3 GetIridescence(uint view_id, float3 world_pos, float3 surface_normal) {
    float3 dir = normalize(sk_camera_pos[view_id].xyz - world_pos);
    float  ir  = saturate(dot(dir, surface_normal));
    float pct  = ir * ir_gradient_count;
    int   g    = pct;
    pct = smoothstep(0, 1, frac(pct));
    float3 curr = ir_gradient[g];
    float3 next = ir_gradient[g+1];
    return lerp(curr, next, pct);
}

image

Describe alternatives you've considered

Live with the banding or use HDR textures for iridescence.

Additional context

Related to: #22

Create an automated pipeline to push to the MRTK NPM feed

Describe the problem

Right now, NPM packages are created and uploaded locally. This should be done by an automated pipeline.

Describe the solution you'd like

Ideally whenever the package version changes we have an automated pipeline which pushes a new package to the MRTK NPM feed so developers can download the updated package via the MRTK Feature Tool or Unity package manager.

Describe alternatives you've considered

Continue to do this by hand.

Additional context

See David Kline & Kurtis Eveleigh for more details.

Magnify effect for visually impaired people

Describe the problem

Graphics Tools should supply a tool to help magnify the screen in stereo rendering contexts.

image

Describe the solution you'd like

1. Create URP Render Feature to Blit a Zoomed in Frame Buffer in XR

Great starting place for how to do this: How to perform a full screen blit in Single Pass Instanced rendering in XR | Universal RP | 13.1.7 (unity3d.com)

Once you have this working in a simple test scene look at:

2. Create Component to Add & Configure Zoomed In Render Feature

The Unity component should allow end users to configure in the Unity inspector (and at runtime):

  • How much to zoom in by (200% etc.)
  • The output should be a texture users can display in the scene how they see fit

3. Build a Zoom Sample Scene

Add a sample scene to MRGT which shows how to configure the zoom component and display it in the world.

4. Implement Post Processing Options for the Zoom

This will require experimentation on what is feasible. But some initial ones to test:

  • Color inversion
  • Color contrast adjustment
  • Sharpening filters

Ideally these happen in the same shader pass as the zoom (to avoid extra passes) and can be toggle on/off at runtime via the zoom component.

Describe alternatives you've considered

n/a

Additional context

Support for URP only is fine.

Could be similar to the bifocals in SeeingVR: SeeingVR: A Set of Tools to Make Virtual Reality More Accessible to People with Low Vision - Microsoft Research

API reference contribution docs

Describe the issue

Right now, our contribution docs don't specify best practices for writing API docs. Or why API references are helpful and required.

Feature area

All API docs.

Existing doc link

https://docs.microsoft.com/en-us/dotnet/api/Microsoft.MixedReality.GraphicsTools?view=mrtk-graphicstools-unity-dotnet-0.4.0

Additional context

We might want to tell people about Visual Studio commands to help with documentation. For example, typing /// above a class or method automatically formats the comment block.

Graduate the acrylic system out of experimental

Describe the problem

Currently the acrylic system is tagged as experimental but is used by many customers. This feature should be graduated out of experimental.

Describe the solution you'd like

  • Clean up prototype code and features
  • Finalize public API
  • Document public API
  • Refine samples and docs (related #65)
  • Check for performance improvements (for example temporary RTs)

Describe alternatives you've considered

Keep the system experimental.

Additional context

None

Jazz up sample scene 'CanvasShadow'

Describe the problem

The scene might be a little hard to read for new users, also it is generally not much to look at and the documentation is missing

Describe the solution you'd like

Cleaning up the scene, apply descriptive panels and add a doc.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Improved shader graph support

Describe the problem

Graphics Tools supports Unity's Universal Render Pipeline (URP) but does not expose functionality to the new Shader Graph that comes with URP.

Describe the solution you'd like

Graphics Tools should expose a library of common functions for effects it supports via custom shader graph nodes. This will allow users to make more bespoke shaders and effects.

Describe alternatives you've considered

Not use Shader Graph and continue to use the uber shader approach.

Additional context

See Graphics Tools for Unreal for example of how methods are exposed to a shader graph: https://github.com/microsoft/MixedReality-GraphicsTools-Unreal

Instancing best practices

Describe the problem

In URP the SRP Batcher will disabled instancing in most cases. Sometimes instancing outperforms batching when you need to render 100s or 1000s of the same mesh/material. (For example, grass.)

Describe the solution you'd like

The Graphics Tools/Standard shader should include an option to disable the batcher and enable instancing*.

Describe alternatives you've considered

Alternatively show how to render objects with Unity's instancing APIs. See @Cameron-Micka's Performance.Unity project for details about this.

Additional context

*Note, to do this I believe the only way to do this is to conditionally add a "dummy" property outside of the UnityPerMaterial constant buffer.

The non-canvas backplate shader needs alpha blending options

Describe the problem

Right now, the non-canvas backplate shader doesn't have options for alpha blending, whereas the canvas version does.

Describe the solution you'd like

Blending options for the non-canvas version similar to the canvas version.

Describe alternatives you've considered

N/A

Additional context

N/A

Mesh smoothing doesn't work in WebGL

Describe the bug

Mesh smoothing doesn't work in WebGL

To reproduce

Steps to reproduce the behavior:

  1. Build the Material Gallery scene for WebGL
  2. Run build in browser
  3. Note the "Stencil Outline" example looks wrong
  4. See error

Expected behavior

The "Stencil Outline" example looks correct.

Screenshots

Incorrect:
image

Correct:
image

Your setup (please complete the following information)

  • Unity Version 2021.3.3f1
  • Graphics Tools Version v0.4.0

Target platform (please complete the following information)

  • WebGL

Additional context

None

MeshOutline that works with depth sorting

Describe the problem

It would be really neat to be able to use properly sorted depth with a mesh outline, in order to render hands using a nice outline, like so:

image

However, it gets wonky when other objects are involved:

image

Describe the solution you'd like

Out-of-the-box support for mesh outlines that respect depth.

Describe alternatives you've considered

A depth pre-pass/multi-pass shader should be able to do this.

Support dynamic shadow casting and receiving

Describe the problem

The Graphics Tools/Standard shader doesn't have a shadow pass since we often avoid dynamic shadows in mixed reality due to performance constraints. Now that we support other platforms and mixed reality devices are getting more powerful it makes sense to allow the user to enable dynamic shadows if they are aware of the cost.

Describe the solution you'd like

Add directional shadow support like so: https://catlikecoding.com/unity/tutorials/custom-srp/directional-shadows/

We probably don't need to support point and spot shadows since those light sources aren't supported as is.

Describe alternatives you've considered

Stick to static shadows only.

Additional context

Related issue: microsoft/MixedRealityToolkit-Unity#9689

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.