Skip to content

Instantly share code, notes, and snippets.

View sorskoot's full-sized avatar
🌷
Developing cool stuff

Sorskoot sorskoot

🌷
Developing cool stuff
View GitHub Profile
@sorskoot
sorskoot / OBS Shader noise glitch.hlsl
Last active November 19, 2023 03:45
OBS Shader noise glitch
uniform float speed;
uniform float amount;
uniform float noiseLevel;
float rand(float co){
return frac(sin(dot(float2(co,co) ,float2(12.9898,78.233))) * 43758.5453);
}
float4 mainImage(VertData v_in) : TARGET
{
@sorskoot
sorskoot / OBS RGB Glitch Shader.hlsl
Last active February 2, 2023 22:23
OBS RGB Glitch shader
uniform float speed;
uniform float stepsize;
uniform float amount;
float4 mainImage(VertData v_in) : TARGET
{
float time = elapsed_time*speed;
float glitch = 0;
if( frac(sin(time) * cos(v_in.uv.y*sin(time*1.45))) > amount) glitch=stepsize;
@sorskoot
sorskoot / flipbook.js
Created April 19, 2022 14:40
Wonderland Component doing Flipbook Animation
class DynamicTextureCache {
constructor() {
this.textures = {};
}
loadTextures(url, columns, rows) {
if (!this.textures.hasOwnProperty(url)) {
this.textures[url] = new Promise((resolve, reject) => { let image = new Image();
let textures = [];
image.src = url;
image.onload = () => {
@sorskoot
sorskoot / ControllerHaptics.js
Last active March 14, 2022 21:29
Example of a Wonderland component that adds Haptic feedback
WL.registerComponent('gun', {}, {
start: function () {
this.input = this.object.getComponent('input');
this.initialized = false;
WL.onXRSessionStart.push((session) => {
if (this.initialized) return;
session.addEventListener('select', (e) => {
if(!this.active) return;
if (e.inputSource.handedness === this.input.handedness) {
@sorskoot
sorskoot / HueShiftShaderOBS.shader
Last active November 30, 2021 02:44
Random Hue shader for OBS ShaderFilter
uniform float speed;
uniform float stepsize;
uniform float shift;
float3 rgb2hsv(float3 c)
{
float4 K = float4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
float4 p = lerp(float4(c.bg, K.wz), float4(c.gb, K.xy), step(c.b, c.g));
float4 q = lerp(float4(p.xyw, c.r), float4(c.r, p.yzx), step(p.x, c.r));
@sorskoot
sorskoot / index.html
Last active June 13, 2021 12:51
From KenShape To WebXR - Demo
<!DOCTYPE html>
<html lang="en">
<head>
<title>From KenShape To WebXR</title>
<script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
</head>
<body>
<a-scene>
@sorskoot
sorskoot / Wonderland.code-snippets
Last active March 27, 2021 20:05
VSCode Code Snippets for Wonderland Engine
{
"component-parameter-enum": {
"body": "${1:name}: {type: WL.Type.Enum, values: ['A','B'], default: 'A'}$0",
"description": "adds a component parameter of type enum",
"scope": "javascript",
"prefix": "wl:param:enum"
},
"component-parameter-float": {
"body": "${1:name}: {type: WL.Type.Float, default: ${2:1.0}}$0",
"description": "adds a component parameter of type float",
@sorskoot
sorskoot / glitch.shader
Created February 6, 2021 09:44
Funny little shader to apply to the camera in OBS using the 'user-defined shader' filter
uniform float speed;
uniform float stepsize;
// Default settings in OBS
// speed: 4.0
// stepsize: 2.0
float rand(float co){
return frac(sin(dot(float2(co,co) ,float2(12.9898,78.233))) * 43758.5453);
}
import * as THREE from 'three';
import { VRButton } from 'three/examples/jsm/webxr/VRButton'
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 0.1, 10 );
camera.position.set( 0, 1.6, 0 );
var renderer = new THREE.WebGLRenderer();
renderer.xr.enabled = true;
renderer.outputEncoding = THREE.sRGBEncoding;
// Creates a prefab at the given path.
// If a prefab already exists it asks if you want to replace it
using UnityEngine;
using UnityEditor;
public class CreateNewPrefab : EditorWindow
{
[MenuItem("Prefab/Create New Prefab")]
static void CreatePrefab()