Loading...
Searching...
No Matches
GfxNode.hpp
1#pragma once
2#if SCORE_PLUGIN_GFX
3
4#include <Crousti/GpuUtils.hpp>
5#include <Crousti/Metadatas.hpp>
6#include <Gfx/Graph/Node.hpp>
7#include <Gfx/Graph/NodeRenderer.hpp>
8#include <Gfx/Graph/RenderList.hpp>
9#include <Gfx/Graph/RenderState.hpp>
10#include <Gfx/Graph/Uniforms.hpp>
11
12#include <avnd/binding/ossia/port_run_preprocess.hpp>
13#include <avnd/common/for_nth.hpp>
14
15namespace oscr
16{
17template <typename Info>
18class ProcessModel;
19static const constexpr auto generic_texgen_vs = R"_(#version 450
20layout(location = 0) in vec2 position;
21layout(location = 1) in vec2 texcoord;
22
23layout(binding=3) uniform sampler2D y_tex;
24layout(location = 0) out vec2 v_texcoord;
25
26layout(std140, binding = 0) uniform renderer_t {
27 mat4 clipSpaceCorrMatrix;
28 vec2 renderSize;
29} renderer;
30
31out gl_PerVertex { vec4 gl_Position; };
32
33void main()
34{
35 v_texcoord = texcoord;
36 gl_Position = renderer.clipSpaceCorrMatrix * vec4(position.xy, 0.0, 1.);
37}
38)_";
39
40static const constexpr auto generic_texgen_fs = R"_(#version 450
41layout(location = 0) in vec2 v_texcoord;
42layout(location = 0) out vec4 fragColor;
43
44layout(std140, binding = 0) uniform renderer_t {
45mat4 clipSpaceCorrMatrix;
46vec2 renderSize;
47} renderer;
48
49layout(binding=3) uniform sampler2D y_tex;
50
51
52void main ()
53{
54 fragColor = texture(y_tex, v_texcoord);
55}
56)_";
57
58template <typename Node_T>
59struct GfxNode;
60template <typename Node_T>
61struct GfxRenderer;
62}
63#endif
Definition Factories.hpp:19