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
// Copyright(c) 2019 Nick Klingensmith (@koujaku). All rights reserved. | |
// | |
// This work is licensed under the terms of the MIT license. | |
// For a copy of this license, see < https://opensource.org/licenses/MIT > | |
#pragma once | |
#include <stdio.h> | |
#include <stdint.h> |
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
Shader "Unlit/UnlitShadowed Wavy" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
_SwaySpeed("Sway Speed", float) = .5 | |
_WorldCoherence("Sway Coherence", float) = 0.1 | |
_WindDirection("Wind Direction", Vector) = (1,1,0,0) |
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
// Reference here: http://www.mrao.cam.ac.uk/~dag/CUBEHELIX/ | |
skg_color128_t skg_col_helix128(float h, float s, float l, float alpha) { | |
const float tau = 6.28318f; | |
l = fminf(1,l); | |
float angle = tau * (h+(1/3.f)); | |
float amp = s * l * (1.f - l); | |
float a_cos = cosf(angle); | |
float a_sin = sinf(angle); | |
float r = l + amp * (-0.14861f * a_cos + 1.78277f * a_sin); |
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
#if WINDOWS_UWP | |
using StereoKit; | |
using System; | |
using System.Collections.Generic; | |
using System.Numerics; | |
using Windows.Foundation; | |
using Windows.Perception.Spatial; | |
using Windows.Perception.Spatial.Surfaces; | |
using Windows.Storage.Streams; |
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
Shader "Unlit/Dither Transparent" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_Offset ("Dither Depth Offset", Range(1,100)) = 40 | |
} | |
SubShader { | |
Tags { "RenderType"="Opaque" } | |
LOD 100 |
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
// This demo can be seen in motion here: | |
// https://twitter.com/koujaku/status/1407538105070997504 | |
using StereoKit; | |
using System; | |
class Program { | |
static void Main(string[] args) { | |
// Initialize StereoKit | |
if (!SK.Initialize(new SKSettings { appName = "LerpAnim" })) |
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
//--name = sk/blit/identity | |
//--source = white | |
Texture2D source : register(t0); | |
SamplerState source_s : register(s0); | |
struct vsIn { | |
float4 pos : SV_Position; | |
float2 uv : TEXCOORD0; | |
}; |
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
using System; | |
namespace StereoKit.Framework | |
{ | |
class Camera : IStepper | |
{ | |
public delegate bool IntersectionDelegate(Ray worldRay, out Ray worldIntersection); | |
float _headHeight = 1.5f; | |
float _floor = 0; |
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
using System.Collections.Generic; | |
namespace StereoKit.Framework | |
{ | |
public class StaticScene | |
{ | |
internal List<StaticSceneItem> _items = new List<StaticSceneItem>(); | |
public void AddModel(Model model, Matrix at) | |
{ |
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
namespace StereoKit | |
{ | |
/// <summary>Some utility functions for converting coordinate data to and | |
/// from some commonly used tools! | |
/// | |
/// StereoKit uses a right-handed coordinate system, where +x is to the | |
/// right, +y is upwards, and -z is forward. This is the exact same | |
/// coordinate system as OpenXR, so no conversions are necessary there :) | |
/// | |
/// Unity uses a left-handed coordinate system, where +x is to the right, |
OlderNewer