Shader "MaterialPropertyDrawer"
{
Properties
{
_MainTex("Texture", 2D) = "white" {}
[HideInInspector] _MainTex2("Hide Texture", 2D) = "white" {}
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 "WorldNormalFromDepthTexture" | |
| { | |
| Properties { | |
| [KeywordEnum(3 Tap, 4 Tap, Improved, Accurate)] _ReconstructionMethod ("Normal Reconstruction Method", Float) = 0 | |
| } | |
| SubShader | |
| { | |
| Tags { "RenderType"="Transparent" "Queue"="Transparent" } | |
| LOD 100 |
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
| /// Add this script to the parent of colliders you wish to sync to the root rigidbody | |
| using KinematicCharacterController; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class BuildKCCPlatform : MonoBehaviour | |
| { | |
| public Transform source; |
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 GenerateVectorData : MonoBehaviour | |
| { | |
| private SkinnedMeshRenderer m_mesh; | |
| private Mesh skinnedMeshCache; | |
| private Vector3[] vertexFrameCache1; | |
| private Vector3[] vertexFrameCache2; | |
| private Vector3[] vertexFrameCache3; | |
| private ComputeBuffer vertexBuffer1; |
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
| #ifndef TRICUBIC_INCLUDED | |
| #define TRICUBIC_INCLUDED | |
| float4 Cubic(float v) | |
| { | |
| float4 n = float4(1.0, 2.0, 3.0, 4.0) - v; | |
| float4 s = n * n * n; | |
| float x = s.x; | |
| float y = s.y - 4.0 * s.x; | |
| float z = s.z - 4.0 * s.y + 6.0 * s.x; |
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 "Custom/UnlitTexture" | |
| { | |
| Properties | |
| { | |
| [MainColor] _BaseColor("BaseColor", Color) = (1,1,1,1) | |
| [MainTexture] _BaseMap("BaseMap", 2D) = "white" {} | |
| } | |
| // Universal Render Pipeline subshader. If URP is installed this will be used. | |
| 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
| /// <summary> | |
| /// Collider cache for non allocating physics calls. Lazy loaded. | |
| /// </summary> | |
| /// <example> | |
| /// Usage | |
| /// <code> | |
| /// float radius = 0.2f; | |
| /// int colliderCount = Physics.OverlapSphereNonAlloc(transform.position, radius: radius, results: ColliderCache); | |
| /// for (int i = 0; i<colliderCount; i++) { | |
| /// ... |
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 "Name" { | |
| Properties { | |
| _Name ("display name", Range (min, max)) = number | |
| _Name ("display name", Float) = number | |
| _Name ("display name", Int) = number | |
| _Name ("display name", Color) = (number,number,number,number) | |
| _Name ("display name", Vector) = (number,number,number,number) |
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
| Setup: | |
| 1. Index buffer containing N quads (each 2 triangles), where N is the max amount of spheres. Repeating pattern of {0,1,2,1,3,2} + K*4. | |
| 2. No vertex buffer. | |
| Render N*2 triangles, where N is the number of spheres you have. | |
| Vertex shader: | |
| 1. Sphere index = N/4 (N = SV_VertexId) | |
| 2. Quad coord: Q = float2(N%2, (N%4)/2) * 2.0 - 1.0 | |
| 3. Transform sphere center -> pos |
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 TerrainDetector | |
| { | |
| private TerrainData terrainData; | |
| private int alphamapWidth; | |
| private int alphamapHeight; | |
| private float[,,] splatmapData; | |
| private int numTextures; |
NewerOlder
