Navigation Menu

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 / 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 / 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()
/* Babylon Mesh Component Template */
module PROJECT {
export class Shoot extends BABYLON.MeshComponent {
distance: number;
public constructor(owner: BABYLON.AbstractMesh, scene: BABYLON.Scene, tick: boolean = true, propertyBag: any = {}) {
super(owner, scene, tick, propertyBag);
}
div // weight of 1
#post span // weight of 100 + 1 = 101
<div id="post"><span style="color: #ff0000">Post Text</span></div> // weight of 1000
@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
{