microsoft / microsoft/MixedReality-GraphicsTools-Unity

Box projection for reflection probes

Open
#54 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue
Dominant language
C#
Stars
209
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Original issue: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/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

Contributor guide

No contributing guide indexed for this repository

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 locating the MRTK standard shader and its use of UnityStandardUtils, then compare the reflection-probe path with the BoxProjectedCubemapDirection example linked in the issue. Done means box projection works for reflection probes in the MRTK standard shader, with the relevant shader behavior verified on reflective surfaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
unity
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.