This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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() |
NewerOlder