-
-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b09235b
commit 7339fb9
Showing
90 changed files
with
3,932 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include <mbgl/shaders/layer_ubo.hpp> | ||
|
||
namespace mbgl { | ||
namespace shaders { | ||
|
||
struct alignas(16) CustomGeometryDrawableUBO { | ||
/* 0 */ std::array<float, 4 * 4> matrix; | ||
/* 64 */ Color color; | ||
/* 80 */ | ||
}; | ||
static_assert(sizeof(CustomGeometryDrawableUBO) == 5 * 16); | ||
|
||
} // namespace shaders | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Generated code, do not modify this file! | ||
#pragma once | ||
#include <mbgl/shaders/shader_source.hpp> | ||
|
||
namespace mbgl { | ||
namespace shaders { | ||
|
||
template <> | ||
struct ShaderSource<BuiltIn::CustomGeometryShader, gfx::Backend::Type::OpenGL> { | ||
static constexpr const char* name = "CustomGeometryShader"; | ||
static constexpr const char* vertex = R"(layout (std140) uniform CustomGeometryDrawableUBO { | ||
mat4 u_matrix; | ||
vec4 u_color; | ||
}; | ||
layout(location = 0) in vec3 a_pos; | ||
layout(location = 1) in vec2 a_uv; | ||
out vec2 frag_uv; | ||
void main() { | ||
frag_uv = a_uv; | ||
gl_Position = u_matrix * vec4(a_pos, 1.0); | ||
})"; | ||
static constexpr const char* fragment = R"(layout (std140) uniform CustomGeometryDrawableUBO { | ||
mat4 u_matrix; | ||
vec4 u_color; | ||
}; | ||
in vec2 frag_uv; | ||
uniform sampler2D u_image; | ||
void main() { | ||
fragColor = texture(u_image, frag_uv) * u_color; | ||
})"; | ||
}; | ||
|
||
} // namespace shaders | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.