Graphite  Version 3
An experimental 3D geometry processing program
GLUP_context_GLSL.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000-2022 Inria
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * * Neither the name of the ALICE Project-Team nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
21  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  * POSSIBILITY OF SUCH DAMAGE.
28  *
29  * Contact: Bruno Levy
30  *
31  * https://www.inria.fr/fr/bruno-levy
32  *
33  * Inria,
34  * Domaine de Voluceau,
35  * 78150 Le Chesnay - Rocquencourt
36  * FRANCE
37  *
38  */
39 
40 #ifndef GEOGRAM_GFX_GLUP_GLUP_CONTEXT_GLSL
41 #define GEOGRAM_GFX_GLUP_GLUP_CONTEXT_GLSL
42 
45 
51 #ifdef GEO_GL_150
52 
53 namespace GLUP {
54  using namespace GEO;
55 
56  /*********************************************************************/
57 
67  class Context_GLSL150 : public Context {
68  public:
69 
73  Context_GLSL150();
74 
78  const char* profile_name() const override;
79 
83  void setup() override;
84 
85  protected:
89  void setup_GLUP_POINTS() override;
90 
94  void setup_GLUP_LINES() override;
95 
99  void setup_GLUP_THICK_LINES() override;
100 
104  void setup_GLUP_TRIANGLES() override;
105 
109  void setup_GLUP_QUADS() override;
110 
114  void setup_GLUP_TETRAHEDRA() override;
115 
119  void setup_GLUP_PRISMS() override;
120 
124  void setup_GLUP_HEXAHEDRA() override;
125 
129  void setup_GLUP_PYRAMIDS() override;
130 
134  void setup_GLUP_CONNECTORS() override;
135 
139  void setup_GLUP_SPHERES() override;
140 
144  void get_vertex_shader_preamble_pseudo_file(
145  std::vector<GLSL::Source>& sources
146  ) override;
147 
151  void get_fragment_shader_preamble_pseudo_file(
152  std::vector<GLSL::Source>& sources
153  ) override;
154 
158  void get_geometry_shader_preamble_pseudo_file(
159  std::vector<GLSL::Source>& sources
160  ) override;
161 
165  void get_primitive_pseudo_file(
166  std::vector<GLSL::Source>& sources
167  ) override;
168 
174  virtual void get_geometry_shader_layout(
175  std::vector<GLSL::Source>& sources
176  );
177  };
178 
179  /*********************************************************************/
180 
189  class Context_GLSL440 : public Context_GLSL150 {
190  public:
191 
195  Context_GLSL440();
196 
200  const char* profile_name() const override;
201 
202  protected:
206  void setup_GLUP_HEXAHEDRA() override;
207 
211  void setup_GLUP_PYRAMIDS() override;
212 
216  void get_vertex_shader_preamble_pseudo_file(
217  std::vector<GLSL::Source>& sources
218  ) override;
219 
223  void get_fragment_shader_preamble_pseudo_file(
224  std::vector<GLSL::Source>& sources
225  ) override;
226 
230  void get_geometry_shader_preamble_pseudo_file(
231  std::vector<GLSL::Source>& sources
232  ) override;
233 
237  void get_tess_evaluation_shader_preamble_pseudo_file(
238  std::vector<GLSL::Source>& sources
239  ) override;
240 
244  void get_primitive_pseudo_file(
245  std::vector<GLSL::Source>& sources
246  ) override;
247 
251  void get_geometry_shader_layout(
252  std::vector<GLSL::Source>& sources
253  ) override;
254 
255  bool use_tessellation_;
256  };
257 
258  /*********************************************************************/
259 }
260 
261 #endif
262 
263 #endif
Internal implementation of GLUP context.
Common include file, providing basic definitions. Should be included before anything else by all head...
Global Vorpaline namespace.