In this page:
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; | |
| using UnityEngine.Rendering; | |
| namespace CameraAmbientOverride | |
| { | |
| /// <summary> | |
| /// Attach it to camera. Supports both URP and HDRP. | |
| /// </summary> | |
| [DisallowMultipleComponent] | |
| [RequireComponent(typeof(Camera))] |
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; | |
| using Unity.Burst; | |
| using Unity.Collections; | |
| using Unity.Jobs; | |
| using Unity.Mathematics; | |
| using UnityEngine; | |
| using UnityEngine.UI; | |
| using TMPro; | |
| public class OptimalSpatialHashing : 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
| /* | |
| Based on the Anti-aliased Euclidean distance transform described by Stefan Gustavson and | |
| Robin Strand. For further information, see https://contourtextures.wikidot.com/ and | |
| https://web.archive.org/web/20220503051209/https://weber.itn.liu.se/~stegu/edtaa/ | |
| The algorithm is an adapted version of Stefan Gustavson's code, it inherits the copyright | |
| statement below, which applies to this file only. | |
| The rewrite with Unity Burst support makes the execution 40 times faster by default, | |
| and 75 times faster if the passed in textures are both of type TextureFormat.RGBAFloat. |
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 "Points/Billboard" | |
| { | |
| Properties | |
| { | |
| _PointSize("PointSize", Range(0, 0.1)) = 0.01 | |
| [Enum(UnityEngine.Rendering.BlendMode)] _SrcBlend("Source Blend", Float) = 1 // "One" | |
| [Enum(UnityEngine.Rendering.BlendMode)] _DstBlend("Destination Blend", Float) = 0 // "Zero" | |
| [Enum(UnityEngine.Rendering.CompareFunction)] _ZTest("Depth Test", Float) = 4 // "LessEqual" | |
| [Enum(DepthWrite)] _ZWrite("Depth Write", Float) = 1 // "On" | |
| } |
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
| public static partial class FilterUtilities | |
| { | |
| // @kurtdekker | |
| // | |
| // Part of Jetpack Kurt Space Flight available for iOS/Android | |
| // | |
| // Evalutes a normalized analog input signal (such as an analog | |
| // axis) and filters it: | |
| // |
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 Unity.Burst; | |
| using Unity.Collections; | |
| using Unity.Collections.LowLevel.Unsafe; | |
| using Unity.Jobs; | |
| using UnityEngine; | |
| // This example code demonstrates using Unity Burst directly on a static method without jobs. | |
| // Unity NativeArrays can't be used directly in Unity Burst methods (only in Burst jobs), | |
| // so we have to pass pointers to arrays instead. |
The collections provided by this package fall into three categories:
- The collection types in
Unity.Collectionswhose names start withNative-have safety checks for ensuring that they're properly disposed and are used in a thread-safe manner. - The collection types in
Unity.Collections.LowLevel.Unsafewhose names start withUnsafe-do not have these safety checks. - The remaining collection types are not allocated and contain no pointers, so effectively their disposal and thread safety are never a concern. These types hold only small amounts of data.
Most of the methods in Mathematics have many overloads for different combinations of types. For example, math.abs() takes vector arguments, not just scalars, e.g. math.abs(new int3(5, -7, -1)) returns new int3(5, 7, 1). This cheat sheet does not exhaustively demonstrate all of the overloads. Consult the API reference for the full list.
In this page:
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
| UNITY_DECLARE_SHADOWMAP(_SunCascadedShadowMap); | |
| float4 _SunCascadedShadowMap_TexelSize; | |
| #define GET_CASCADE_WEIGHTS(wpos, z) getCascadeWeights_splitSpheres(wpos) | |
| #define GET_SHADOW_FADE(wpos, z) getShadowFade_SplitSpheres(wpos) | |
| #define GET_SHADOW_COORDINATES(wpos,cascadeWeights) getShadowCoord(wpos,cascadeWeights) | |
| /** | |
| * Gets the cascade weights based on the world position of the fragment and the poisitions of the split spheres for each cascade. |
NewerOlder