mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Add specular paint shader
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user