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; | |
| // https://gist.github.com/bozzin/5895d97130e148e66b88ff4c92535b59 | |
| public class DepthFX : MonoBehaviour | |
| { | |
| public float power = -0.02f; | |
| void Update() | |
| { |
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
| // This file is in the public domain. Where | |
| // a public domain declaration is not recognized, you are granted | |
| // a license to freely use, modify, and redistribute this file in | |
| // any way you choose. | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| // Unity remake of a fake volumetric light glow effect |
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
| // https://forum.unity.com/threads/how-to-create-depth-cubemap.1400545/ | |
| GameObject cubemapCam = new GameObject( "CubemapCamera" ); | |
| cubemapCam.AddComponent<Camera>(); | |
| cubemapCam.transform.position = Vector3.zero; | |
| cubemapCam.transform.rotation = Quaternion.identity; | |
| cubemapCam.GetComponent<Camera>().depthTextureMode = DepthTextureMode.Depth; | |
| cubemapCam.GetComponent<Camera>().farClipPlane = 30; | |
| int cubemapSize = 128; | |
| RenderTexture _cubeMapTex = new RenderTexture( cubemapSize, cubemapSize, 16, RenderTextureFormat.Depth ); |
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
| // https://forum.unity.com/threads/custom-unity-methods-bindings.1347785/ | |
| public static unsafe bool GetData(AudioClip clip, Span<float> data, uint offsetSamples) | |
| { | |
| #if !UNITY_2023_1_OR_NEWER || UNITY_EDITOR || DEVELOPMENT_BUILD | |
| if (clip.channels <= 0) | |
| return false; | |
| fixed (float* pData = data) | |
| { | |
| var native = NativeObjectUtility.GetNativeObject(clip); |
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 System.Linq; | |
| using UnityEngine; | |
| #if ENABLE_VIRTUALTEXTURES | |
| using VT = UnityEngine.Rendering.VirtualTexturing; | |
| #endif | |
| // [ExecuteInEditMode] | |
| public class VTRequester : MonoBehaviour |
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
| // https://forum.unity.com/threads/multiple-glb-importers-how-do-i-fix-this.1364523/#post-8608575 | |
| // Default importer | |
| [ScriptedImporter(1, new [] {"gltf", "glb"})] | |
| // Optional importer | |
| [ScriptedImporter(1, null, new [] {"gltf", "glb"})] |
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
| // https://forum.unity.com/threads/roman-mosaic-style-using-opencv-for-unity.1398250/ | |
| using UnityEngine; | |
| using System.Collections.Generic; | |
| public class VoronoiDiagram : MonoBehaviour | |
| { | |
| public Texture2D image; | |
| public int numberOfSites = 100; | |
| public float scale = 1; | |
| private List<Vector2> sites; |
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 "Crying Suns/Command Center Glass" | |
| { | |
| Properties | |
| { | |
| [PerRendererData] _MainTex ("Main Texture (ignored)", 2D) = "white" {} | |
| [NoScaleOffset] _ReflectionTex ("Reflection Texture", 2D) = "black" {} | |
| _ReflectionAlpha ("Reflection Alpha", Range(0, 1)) = 0.25 | |
| _ReflectionScale ("Reflection Scale", Range(0, 1)) = 1 | |
| [HideInInspector] _SunCenteredViewportPos ("Sun Centered Viewport Position", Vector) = (0, 0, 0, 0) | |
| [HideInInspector] _SunAngle ("Sun Angle", Float) = 0 |