mirror of
https://github.com/Xevion/Paths.git
synced 2025-12-12 18:12:18 -06:00
reformat shader with Rider's improved formatting
this formatting and intellisense was not available when the Shader was originally developed
This commit is contained in:
@@ -63,7 +63,7 @@ Material:
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _GridSize: 31
|
||||
- _GridSize: 32
|
||||
- _LineSize: 0.05
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// Upgrade NOTE: upgraded instancing buffer 'Props' to new syntax.
|
||||
|
||||
Shader "PDT Shaders/TestGrid" {
|
||||
Properties {
|
||||
Shader "PDT Shaders/TestGrid"
|
||||
{
|
||||
Properties
|
||||
{
|
||||
_LineColor ("Line Color", Color) = (1,1,1,1)
|
||||
_InactiveColor ("Inactive Color", Color) = (0,0,0,0)
|
||||
_ActiveColor ("Active Color", Color) = (1,0,0,1)
|
||||
@@ -9,8 +11,12 @@ Shader "PDT Shaders/TestGrid" {
|
||||
[IntRange] _GridSize("Grid Size", Range(1,100)) = 10
|
||||
_LineSize("Line Size", Range(0,1)) = 0.15
|
||||
}
|
||||
SubShader {
|
||||
Tags { "Queue"="AlphaTest" "RenderType"="TransparentCutout" }
|
||||
SubShader
|
||||
{
|
||||
Tags
|
||||
{
|
||||
"Queue"="AlphaTest" "RenderType"="TransparentCutout"
|
||||
}
|
||||
LOD 200
|
||||
|
||||
|
||||
@@ -21,7 +27,8 @@ Shader "PDT Shaders/TestGrid" {
|
||||
|
||||
sampler2D _MainTex;
|
||||
|
||||
struct Input {
|
||||
struct Input
|
||||
{
|
||||
float2 uv_MainTex;
|
||||
};
|
||||
|
||||
@@ -61,7 +68,8 @@ Shader "PDT Shaders/TestGrid" {
|
||||
// put more per-instance properties here
|
||||
UNITY_INSTANCING_BUFFER_END(Props)
|
||||
|
||||
void surf (Input IN, inout SurfaceOutputStandard o) {
|
||||
void surf(Input IN, inout SurfaceOutputStandard o)
|
||||
{
|
||||
// Albedo comes from a texture tinted by color
|
||||
|
||||
float2 uv = IN.uv_MainTex;
|
||||
@@ -70,19 +78,25 @@ Shader "PDT Shaders/TestGrid" {
|
||||
float gsize = floor(_GridSize);
|
||||
gsize += _LineSize;
|
||||
|
||||
float2 id = float2(floor(uv.x/(1.0/gsize)), floor(uv.y/(1.0/gsize)));
|
||||
float2 id = float2(
|
||||
floor(uv.x / (1.0 / gsize)), floor(uv.y / (1.0 / gsize))
|
||||
);
|
||||
|
||||
float4 color = _InactiveColor;
|
||||
float brightness = _InactiveColor.w;
|
||||
|
||||
// Line Color Check
|
||||
if (_LineSize > 0.0 && (frac(uv.x*gsize) <= _LineSize || frac(uv.y*gsize) <= _LineSize)){
|
||||
if (_LineSize > 0.0 && (frac(uv.x * gsize) <= _LineSize || frac(uv.y * gsize) <= _LineSize))
|
||||
{
|
||||
color = _LineColor;
|
||||
brightness = color.w;
|
||||
// Heatmap Value Fallback
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
float pos = id.y * _GridSize + id.x;
|
||||
if(pos < _valueLength) {
|
||||
if (pos < _valueLength)
|
||||
{
|
||||
float index = _values[pos];
|
||||
color = _gridColors[index];
|
||||
// color = lerp(_InactiveColor, _ActiveColor, _values[pos]);
|
||||
|
||||
Reference in New Issue
Block a user