Skip to content

Instantly share code, notes, and snippets.

View orels1's full-sized avatar
🎮
Making the world better, one texel at a time

orels1 orels1

🎮
Making the world better, one texel at a time
View GitHub Profile
// MIT License
//
// Copyright (c) 2022 Haï~ (@vr_hai github.com/hai-vr)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@bgolus
bgolus / MatCapTechniques.shader
Created January 29, 2022 00:37
Showing multiple matcap techniques, including a proposed improved method that's no more expensive than the usual fix if you're starting with the world position and world normal.
Shader "Unlit/MatCap Techniques"
{
Properties
{
[NoScaleOffset] _MatCap ("MatCap", 2D) = "white" {}
[KeywordEnum(ViewSpaceNormal, ViewDirectionCross, ViewDirectionAligned)] _MatCapType ("Matcap UV Type", Float) = 2
}
SubShader
{
Tags { "RenderType"="Opaque" }
@bgolus
bgolus / WorldNormalFromDepthTexture.shader
Last active April 25, 2024 03:51
Different methods for getting World Normal from Depth Texture, without any external script dependencies.
Shader "WorldNormalFromDepthTexture"
{
Properties {
[KeywordEnum(3 Tap, 4 Tap, Improved, Accurate)] _ReconstructionMethod ("Normal Reconstruction Method", Float) = 0
}
SubShader
{
Tags { "RenderType"="Transparent" "Queue"="Transparent" }
LOD 100
@MerlinVR
MerlinVR / GlobalProfileHandler.cs
Last active November 20, 2022 11:08
Basic global profiling scripts for Udon. Throw one of each script on a game object that has a TMP UI text somewhere in its children.
// MIT License
// Copyright (c) 2021 Merlin
using UdonSharp;
using UnityEngine;
[DefaultExecutionOrder(1000000000)]
public class GlobalProfileHandler : UdonSharpBehaviour
{
TMPro.TextMeshProUGUI timeText;
@kaaori
kaaori / TouchAsHip.md
Last active July 16, 2022 21:40
Setup guide for Oculus Touch as Hip Tracker

Oculus Touch as Hip

Hi! As of Sep. 10 2019, you may notice some things are different or broken!! Please be patient as things are adjusted to work with the new SteamVR version (1.7.15)

  • In the meantime, check out this section of the standard Hybrid setup FAQ for a temporary workaround! Thanks<3

NOTE: The software provided from this guide is in an alpha state. Rarely, you may run into bugs or other issues. As this software is not officially supported, please keep any questions or bug reports to the Rift x Vive discord.

Make sure you've followed the tracker setup guide here first if using feet trackers

  1. In the devices tab of the Oculus Client, pair your spare oculus controller as a VR Object: Configure rift
@Split82
Split82 / UnityShadersCheatSheet.shader
Created April 17, 2018 10:07
Unity Shaders Cheat Sheet
Shader "Name" {
Properties {
_Name ("display name", Range (min, max)) = number
_Name ("display name", Float) = number
_Name ("display name", Int) = number
_Name ("display name", Color) = (number,number,number,number)
_Name ("display name", Vector) = (number,number,number,number)
@ekepes
ekepes / ConsoleApplication2.cs
Last active January 8, 2022 05:00
C# implementation of a Linear Congruential Generator (LCG) for psuedorandom number generation
using System;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
var freq = new int[20];
var rng = new RandomNumberGenerator();