-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtype_common.h
98 lines (83 loc) · 1.82 KB
/
type_common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright (c) 2022 Feng Yang
//
// I am making my contributions/submissions to this project solely in my
// personal capacity and am not conveying any rights to any intellectual
// property of any third parties.
#pragma once
#import <simd/simd.h>
typedef enum {
Position = 0,
Normal = 1,
UV_0 = 2,
Tangent = 3,
Bitangent = 4,
Color_0 = 5,
Weights_0 = 6,
Joints_0 = 7,
UV_1 = 8,
UV_2 = 9,
UV_3 = 10,
UV_4 = 11,
UV_5 = 12,
UV_6 = 13,
UV_7 = 14,
} Attributes;
struct CameraData {
matrix_float4x4 u_viewMat;
matrix_float4x4 u_projMat;
matrix_float4x4 u_VPMat;
matrix_float4x4 u_viewInvMat;
matrix_float4x4 u_projInvMat;
vector_float3 u_cameraPos;
};
struct RendererData {
matrix_float4x4 u_localMat;
matrix_float4x4 u_modelMat;
matrix_float4x4 u_normalMat;
};
// MARK: - Light
struct EnvMapLight {
vector_float3 diffuse;
int mipMapLevel;
float diffuseIntensity;
float specularIntensity;
};
struct PointLightData {
vector_float3 color;
vector_float3 position;
float distance;
};
struct SpotLightData {
vector_float3 color;
float distance;
vector_float3 position;
float angleCos;
vector_float3 direction;
float penumbraCos;
};
struct DirectLightData {
vector_float3 color;
vector_float3 direction;
};
// MARK: - Material
struct PBRBaseData {
vector_float4 baseColor;
vector_float3 emissiveColor;
float normalTextureIntensity;
float occlusionTextureIntensity;
int occlusionTextureCoord;
float clearCoat;
float clearCoatRoughness;
vector_float4 tilingOffset;
};
struct PBRData {
float metallic;
float roughness;
// aligned pad
float pad1;
float pad2;
};
struct PBRSpecularData {
vector_float3 specularColor;
float glossiness;
};