64 lines
1.6 KiB
GLSL
64 lines
1.6 KiB
GLSL
Shader "Es/InkPainter/PaintHeight" {
|
|
Properties {
|
|
[HideInInspector] _MainTex ("MainTex", 2D) = "white" {}
|
|
[HideInInspector] _Brush ("Brush", 2D) = "white" {}
|
|
[HideInInspector] _BrushHeight ("BrushHeight", 2D) = "white" {}
|
|
[HideInInspector] _BrushScale ("BrushScale", Float) = 0.1
|
|
[HideInInspector] _BrushRotate ("Rotate", Float) = 0
|
|
[HideInInspector] _PaintUV ("Hit UV Position", Vector) = (0,0,0,0)
|
|
[HideInInspector] _HeightBlend ("HeightBlend", Float) = 1
|
|
[HideInInspector] _Color ("Color", Vector) = (0,0,0,0)
|
|
[KeywordEnum(USE_BRUSH, ADD, SUB, MIN, MAX, COLOR_RGB_HEIGHT_A)] [HideInInspector] INK_PAINTER_HEIGHT_BLEND ("Height Blend Keyword", Float) = 0
|
|
}
|
|
//DummyShaderTextExporter
|
|
SubShader{
|
|
Tags { "RenderType"="Opaque" }
|
|
LOD 200
|
|
|
|
Pass
|
|
{
|
|
HLSLPROGRAM
|
|
#pragma vertex vert
|
|
#pragma fragment frag
|
|
|
|
float4x4 unity_ObjectToWorld;
|
|
float4x4 unity_MatrixVP;
|
|
float4 _MainTex_ST;
|
|
|
|
struct Vertex_Stage_Input
|
|
{
|
|
float4 pos : POSITION;
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
struct Vertex_Stage_Output
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
float4 pos : SV_POSITION;
|
|
};
|
|
|
|
Vertex_Stage_Output vert(Vertex_Stage_Input input)
|
|
{
|
|
Vertex_Stage_Output output;
|
|
output.uv = (input.uv.xy * _MainTex_ST.xy) + _MainTex_ST.zw;
|
|
output.pos = mul(unity_MatrixVP, mul(unity_ObjectToWorld, input.pos));
|
|
return output;
|
|
}
|
|
|
|
Texture2D<float4> _MainTex;
|
|
SamplerState sampler_MainTex;
|
|
|
|
struct Fragment_Stage_Input
|
|
{
|
|
float2 uv : TEXCOORD0;
|
|
};
|
|
|
|
float4 frag(Fragment_Stage_Input input) : SV_TARGET
|
|
{
|
|
return _MainTex.Sample(sampler_MainTex, input.uv.xy);
|
|
}
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
} |