Skip to content

Instantly share code, notes, and snippets.

View demonixis's full-sized avatar

Yannick Comte demonixis

View GitHub Profile
@demonixis
demonixis / Deploy-itch.sh
Last active August 12, 2023 10:23
Itch.io deploy script using Butler for DVR Simulator
#!/bin/bash
readonly ITCH_GAME_URL="$ITCH_USER/$ITCH_GAME"
readonly FOLDER_NAME="DVR-Simulator"
readonly GAME_NAME="DVR Simulator"
readonly BUTLER_PATH="../__Tools__/Butler/Butler.exe"
echo "Itch.io deployer for $GAME_NAME"
echo "Available targets: ue5, win64, win64-trial, linux, linux-trial, osx, osx-trial, quest, quest-trial, android, all, standalone"
read -p "Version: " gameVersion
@demonixis
demonixis / EnableOpenXR.gd
Created May 23, 2023 09:04
Enable XR in Godot 4 project
extends Node3D
var interface : XRInterface
func _ready() -> void
interface = XRServer.find_interface("OpenXR")
if interface and interface.is_initialized():
get_viewport().use_xr = true

How to setup OpenXR

Basic Setup

  1. Start menu > Run
  2. Type regedit
  3. Locate HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenXR\1
  4. On the ActiveRuntime key

Oculus

  1. Set C:\Program Files\Oculus\Support\oculus-runtime\oculus_openxr_64.json for Oculus (CV1, S, Link)
@demonixis
demonixis / XRSubSystemTest.cs
Created January 13, 2020 13:28
A demonstration of how to use the all new XRSubsystem with Unity 2019.3+
using UnityEngine;
using UnityEngine.XR;
using UnityEngine.XR.Management;
public class XRSubSystemTest : MonoBehaviour
{
public void Start()
{
var xrSettings = XRGeneralSettings.Instance;
if (xrSettings == null)
@demonixis
demonixis / RudderVirtualDevice.cs
Created February 21, 2018 15:03
An input driver for InControl using the 3DRudder controller.
using InControl;
using ns3DRudder;
using Unity3DRudder;
using UnityEngine;
namespace Demonixis.MarsExtraction.Inputs
{
public class RudderVirtualDevice : InputDevice
{
private Axis m_Axis;
@demonixis
demonixis / FXAA-SPS.shader
Created December 14, 2017 17:03
An attempt to make this FXAA shader compatible with Single pass Stereo Rendering
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Hidden/FXAA3" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Pass {
ZTest Always Cull Off ZWrite Off
@demonixis
demonixis / PostProcessUWPShim.cs
Last active November 29, 2018 17:27
This WIP shim allows you to build the PostProcess Stack V2 for Unity with the Universal Windows Platform target. But before you have to add a little change in the `PostProcessEffectSettings.cs`. Please read the first comment.
#if !UNITY_EDITOR && UNITY_WSA
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
/*
You've to edit the file PostProcessEffectSettings.cs (~ line 27) and add a preprocessor instruction
@demonixis
demonixis / AsyncProcessTest.cs
Created August 31, 2017 14:13
Implementation example of a Task with C# 5+
using System;
using System.Threading.Tasks;
namespace ConsoleApp1
{
public class AsyncProcessTest
{
// This function is going to start an expensive process.
// Thanks to async/await the main Thread will not be blocked!
public async void Initialize()
@demonixis
demonixis / WindowsMixedRealityService.cs
Last active September 14, 2017 15:34
The service I use in GunSpinningVR to detect controllers availability. `GunController` is the object responsible to controll guns and `UnityVRController` is the object responsible to update position/rotation/button states.
using UnityEngine;
#if UNITY_WSA
using UnityEngine.XR.WSA.Input;
#endif
namespace Demonixis.GunSpinningVR.Controllers
{
public sealed class WindowsMixedRealityService : MonoBehaviour
{
#if UNITY_WSA