This file contains hidden or 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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class MatricesDemo : MonoBehaviour | |
{ | |
static Vector4 vert0 = new Vector4(0.0f, 0.0f, 0.0f, 1.0f); | |
static Vector4 vert1 = new Vector4(10.0f, 0.0f, 0.0f, 1.0f); | |
static Vector4 vert2 = new Vector4(0.0f, 10.0f, 0.0f, 1.0f); |
This file contains hidden or 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
static Vector4 vert0 = new Vector4(0.0f, 0.0f, 0.0f, 1.0f); | |
static Vector4 vert1 = new Vector4(10.0f, 0.0f, 0.0f, 1.0f); | |
static Vector4 vert2 = new Vector4(0.0f, 10.0f, 0.0f, 1.0f); | |
static Vector4[] listVert = new Vector4[4]; |
This file contains hidden or 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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class MatricesDemo : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ |
This file contains hidden or 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
Gizmos.DrawCube(listVert[i], new Vector3(sizeOfCube, sizeOfCube, sizeOfCube)); |
This file contains hidden or 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; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class SimpleDemo : MonoBehaviour | |
{ | |
public float sizeOfCube = 1.0f; | |
public Vector3 scaling = new Vector3(); | |
public Vector3 translate = new Vector3(); |
This file contains hidden or 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
void mainImage( out vec4 fragColor, in vec2 fragCoord ) | |
{ | |
vec3 outColDebug = vec3(0.0f); | |
vec2 uv = (fragCoord-.5 * iResolution.xy)/iResolution.y; | |
fragColor = vec4(outColDebug,1.0); | |
} |
This file contains hidden or 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
vec2 rotate(vec2 pos, float angle) | |
{ | |
float c = cos(angle); | |
float s = sin(angle); | |
return mat2(c,s,-s,c) * pos; | |
} | |
mat2 Rot(float a) { |
This file contains hidden or 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
kernel UVmap : ImageComputationKernel<ePixelWise> | |
{ | |
Image<eRead,eAccessRandom, eEdgeClamped> src; //I | |
Image<eWrite> dst; //O | |
local: | |
float width; | |
float height; | |
void init() { | |
width = src.bounds.x2; //function to find right edge |
This file contains hidden or 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
struct RMstruct | |
{ | |
float RMSphere(float3 pos) | |
{ | |
return length(pos) - 25; | |
} | |
float3 RMNormal(float3 pos) |
This file contains hidden or 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
/* SDF */ | |
float sdSphere( vec3 p, float s ) | |
{ | |
return length(p)-s; | |
} | |
float sdBox( vec3 p, vec3 b ) | |
{ | |
vec3 q = abs(p) - b; |