-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathrender_node.cpp
More file actions
139 lines (113 loc) · 2.78 KB
/
Copy pathrender_node.cpp
File metadata and controls
139 lines (113 loc) · 2.78 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
////////////////////////////////////////////////////////////////////////////////
// Distributed under the Boost Software License, Version 1.0. //
// (See accompanying file LICENSE or copy at //
// https://www.boost.org/LICENSE_1_0.txt) //
////////////////////////////////////////////////////////////////////////////////
#include "graphics/render_graph/render_node.h"
#include <cstddef>
#include <memory>
#include "graphics/render_graph/shader_compiler.h"
namespace iris
{
RenderNode::RenderNode()
: colour_input_(nullptr)
, specular_power_input_(nullptr)
, specular_amount_input_(nullptr)
, vertex_normal_input_(nullptr)
, fragment_normal_input_(nullptr)
, position_input_(nullptr)
, shadow_map_input_(nullptr)
, ambient_occlusion_input_(nullptr)
, depth_only_(false)
{
}
void RenderNode::accept(ShaderCompiler &compiler) const
{
compiler.visit(*this);
}
Node *RenderNode::colour_input() const
{
return colour_input_;
}
void RenderNode::set_colour_input(Node *input)
{
colour_input_ = input;
}
Node *RenderNode::specular_power_input() const
{
return specular_power_input_;
}
void RenderNode::set_specular_power_input(Node *input)
{
specular_power_input_ = input;
}
Node *RenderNode::specular_amount_input() const
{
return specular_amount_input_;
}
void RenderNode::set_specular_amount_input(Node *input)
{
specular_amount_input_ = input;
}
Node *RenderNode::vertex_normal_input() const
{
return vertex_normal_input_;
}
void RenderNode::set_vertex_normal_input(Node *input)
{
vertex_normal_input_ = input;
}
Node *RenderNode::fragment_normal_input() const
{
return fragment_normal_input_;
}
void RenderNode::set_fragment_normal_input(Node *input)
{
fragment_normal_input_ = input;
}
Node *RenderNode::position_input() const
{
return position_input_;
}
void RenderNode::set_position_input(Node *input)
{
position_input_ = input;
}
Node *RenderNode::shadow_map_input() const
{
return shadow_map_input_;
}
void RenderNode::set_shadow_map_input(Node *input)
{
shadow_map_input_ = input;
}
Node *RenderNode::ambient_occlusion_input() const
{
return ambient_occlusion_input_;
}
void RenderNode::set_ambient_occlusion_input(Node *input)
{
ambient_occlusion_input_ = input;
}
bool RenderNode::is_depth_only() const
{
return depth_only_;
}
void RenderNode::set_depth_only(bool depth_only)
{
depth_only_ = depth_only;
}
std::size_t RenderNode::hash() const
{
return combine_hash(
colour_input_,
specular_amount_input_,
vertex_normal_input_,
fragment_normal_input_,
position_input_,
shadow_map_input_,
ambient_occlusion_input_,
depth_only_,
"render_node");
}
}