Untitled
Toggle main menu visibility
Loading...
Searching...
No Matches
lightmap.vert
Go to the documentation of this file.
1
2
#version 430 core
3
layout
(location = 0) in
vec3
aPos;
4
layout
(location = 1) in
vec3
aNormal;
5
layout
(location = 2) in
vec2
aUV;
6
layout
(location = 3) in
vec2
aLightmapUV;
7
layout
(location = 4) in
int
aMaterialID;
8
layout
(location = 5) in
int
aTriID;
9
10
11
struct
Mesh
12
{
13
uint
mesh_node_id
;
14
uint
mesh_id
;
15
uint
node_count
;
16
uint
node_offset
;
17
uint
vertex_offset
;
18
uint
vertex_count
;
19
uint
tri_offset
;
20
uint
tri_count
;
21
uint
bvh_index
;
22
uint
is_static
;
23
uint
pad0
;
24
uint
pad1
;
25
26
mat4
global_matrix
;
27
mat4
inverse_global_matrix
;
28
29
};
30
31
layout
(std430, binding = 6) buffer
MeshData
{
32
33
Mesh
meshes[];
34
35
};
36
37
38
uniform
int
uMeshNode
;
39
40
out
vec3
WorldPos
;
41
out
vec3
WorldNormal
;
42
out
vec2
vUV
;
43
out flat
int
TriID
;
44
45
out flat
int
MeshNode
;
46
out flat
int
MaterialID
;
47
48
49
void
main
() {
50
51
WorldPos
= (meshes[
uMeshNode
].global_matrix *
vec4
(aPos, 1.0)).xyz;
52
WorldNormal
=
mat3
(transpose(meshes[
uMeshNode
].inverse_global_matrix)) * aNormal;
53
54
vUV
= aUV;
55
vec2
clipSpaceUV = aLightmapUV * 2.0 - 1.0;
56
57
MeshNode
=
uMeshNode
;
58
MaterialID
= aMaterialID;
59
60
TriID
= aTriID;
61
gl_Position =
vec4
(clipSpaceUV, 0.0, 1.0);
62
}
layout
layout(local_size_x=16, local_size_y=16) in
main
void main()
Definition
audio_probe_bake.comp:465
MeshData
The GPU side structure for the SSBO of Meshs.
Definition
engine_types.h:1780
MeshNode
MeshNodes that describe the position of Meshes, GLTF nodes for GLTFAnimations, or hold references to ...
Definition
audio_probe_bake.comp:85
WorldNormal
in vec3 WorldNormal
Definition
lightmap.frag:9
MaterialID
in flat int MaterialID
Definition
lightmap.frag:15
vUV
in vec2 vUV
Definition
lightmap.frag:13
TriID
in flat int TriID
Definition
lightmap.frag:16
WorldPos
in vec3 WorldPos
Definition
lightmap.frag:8
Mesh::global_matrix
mat4 global_matrix
Definition
lightmap.vert:26
Mesh::vertex_offset
uint vertex_offset
Definition
lightmap.vert:17
uMeshNode
uniform int uMeshNode
Definition
lightmap.vert:38
Mesh::node_offset
uint node_offset
Definition
lightmap.vert:16
Mesh::tri_offset
uint tri_offset
Definition
lightmap.vert:19
Mesh::pad1
uint pad1
Definition
lightmap.vert:24
Mesh::node_count
uint node_count
Definition
lightmap.vert:15
Mesh::mesh_id
uint mesh_id
Definition
lightmap.vert:14
Mesh::is_static
uint is_static
Definition
lightmap.vert:22
Mesh::vertex_count
uint vertex_count
Definition
lightmap.vert:18
Mesh::mesh_node_id
uint mesh_node_id
Definition
lightmap.vert:13
Mesh::pad0
uint pad0
Definition
lightmap.vert:23
Mesh::inverse_global_matrix
mat4 inverse_global_matrix
Definition
lightmap.vert:27
Mesh::bvh_index
uint bvh_index
Definition
lightmap.vert:21
Mesh::tri_count
uint tri_count
Definition
lightmap.vert:20
Mesh
A Mesh with geometry data that is either initialized as static or dynamic and split into SubMeshes.
Definition
engine_types.h:2485
mat3
Definition
types.h:20
mat4
Definition
types.h:21
vec2
Definition
types.h:11
vec3
Definition
types.h:12
vec4
Definition
types.h:13
src
light
lightmap.vert
Generated by
1.18.0