Add specular paint shader

This commit is contained in:
2020-05-25 10:35:32 -07:00
parent 8ca3925e04
commit dc25576911
5 changed files with 221 additions and 10 deletions

View File

@ -4,7 +4,7 @@ Shader "ConformalDecals/Feature/Bumped"
{
[Header(Texture Maps)]
_Decal("Decal Texture", 2D) = "gray" {}
_DecalBumpMap("Decal Bump Map", 2D) = "bump" {}
_BumpMap("Decal Bump Map", 2D) = "bump" {}
_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
_Opacity("_Opacity", Range(0,1) ) = 1
@ -35,16 +35,18 @@ Shader "ConformalDecals/Feature/Bumped"
#pragma multi_compile_fwdbase nolightmap nodirlightmap nodynlightmap
sampler2D _Decal;
sampler2D _DecalBumpMap;
sampler2D _BumpMap;
float4 _Decal_ST;
float4 _DecalBumpMap_ST;
float4 _BumpMap_ST;
float _Cutoff;
float _Opacity;
float _RimFalloff;
float4 _RimColor;
#define DECAL_NORMAL
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
@ -54,7 +56,7 @@ Shader "ConformalDecals/Feature/Bumped"
void surf (DecalSurfaceInput IN, inout SurfaceOutput o)
{
float4 color = tex2D(_Decal, IN.uv_decal);
float3 normal = UnpackNormal(tex2D(_DecalBumpMap, IN.uv_decal));
float3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_bump));
// clip alpha
clip(color.a - _Cutoff);
@ -84,16 +86,18 @@ Shader "ConformalDecals/Feature/Bumped"
#pragma multi_compile_fwdadd nolightmap nodirlightmap nodynlightmap
sampler2D _Decal;
sampler2D _DecalBumpMap;
sampler2D _BumpMap;
float4 _Decal_ST;
float4 _DecalBumpMap_ST;
float4 _BumpMap_ST;
float _Cutoff;
float _Opacity;
float _RimFalloff;
float4 _RimColor;
#define DECAL_NORMAL
#include "UnityCG.cginc"
#include "Lighting.cginc"
#include "AutoLight.cginc"
@ -103,7 +107,7 @@ Shader "ConformalDecals/Feature/Bumped"
void surf (DecalSurfaceInput IN, inout SurfaceOutput o)
{
float4 color = tex2D(_Decal, IN.uv_decal);
float3 normal = UnpackNormal(tex2D(_DecalBumpMap, IN.uv_decal));
float3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_bump));
// clip alpha
clip(color.a - _Cutoff);