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#if defined(QSHADER_SPIRV) || defined(QSHADER_GLSL)
36 v_texcoord = vec2(texcoord.x, 1. - texcoord.y);
37#else
38 v_texcoord = texcoord;
39#endif
40 gl_Position = renderer.clipSpaceCorrMatrix * vec4(position.xy, 0.0, 1.);
41}
42)_";
43
44static const constexpr auto generic_texgen_fs = R"_(#version 450
45layout(location = 0) in vec2 v_texcoord;
46layout(location = 0) out vec4 fragColor;
47
48layout(std140, binding = 0) uniform renderer_t {
49mat4 clipSpaceCorrMatrix;
50vec2 renderSize;
51} renderer;
52
53layout(binding=3) uniform sampler2D y_tex;
54
55void main ()
56{
57 fragColor = texture(y_tex, v_texcoord);
58}
59)_";
60
61template <typename Node_T>
62struct GfxNode;
63template <typename Node_T>
64struct GfxRenderer;
65}
66#endif
Definition Factories.hpp:19