mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Andrew Cassidy
cb98e78a3f
Deferred moves the ambient calculation to the lighting pass for very good reasons, but Unity shaders still try to do it in the base pass. Easy solution is make the GI function a no-op in deferred mode.
40 lines
1.5 KiB
Plaintext
40 lines
1.5 KiB
Plaintext
{% extends "DecalBase.shader.template" %}
|
|
{% block shader_name %}Standard{% endblock %}
|
|
|
|
{% block properties %}
|
|
[Header(Decal)]
|
|
_Decal("Decal Texture", 2D) = "gray" {}
|
|
[Toggle(DECAL_SDF_ALPHA)] _Decal_SDF_Alpha ("SDF in Alpha", int) = 0
|
|
|
|
[Header(Normal)]
|
|
[Toggle(DECAL_BASE_NORMAL)] _BaseNormal ("Use Base Normal", int) = 0
|
|
[Toggle(DECAL_BUMPMAP)] _Decal_BumpMap ("Has BumpMap", int) = 0
|
|
_BumpMap("Bump Map", 2D) = "bump" {}
|
|
_EdgeWearStrength("Edge Wear Strength", Range(0,500)) = 100
|
|
_EdgeWearOffset("Edge Wear Offset", Range(0,1)) = 0.1
|
|
|
|
[Header(Specularity)]
|
|
[Toggle(DECAL_SPECMAP)] _Decal_SpecMap ("Has SpecMap", int) = 0
|
|
_SpecMap ("Specular Map", 2D) = "black" {}
|
|
_SpecColor ("_SpecColor", Color) = (0.25, 0.25, 0.25, 1)
|
|
_Shininess ("Shininess", Range (0.03, 10)) = 0.3
|
|
|
|
[Header(Emissive)]
|
|
[Toggle(DECAL_EMISSIVE)] _Decal_Emissive ("Has Emissive", int) = 0
|
|
_Emissive("_Emissive", 2D) = "black" {}
|
|
_EmissiveColor("_EmissiveColor", Color) = (0,0,0,1)
|
|
{% endblock %}
|
|
|
|
{% block body %}
|
|
#pragma multi_compile_local __ DECAL_BASE_NORMAL DECAL_BUMPMAP
|
|
#pragma multi_compile_local __ DECAL_SPECMAP
|
|
#pragma multi_compile_local __ DECAL_EMISSIVE
|
|
#pragma multi_compile_local __ DECAL_SDF_ALPHA
|
|
|
|
#include "StandardDecal.cginc"
|
|
{% endblock %}
|
|
|
|
|
|
{% block pragmas_deferred_prepass %}
|
|
#pragma skip_variants DECAL_SPECMAP DECAL_EMISSIVE DECAL_BUMPMAP
|
|
{% endblock %} |