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 UnityEngine; | |
| [ExecuteAlways] | |
| public class TrackTransform : MonoBehaviour | |
| { | |
| [SerializeField] | |
| private Transform target; | |
| [SerializeField] | |
| private Vector3 positionOffset = Vector3.zero; |
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
| [numthreads(8,8,1)] | |
| void RayMarchKernel (uint3 id : SV_DispatchThreadID) | |
| { | |
| const float2 uv = float2(id.xy) / screenSize.xy; | |
| const float deviceDepth = LoadCameraDepth(id.xy); // This can be omitted if you're just finding rd | |
| const float z = (1.0 - deviceDepth) * 2.0 - 1.0; // [-1, 1] | |
| const float4 clip = float4(uv * 2.0 - 1.0, z, 1.0); // ([-1, 1], [-1, 1], z, 1) | |
| float4 view = mul(cameraInvProj, clip); | |
| view /= view.w; // perspective correction | |
| const float3 depthPosition = mul(cameraToWorld, view).xyz; |
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
| #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. | |
| ; #Warn ; Enable warnings to assist with detecting common errors. | |
| SendMode Input ; Recommended for new scripts due to its superior speed and reliability. | |
| SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. | |
| +CapsLock::CapsLock | |
| CapsLock::Escape |
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
| Shader "FullScreen/CopyColorAndDepth" | |
| { | |
| HLSLINCLUDE | |
| #pragma vertex Vert | |
| #pragma target 4.5 | |
| #pragma only_renderers d3d11 ps4 xboxone vulkan metal switch | |
| #include "Packages/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassCommon.hlsl" |
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 UnityEngine; | |
| public class PolarCharacterController { | |
| [SerializeField] private float moveSpeed; | |
| private PolarCoordinate pc; | |
| public void Awake () { | |
| pc = new PolarCoordinate(transform); | |
| } | |
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
| class LoopyIndex { | |
| private int basement; | |
| private int ceiling; | |
| private int value; | |
| private int initialValue; | |
| public LoopyIndex (int basement, int ceiling, int initialValue) { | |
| this.basement = basement; | |
| this.ceiling = ceiling; | |
| //TODO: Error checking to make sure initialValue is between basement and ceiling. |
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
| // Author : Sébastien Bérubé | |
| // Created : Dec 2014 | |
| // Modified : Feb 2016 | |
| // | |
| // Ice raymarching experiment, built on top of primitives shader from Inigo Quilez : | |
| // https://www.shadertoy.com/view/Xds3zN | |
| // | |
| // You can play with the sliders : 1-Normal map scale | |
| // 2-Isosurface thickness | |
| // 3-Color / refraction normal / other debug stuff |
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
| uniform float _AoStepsize, _AoIntensity; | |
| uniform int _AoIterations; | |
| float AmbientOcclusion(float3 ro, float3 p, float3 re, float3 n) { | |
| float step = _AoStepsize; | |
| float ao = 0.0; | |
| float dist; | |
| for (int i = 1; i <= _AoIterations; i++) { | |
| dist = step * i; | |
| ao += max(0.0,(dist - distanceField(ro, p + n * dist, re).w) / dist); |
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
| #define M_PI 3.1415926535897932384626433832795 | |
| #define M_2PI 6.2831853071795864769252867665590 | |
| #define SKY_R 60.0 // inner radius of sky sphere | |
| #define TRANS_MAT 2.0 // largest material ID for transparent materials | |
| // Many, many thanks to IQ for providing the incredibly helpful sample | |
| // code for getting started with ray marching: https://www.shadertoy.com/view/Xds3zN | |
| precision mediump float; | |
| uniform float time; | |
| uniform vec2 uResolution; |
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
| uniform float4x4 _cubeMatrix; | |
| uniform float3 _cubeScale; | |
| uniform float4x4 _hexagonMatrix; | |
| uniform float _hexagonWidth; | |
| uniform float _hexagonHeight; | |
| float Scene0 (float3 p) { | |
| float res; | |
| float3 cubMat = mul(_cubeMatrix, float4(p,1)).xyz; |
NewerOlder