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
| /// <summary> | |
| /// Computes a point for a gun to aim at in order to hit a target using linear prediction. | |
| /// Assumes a bullet with no gravity or drag. I.e. A bullet that maintains a constant. | |
| /// velocity after it's been fired. | |
| /// </summary> | |
| public static Vector3 ComputeGunLead(Vector3 targetPos, Vector3 targetVel, Vector3 ownPos, Vector3 ownVel, float muzzleVelocity) | |
| { | |
| // Extremely low muzzle velocities are unlikely to ever hit. This also prevents a | |
| // possible division by zero if the muzzle velocity is zero for whatever reason. | |
| if (muzzleVelocity < 1f) |
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 "Distortion" | |
| { | |
| Properties | |
| { | |
| _Refraction ("Refraction", Range (0.00, 10.0)) = 1.0 | |
| _Power ("Power", Range (1.00, 10.0)) = 1.0 | |
| _AlphaPower ("Vertex Alpha Power", Range (1.00, 10.0)) = 1.0 | |
| _BumpMap( "Normal Map", 2D ) = "bump" {} | |
| _Cull ( "Face Culling", Int ) = 2 |
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 "FX/PixelDot" | |
| { | |
| Properties | |
| { | |
| [NoScaleOffset] _MainTex ("Texture", 2D) = "white" {} | |
| _Color ("Color", Color) = (1, 1, 1, 1) | |
| _Size ("Pixel Size", Range(1, 64)) = 1 | |
| } | |
| SubShader | |
| { |
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
| /*--------------------------------------------------------------------------*\ | |
| Copyright (c) 2008-2009, Danny Ruijters. All rights reserved. | |
| http://www.dannyruijters.nl/cubicinterpolation/ | |
| This file is part of CUDA Cubic B-Spline Interpolation (CI). | |
| Redistribution and use in source and binary forms, with or without | |
| modification, are permitted provided that the following conditions are met: | |
| * Redistributions of source code must retain the above copyright | |
| notice, this list of conditions and the following disclaimer. | |
| * Redistributions in binary form must reproduce the above copyright | |
| notice, this list of conditions and the following disclaimer in the |
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
| // When creating shaders for Universal Render Pipeline you can you the ShaderGraph which is super AWESOME! | |
| // However, if you want to author shaders in shading language you can use this teamplate as a base. | |
| // Please note, this shader does not necessarily match perfomance of the built-in URP Lit shader. | |
| // This shader works with URP 7.1.x and above | |
| Shader "Universal Render Pipeline/Custom/Physically Based Example" | |
| { | |
| Properties | |
| { | |
| // Specular vs Metallic workflow | |
| [HideInInspector] _WorkflowMode("WorkflowMode", Float) = 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
| /******************************************************************************* | |
| * Don't Be a Jerk: The Open Source Software License. | |
| * Adapted from: https://github.com/evantahler/Dont-be-a-Jerk | |
| ******************************************************************************* | |
| * _I_ am the software author - JohannesMP on Github. | |
| * _You_ are the user of this software. You might be a _we_, and that's OK! | |
| * | |
| * This is free, open source software. I will never charge you to use, | |
| * license, or obtain this software. Doing so would make me a jerk. | |
| * |
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 System.Linq; | |
| using System.Collections.Generic; | |
| public enum BTS | |
| { | |
| Success, | |
| Failure, | |
| Running | |
| } |
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.Reflection; | |
| using UnityEditor; | |
| using UnityEngine; | |
| [InitializeOnLoad] | |
| public class EditorCameraSpeed | |
| : EditorWindow { | |
| [MenuItem("Tools/Camera Speed &S")] | |
| public static void CameraSpeed() { | |
| var window = GetWindow<EditorCameraSpeed>(); |
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
| // c# companion script | |
| // SpriteUVToShader.cs -------------------------------------------------------------------------------------------------------------------------------- // | |
| // Save you your project, add to your SpriteRenderer gameObject | |
| using UnityEngine; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
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 "Mattatz/SobelFilter" { | |
| Properties { | |
| _MainTex ("Base (RGB)", 2D) = "white" {} | |
| _DeltaX ("Delta X", Float) = 0.01 | |
| _DeltaY ("Delta Y", Float) = 0.01 | |
| } | |
| SubShader { | |
| Tags { "RenderType"="Opaque" } |