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
| public struct PlayerCharacterInputs // This struct only handles the local input and is used to pass it to SetInput method | |
| { | |
| public float MoveAxisForward; | |
| public float MoveAxisRight; | |
| public Vector3 CameraRotationEuler; | |
| public bool JumpDown; | |
| public bool JumpHeld; | |
| public bool CrouchDown; | |
| public bool CrouchUp; |
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 "Pristine Major Minor Grid" | |
| { | |
| Properties | |
| { | |
| [KeywordEnum(X, Y, Z)] _Axis ("Plane Axis", Float) = 1.0 | |
| [IntRange] _MajorGridDiv ("Major Grid Divisions", Range(2,25)) = 10.0 | |
| _AxisLineWidth ("Axis Line Width", Range(0,1.0)) = 0.04 | |
| _MajorLineWidth ("Major Line Width", Range(0,1.0)) = 0.02 | |
| _MinorLineWidth ("Minor Line Width", Range(0,1.0)) = 0.01 |
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
| float ConvertLinear01DepthToRawDepth(float d) | |
| { | |
| // Linear01Depth | |
| // return 1.0 / (_ZBufferParams.x * z + _ZBufferParams.y); | |
| // d = 1.0 / (_ZBufferParams.x * z + _ZBufferParams.y); | |
| // d * (_ZBufferParams.x * z + _ZBufferParams.y) = 1.0; | |
| // _ZBufferParams.x * z * d + _ZBufferParams.y * d = 1.0; | |
| // _ZBufferParams.x * z * d = 1.0 - _ZBufferParams.y * d; | |
| // z = (1.0 - _ZBufferParams.y * d) / (_ZBufferParams.x * d); |
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
| extends Node3D | |
| # FABRIK for Skeletons in Godot4 based on https://github.com/joaen/EasyIK/blob/master/EasyIK/Assets/Scripts/EasyIK.cs | |
| # Usage: | |
| # - add the script to a node | |
| # call the activate function | |
| # fabrik.activate(bone_ids, skeleton, left_hand_target, left_hand_pole) | |
| # bone_ids is an Array with the bone ids of the chain | |
| # skeleton is the skeleton | |
| # left_hand_target is a Node3D |
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; | |
| // @kurtdekker - example of an ultra-simple music manager. | |
| // | |
| // How to use: | |
| // MusicManager.Instance.PlayMusic( Audioclip clip); | |
| // | |
| // Call the above with null to stop music. |
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
| /***************************************************************/ | |
| /********** Simple target orientation camera script. ***********/ | |
| /*** You can change parameters, such as rotation/zoom speed. ***/ | |
| /***************************************************************/ | |
| // Original: https://github.com/steaklive/Orbit-Camera-for-Unity-Demos | |
| using UnityEngine; | |
| using System.Collections; |
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
| namespace UnityEngine.Rendering.Universal | |
| { | |
| public enum BufferType | |
| { | |
| CameraColor, | |
| Custom | |
| } | |
| public class DrawFullScreenFeature : ScriptableRendererFeature | |
| { |
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
| def lerp(a: float, b: float, t: float) -> float: | |
| """Linear interpolate on the scale given by a to b, using t as the point on that scale. | |
| Examples | |
| -------- | |
| 50 == lerp(0, 100, 0.5) | |
| 4.2 == lerp(1, 5, 0.8) | |
| """ | |
| return (1 - t) * a + t * b |
NewerOlder