Skip to content

Commit

Permalink
fix(render): disable outline shader draw
Browse files Browse the repository at this point in the history
The shader does not work in vr. Disabled for now.
  • Loading branch information
Xenira committed Dec 3, 2023
1 parent dd579c9 commit 13f3231
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
1 change: 1 addition & 0 deletions plugin/src/Patch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void Start()
new QuestTaskListPatch(),
new InventoryAndCraftingPatch(),
new DialoguePopupPatch(),
new DisableComponentPatch<OutlinePostProcess>(),
]).ToArray();

Debug.Log("Hello World!");
Expand Down
22 changes: 22 additions & 0 deletions plugin/src/camera/patch/outline_shader_patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using HarmonyLib;
using UnityEngine;

namespace TechtonicaVR.VRCamera.Patch;

[HarmonyPatch]
public static class OutlineShaderPatch
{
[HarmonyPatch(typeof(OutlinePostProcess), nameof(OutlinePostProcess.SetTargetOutlineable), [typeof(bool)])]
[HarmonyPrefix]
public static bool StartPostfix()
{
return false;
}

[HarmonyPatch(typeof(OutlinePostProcess), nameof(OutlinePostProcess.SetTargetOutlineable), [typeof(IStreamedMachineInstance), typeof(bool), typeof(bool)])]
[HarmonyPrefix]
public static bool StartPostfixOverload()
{
return false;
}
}
14 changes: 14 additions & 0 deletions plugin/src/patch/universal/disable_component_patch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using UnityEngine;

namespace TechtonicaVR.Patches.Universal;

public class DisableComponentPatch<T> : GameComponentPatch<T> where T : MonoBehaviour
{
private bool applied = false;

protected override bool Apply(T component)
{
component.enabled = false;
return true;
}
}
1 change: 0 additions & 1 deletion plugin/src/patch/universal/disable_on_component_patch.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using UnityEngine;

namespace TechtonicaVR.Patches.Universal;
Expand Down

0 comments on commit 13f3231

Please sign in to comment.