您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
76 行
2.4 KiB
76 行
2.4 KiB
Shader "HDRenderPipeline/Decal"
|
|
{
|
|
Properties
|
|
{
|
|
_BaseColorMap("BaseColorMap", 2D) = "white" {}
|
|
_NormalMap("NormalMap", 2D) = "bump" {} // Tangent space normal map
|
|
_DecalBlend("_DecalBlend", Range(0.0, 1.0)) = 0.5
|
|
}
|
|
|
|
HLSLINCLUDE
|
|
|
|
#pragma target 4.5
|
|
#pragma only_renderers d3d11 ps4 xboxone vulkan metal
|
|
//#pragma enable_d3d11_debug_symbols
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
// Variant
|
|
//-------------------------------------------------------------------------------------
|
|
#pragma shader_feature _COLORMAP
|
|
#pragma shader_feature _NORMALMAP
|
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
// Define
|
|
//-------------------------------------------------------------------------------------
|
|
#define UNITY_MATERIAL_DECAL // do we need this now that Material.hlsl is not getting included?
|
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
// Include
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
#include "ShaderLibrary/Common.hlsl"
|
|
#include "ShaderLibrary/Wind.hlsl"
|
|
#include "../../ShaderPass/FragInputs.hlsl"
|
|
#include "../../ShaderPass/ShaderPass.cs.hlsl"
|
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
// variable declaration
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
#include "DecalProperties.hlsl"
|
|
|
|
// All our shaders use same name for entry point
|
|
#pragma vertex Vert
|
|
#pragma fragment Frag
|
|
|
|
ENDHLSL
|
|
|
|
SubShader
|
|
{
|
|
Pass
|
|
{
|
|
Name "DBuffer" // Name is not used
|
|
Tags { "LightMode" = "DBuffer" } // This will be only for opaque object based on the RenderQueue index
|
|
|
|
// need to optimize this and use proper Cull and ZTest modes for cases when decal geometry is clipped by camera
|
|
Cull Off
|
|
ZWrite Off
|
|
ZTest Always
|
|
|
|
HLSLPROGRAM
|
|
|
|
#define SHADERPASS SHADERPASS_DBUFFER
|
|
#include "../../ShaderVariables.hlsl"
|
|
#include "Decal.hlsl"
|
|
#include "ShaderPass/DecalSharePass.hlsl"
|
|
#include "DecalData.hlsl"
|
|
#include "../../ShaderPass/ShaderPassDBuffer.hlsl"
|
|
|
|
ENDHLSL
|
|
}
|
|
}
|
|
CustomEditor "Experimental.Rendering.HDPipeline.DecalUI"
|
|
}
|