Common.hlsl 879 字节
Newer Older
timchen1002's avatar
update  
timchen1002 已提交
1
#ifndef CUSTOM_COMMON_INCLUDED
timchen1002's avatar
timchen1002 已提交
2 3 4 5 6 7 8 9 10 11 12 13 14
#define CUSTOM_COMMON_INCLUDED

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/Common.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
#include "UnityInput.hlsl"

#define UNITY_MATRIX_M unity_ObjectToWorld
#define UNITY_MATRIX_I_M unity_WorldToObject
#define UNITY_MATRIX_V unity_MatrixV
#define UNITY_MATRIX_VP unity_MatrixVP
#define UNITY_MATRIX_P glstate_matrix_projection

#if defined(_SHADOW_MASK_ALWAYS) || defined(_SHADOW_MASK_DISTANCE)
timchen1002's avatar
update  
timchen1002 已提交
15
	#define SHADOWS_SHADOWMASK
timchen1002's avatar
timchen1002 已提交
16 17 18 19 20
#endif

#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"

timchen1002's avatar
update  
timchen1002 已提交
21 22
float Square (float x) {
	return x * x;
timchen1002's avatar
timchen1002 已提交
23 24
}

timchen1002's avatar
update  
timchen1002 已提交
25 26
float DistanceSquared(float3 pA, float3 pB) {
	return dot(pA - pB, pA - pB);
timchen1002's avatar
timchen1002 已提交
27
}
timchen1002's avatar
update  
timchen1002 已提交
28

timchen1002's avatar
timchen1002 已提交
29
#endif