Open3D (C++ API)
Shader.h
Go to the documentation of this file.
1 // Automatically generated header file for shader.
2 // See LICENSE.txt for full license statement.
3 
4 #pragma once
5 
6 // clang-format off
7 namespace open3d {
8 
9 namespace visualization {
10 
11 namespace glsl {
12 
13 const char * const ImageFragmentShader =
14 "#version 330\n"
15 "\n"
16 "in vec2 UV;\n"
17 "uniform sampler2D image_texture;\n"
18 "\n"
19 "out vec4 FragColor;\n"
20 "\n"
21 "void main()\n"
22 "{\n"
23 " FragColor = texture(image_texture, UV);\n"
24 "}\n"
25 ;
26 
27 } // namespace open3d::glsl
28 
29 } // namespace open3d::visualization
30 
31 } // namespace open3d
32 
33 // clang-format on
34 // clang-format off
35 namespace open3d {
36 
37 namespace visualization {
38 
39 namespace glsl {
40 
41 const char * const ImageMaskFragmentShader =
42 "#version 330\n"
43 "\n"
44 "in vec2 UV;\n"
45 "uniform sampler2D image_texture;\n"
46 "\n"
47 "uniform vec3 mask_color;\n"
48 "uniform float mask_alpha;\n"
49 "\n"
50 "out vec4 FragColor;\n"
51 "\n"
52 "void main()\n"
53 "{\n"
54 " FragColor = vec4(mask_color, texture(image_texture, UV).r * mask_alpha);\n"
55 "}\n"
56 ;
57 
58 } // namespace open3d::glsl
59 
60 } // namespace open3d::visualization
61 
62 } // namespace open3d
63 
64 // clang-format on
65 // clang-format off
66 namespace open3d {
67 
68 namespace visualization {
69 
70 namespace glsl {
71 
72 const char * const ImageMaskVertexShader =
73 "#version 330\n"
74 "\n"
75 "in vec3 vertex_position;\n"
76 "in vec2 vertex_UV;\n"
77 "\n"
78 "out vec2 UV;\n"
79 "\n"
80 "void main()\n"
81 "{\n"
82 " gl_Position = vec4(vertex_position, 1);\n"
83 " UV = vertex_UV;\n"
84 "}\n"
85 ;
86 
87 } // namespace open3d::glsl
88 
89 } // namespace open3d::visualization
90 
91 } // namespace open3d
92 
93 // clang-format on
94 // clang-format off
95 namespace open3d {
96 
97 namespace visualization {
98 
99 namespace glsl {
100 
101 const char * const ImageVertexShader =
102 "#version 330\n"
103 "\n"
104 "in vec3 vertex_position;\n"
105 "in vec2 vertex_UV;\n"
106 "\n"
107 "out vec2 UV;\n"
108 "\n"
109 "uniform vec3 vertex_scale;\n"
110 "\n"
111 "void main()\n"
112 "{\n"
113 " gl_Position = vec4(vertex_position * vertex_scale, 1);\n"
114 " UV = vertex_UV;\n"
115 "}\n"
116 ;
117 
118 } // namespace open3d::glsl
119 
120 } // namespace open3d::visualization
121 
122 } // namespace open3d
123 
124 // clang-format on
125 // clang-format off
126 namespace open3d {
127 
128 namespace visualization {
129 
130 namespace glsl {
131 
132 const char * const NormalFragmentShader =
133 "#version 330\n"
134 "\n"
135 "in vec3 vertex_normal_camera;\n"
136 "out vec4 FragColor;\n"
137 "\n"
138 "void main()\n"
139 "{\n"
140 " FragColor = vec4(vertex_normal_camera * 0.5 + 0.5, 1);\n"
141 "}\n"
142 ;
143 
144 } // namespace open3d::glsl
145 
146 } // namespace open3d::visualization
147 
148 } // namespace open3d
149 
150 // clang-format on
151 // clang-format off
152 namespace open3d {
153 
154 namespace visualization {
155 
156 namespace glsl {
157 
158 const char * const NormalVertexShader =
159 "#version 330\n"
160 "\n"
161 "in vec3 vertex_position;\n"
162 "in vec3 vertex_normal;\n"
163 "\n"
164 "out vec3 vertex_normal_camera;\n"
165 "\n"
166 "uniform mat4 MVP;\n"
167 "uniform mat4 V;\n"
168 "uniform mat4 M;\n"
169 "\n"
170 "void main()\n"
171 "{\n"
172 " gl_Position = MVP * vec4(vertex_position, 1);\n"
173 " vertex_normal_camera = (V * M * vec4(vertex_normal, 0)).xyz;\n"
174 "}\n"
175 ;
176 
177 } // namespace open3d::glsl
178 
179 } // namespace open3d::visualization
180 
181 } // namespace open3d
182 
183 // clang-format on
184 // clang-format off
185 namespace open3d {
186 
187 namespace visualization {
188 
189 namespace glsl {
190 
191 const char * const PhongFragmentShader =
192 "#version 330\n"
193 "\n"
194 "in vec3 vertex_position_world;\n"
195 "in vec3 vertex_normal_camera;\n"
196 "in vec3 eye_dir_camera;\n"
197 "in mat4 light_dir_camera_4;\n"
198 "in vec3 fragment_color;\n"
199 "\n"
200 "uniform mat4 light_color_4;\n"
201 "uniform vec4 light_diffuse_power_4;\n"
202 "uniform vec4 light_specular_power_4;\n"
203 "uniform vec4 light_specular_shininess_4;\n"
204 "uniform vec4 light_ambient;\n"
205 "\n"
206 "out vec4 FragColor;\n"
207 "\n"
208 "void main()\n"
209 "{\n"
210 " vec3 diffuse_color = fragment_color;\n"
211 " vec3 ambient_color = light_ambient.xyz * diffuse_color;\n"
212 " vec3 specular_color = vec3(1.0, 1.0, 1.0);\n"
213 " vec4 cos_theta;\n"
214 " vec4 cos_alpha;\n"
215 " vec3 n, e, l, r;\n"
216 "\n"
217 " n = normalize(vertex_normal_camera);\n"
218 " e = normalize(eye_dir_camera);\n"
219 " l = normalize(light_dir_camera_4[0].xyz);\n"
220 " r = reflect(-l, n);\n"
221 " cos_theta[0] = clamp(dot(n, l), 0, 1);\n"
222 " cos_alpha[0] = clamp(dot(e, r), 0, 1);\n"
223 "\n"
224 " l= normalize(light_dir_camera_4[1].xyz);\n"
225 " r = reflect(-l, n);\n"
226 " cos_theta[1] = clamp(dot(n, l), 0, 1);\n"
227 " cos_alpha[1] = clamp(dot(e, r), 0, 1);\n"
228 "\n"
229 " l= normalize(light_dir_camera_4[2].xyz);\n"
230 " r = reflect(-l, n);\n"
231 " cos_theta[2] = clamp(dot(n, l), 0, 1);\n"
232 " cos_alpha[2] = clamp(dot(e, r), 0, 1);\n"
233 "\n"
234 " l= normalize(light_dir_camera_4[3].xyz);\n"
235 " r = reflect(-l, n);\n"
236 " cos_theta[3] = clamp(dot(n, l), 0, 1);\n"
237 " cos_alpha[3] = clamp(dot(e, r), 0, 1);\n"
238 "\n"
239 " FragColor = vec4(ambient_color + \n"
240 " diffuse_color * light_color_4[0].xyz * light_diffuse_power_4[0] * cos_theta[0] +\n"
241 " specular_color * light_color_4[0].xyz * light_specular_power_4[0] * pow(cos_alpha[0], light_specular_shininess_4[0]) +\n"
242 " diffuse_color * light_color_4[1].xyz * light_diffuse_power_4[1] * cos_theta[1] +\n"
243 " specular_color * light_color_4[1].xyz * light_specular_power_4[1] * pow(cos_alpha[1], light_specular_shininess_4[1]) +\n"
244 " diffuse_color * light_color_4[2].xyz * light_diffuse_power_4[2] * cos_theta[2] +\n"
245 " specular_color * light_color_4[2].xyz * light_specular_power_4[2] * pow(cos_alpha[2], light_specular_shininess_4[2]) +\n"
246 " diffuse_color * light_color_4[3].xyz * light_diffuse_power_4[3] * cos_theta[3] +\n"
247 " specular_color * light_color_4[3].xyz * light_specular_power_4[3] * pow(cos_alpha[3], light_specular_shininess_4[3]), 1);\n"
248 "}\n"
249 ;
250 
251 } // namespace open3d::glsl
252 
253 } // namespace open3d::visualization
254 
255 } // namespace open3d
256 
257 // clang-format on
258 // clang-format off
259 namespace open3d {
260 
261 namespace visualization {
262 
263 namespace glsl {
264 
265 const char * const PhongVertexShader =
266 "#version 330\n"
267 "\n"
268 "in vec3 vertex_position;\n"
269 "in vec3 vertex_normal;\n"
270 "in vec3 vertex_color;\n"
271 "\n"
272 "out vec3 vertex_position_world;\n"
273 "out vec3 vertex_normal_camera;\n"
274 "out vec3 eye_dir_camera;\n"
275 "out mat4 light_dir_camera_4;\n"
276 "out vec3 fragment_color;\n"
277 "\n"
278 "uniform mat4 MVP;\n"
279 "uniform mat4 V;\n"
280 "uniform mat4 M;\n"
281 "uniform mat4 light_position_world_4;\n"
282 "\n"
283 "void main()\n"
284 "{\n"
285 " gl_Position = MVP * vec4(vertex_position, 1);\n"
286 " vertex_position_world = (M * vec4(vertex_position, 1)).xyz;\n"
287 "\n"
288 " vec3 vertex_position_camera = (V * M * vec4(vertex_position, 1)).xyz;\n"
289 " eye_dir_camera = vec3(0, 0, 0) - vertex_position_camera;\n"
290 "\n"
291 " vec4 v = vec4(vertex_position_camera, 1);\n"
292 " light_dir_camera_4 = V * light_position_world_4 - mat4(v, v, v, v);\n"
293 "\n"
294 " vertex_normal_camera = (V * M * vec4(vertex_normal, 0)).xyz;\n"
295 " if (dot(eye_dir_camera, vertex_normal_camera) < 0.0)\n"
296 " vertex_normal_camera = vertex_normal_camera * -1.0;\n"
297 "\n"
298 " fragment_color = vertex_color;\n"
299 "}\n"
300 ;
301 
302 } // namespace open3d::glsl
303 
304 } // namespace open3d::visualization
305 
306 } // namespace open3d
307 
308 // clang-format on
309 // clang-format off
310 namespace open3d {
311 
312 namespace visualization {
313 
314 namespace glsl {
315 
316 const char * const PickingFragmentShader =
317 "#version 330\n"
318 "\n"
319 "in vec4 fragment_color;\n"
320 "out vec4 FragColor;\n"
321 "\n"
322 "void main()\n"
323 "{\n"
324 " FragColor = fragment_color;\n"
325 "}\n"
326 ;
327 
328 } // namespace open3d::glsl
329 
330 } // namespace open3d::visualization
331 
332 } // namespace open3d
333 
334 // clang-format on
335 // clang-format off
336 namespace open3d {
337 
338 namespace visualization {
339 
340 namespace glsl {
341 
342 const char * const PickingVertexShader =
343 "#version 330\n"
344 "\n"
345 "in vec3 vertex_position;\n"
346 "in float vertex_index;\n"
347 "uniform mat4 MVP;\n"
348 "\n"
349 "out vec4 fragment_color;\n"
350 "\n"
351 "void main()\n"
352 "{\n"
353 " float r, g, b, a;\n"
354 " gl_Position = MVP * vec4(vertex_position, 1);\n"
355 " r = floor(vertex_index / 16777216.0) / 255.0;\n"
356 " g = mod(floor(vertex_index / 65536.0), 256.0) / 255.0;\n"
357 " b = mod(floor(vertex_index / 256.0), 256.0) / 255.0;\n"
358 " a = mod(vertex_index, 256.0) / 255.0;\n"
359 " fragment_color = vec4(r, g, b, a);\n"
360 "}\n"
361 ;
362 
363 } // namespace open3d::glsl
364 
365 } // namespace open3d::visualization
366 
367 } // namespace open3d
368 
369 // clang-format on
370 // clang-format off
371 namespace open3d {
372 
373 namespace visualization {
374 
375 namespace glsl {
376 
377 const char * const RGBDImageFragmentShader =
378 "#version 330\n"
379 "\n"
380 "in vec2 UV;\n"
381 "uniform sampler2D image_texture;\n"
382 "\n"
383 "\n"
384 "/* built-in option to ensure RGB and D are handled in the same shader,\n"
385 " which can be used in 2 passes */\n"
386 "#define DEPTH_TEXTURE_MODE 0\n"
387 "#define RGB_TEXTURE_MODE 1\n"
388 "#define GRAYSCALE_TEXTURE_MODE 2\n"
389 "uniform int texture_mode;\n"
390 "\n"
391 "/* Decides the colormap of the depth image */\n"
392 "uniform float depth_max;\n"
393 "out vec4 FragColor;\n"
394 "\n"
395 "float Interpolate(float value, float y0, float x0, float y1, float x1) {\n"
396 " if (value < x0) return y0;\n"
397 " if (value > x1) return y1;\n"
398 " return (value - x0) * (y1 - y0) / (x1 - x0) + y0;\n"
399 "}\n"
400 "\n"
401 "float Jet(float value /* already clamped in [0, 1] */) {\n"
402 " if (value <= -0.75) {\n"
403 " return 0.0;\n"
404 " } else if (value <= -0.25) {\n"
405 " return Interpolate(value, 0.0, -0.75, 1.0, -0.25);\n"
406 " } else if (value <= 0.25) {\n"
407 " return 1.0;\n"
408 " } else if (value <= 0.75) {\n"
409 " return Interpolate(value, 1.0, 0.25, 0.0, 0.75);\n"
410 " } else {\n"
411 " return 0.0;\n"
412 " }\n"
413 "}\n"
414 "\n"
415 "void main() {\n"
416 " if (texture_mode == DEPTH_TEXTURE_MODE) {\n"
417 " float depth = texture(image_texture, UV).r;\n"
418 " depth = clamp(depth, 0, depth_max);\n"
419 " depth = depth / depth_max;\n"
420 " depth = 2 * depth - 1;\n"
421 " FragColor = vec4(Jet(depth - 0.5), Jet(depth), Jet(depth + 0.5), 1);\n"
422 " } else if (texture_mode == RGB_TEXTURE_MODE) {\n"
423 " FragColor = texture(image_texture, UV);\n"
424 " } else if (texture_mode == GRAYSCALE_TEXTURE_MODE) {\n"
425 " float scalar = texture(image_texture, UV).r;\n"
426 " FragColor = vec4(vec3(scalar), 1);\n"
427 " }\n"
428 "}\n"
429 ;
430 
431 } // namespace open3d::glsl
432 
433 } // namespace open3d::visualization
434 
435 } // namespace open3d
436 
437 // clang-format on
438 // clang-format off
439 namespace open3d {
440 
441 namespace visualization {
442 
443 namespace glsl {
444 
445 const char * const Simple2DFragmentShader =
446 "#version 330\n"
447 "\n"
448 "in vec3 fragment_color;\n"
449 "out vec4 FragColor;\n"
450 "\n"
451 "void main()\n"
452 "{\n"
453 " FragColor = vec4(fragment_color, 1);\n"
454 "}\n"
455 ;
456 
457 } // namespace open3d::glsl
458 
459 } // namespace open3d::visualization
460 
461 } // namespace open3d
462 
463 // clang-format on
464 // clang-format off
465 namespace open3d {
466 
467 namespace visualization {
468 
469 namespace glsl {
470 
471 const char * const Simple2DVertexShader =
472 "#version 330\n"
473 "\n"
474 "in vec3 vertex_position;\n"
475 "in vec3 vertex_color;\n"
476 "\n"
477 "out vec3 fragment_color;\n"
478 "\n"
479 "void main()\n"
480 "{\n"
481 " gl_Position = vec4(vertex_position, 1);\n"
482 " fragment_color = vertex_color;\n"
483 "}\n"
484 ;
485 
486 } // namespace open3d::glsl
487 
488 } // namespace open3d::visualization
489 
490 } // namespace open3d
491 
492 // clang-format on
493 // clang-format off
494 namespace open3d {
495 
496 namespace visualization {
497 
498 namespace glsl {
499 
500 const char * const SimpleBlackFragmentShader =
501 "#version 330\n"
502 "\n"
503 "out vec4 FragColor;\n"
504 "\n"
505 "void main()\n"
506 "{\n"
507 " FragColor = vec4(0.1, 0.1, 0.1, 1);\n"
508 "}\n"
509 ;
510 
511 } // namespace open3d::glsl
512 
513 } // namespace open3d::visualization
514 
515 } // namespace open3d
516 
517 // clang-format on
518 // clang-format off
519 namespace open3d {
520 
521 namespace visualization {
522 
523 namespace glsl {
524 
525 const char * const SimpleBlackVertexShader =
526 "#version 330\n"
527 "\n"
528 "in vec3 vertex_position;\n"
529 "uniform mat4 MVP;\n"
530 "\n"
531 "void main()\n"
532 "{\n"
533 " gl_Position = MVP * vec4(vertex_position, 1);\n"
534 "}\n"
535 ;
536 
537 } // namespace open3d::glsl
538 
539 } // namespace open3d::visualization
540 
541 } // namespace open3d
542 
543 // clang-format on
544 // clang-format off
545 namespace open3d {
546 
547 namespace visualization {
548 
549 namespace glsl {
550 
551 const char * const SimpleFragmentShader =
552 "#version 330\n"
553 "\n"
554 "in vec3 fragment_color;\n"
555 "out vec4 FragColor;\n"
556 "\n"
557 "void main()\n"
558 "{\n"
559 " FragColor = vec4(fragment_color, 1);\n"
560 "}\n"
561 ;
562 
563 } // namespace open3d::glsl
564 
565 } // namespace open3d::visualization
566 
567 } // namespace open3d
568 
569 // clang-format on
570 // clang-format off
571 namespace open3d {
572 
573 namespace visualization {
574 
575 namespace glsl {
576 
577 const char * const SimpleVertexShader =
578 "#version 330\n"
579 "\n"
580 "in vec3 vertex_position;\n"
581 "in vec3 vertex_color;\n"
582 "uniform mat4 MVP;\n"
583 "\n"
584 "out vec3 fragment_color;\n"
585 "\n"
586 "void main()\n"
587 "{\n"
588 " gl_Position = MVP * vec4(vertex_position, 1);\n"
589 " fragment_color = vertex_color;\n"
590 "}\n"
591 ;
592 
593 } // namespace open3d::glsl
594 
595 } // namespace open3d::visualization
596 
597 } // namespace open3d
598 
599 // clang-format on
600 // clang-format off
601 namespace open3d {
602 
603 namespace visualization {
604 
605 namespace glsl {
606 
607 const char * const TexturePhongFragmentShader =
608 "#version 330\n"
609 "\n"
610 "in vec3 vertex_position_world;\n"
611 "in vec3 vertex_normal_camera;\n"
612 "in vec3 eye_dir_camera;\n"
613 "in mat4 light_dir_camera_4;\n"
614 "in vec2 fragment_uv;\n"
615 "\n"
616 "uniform mat4 light_color_4;\n"
617 "uniform vec4 light_diffuse_power_4;\n"
618 "uniform vec4 light_specular_power_4;\n"
619 "uniform vec4 light_specular_shininess_4;\n"
620 "uniform vec4 light_ambient;\n"
621 "uniform sampler2D diffuse_texture;\n"
622 "\n"
623 "out vec4 FragColor;\n"
624 "\n"
625 "void main()\n"
626 "{\n"
627 " vec3 diffuse_color = texture(diffuse_texture, fragment_uv).rgb;\n"
628 " vec3 ambient_color = light_ambient.xyz * diffuse_color;\n"
629 " vec3 specular_color = vec3(1.0, 1.0, 1.0);\n"
630 " vec4 cos_theta;\n"
631 " vec4 cos_alpha;\n"
632 " vec3 n, e, l, r;\n"
633 "\n"
634 " n = normalize(vertex_normal_camera);\n"
635 " e = normalize(eye_dir_camera);\n"
636 " l = normalize(light_dir_camera_4[0].xyz);\n"
637 " r = reflect(-l, n);\n"
638 " cos_theta[0] = clamp(dot(n, l), 0, 1);\n"
639 " cos_alpha[0] = clamp(dot(e, r), 0, 1);\n"
640 "\n"
641 " l= normalize(light_dir_camera_4[1].xyz);\n"
642 " r = reflect(-l, n);\n"
643 " cos_theta[1] = clamp(dot(n, l), 0, 1);\n"
644 " cos_alpha[1] = clamp(dot(e, r), 0, 1);\n"
645 "\n"
646 " l= normalize(light_dir_camera_4[2].xyz);\n"
647 " r = reflect(-l, n);\n"
648 " cos_theta[2] = clamp(dot(n, l), 0, 1);\n"
649 " cos_alpha[2] = clamp(dot(e, r), 0, 1);\n"
650 "\n"
651 " l= normalize(light_dir_camera_4[3].xyz);\n"
652 " r = reflect(-l, n);\n"
653 " cos_theta[3] = clamp(dot(n, l), 0, 1);\n"
654 " cos_alpha[3] = clamp(dot(e, r), 0, 1);\n"
655 "\n"
656 " FragColor = vec4(ambient_color + \n"
657 " diffuse_color * light_color_4[0].xyz * light_diffuse_power_4[0] * cos_theta[0] +\n"
658 " specular_color * light_color_4[0].xyz * light_specular_power_4[0] * pow(cos_alpha[0], light_specular_shininess_4[0]) +\n"
659 " diffuse_color * light_color_4[1].xyz * light_diffuse_power_4[1] * cos_theta[1] +\n"
660 " specular_color * light_color_4[1].xyz * light_specular_power_4[1] * pow(cos_alpha[1], light_specular_shininess_4[1]) +\n"
661 " diffuse_color * light_color_4[2].xyz * light_diffuse_power_4[2] * cos_theta[2] +\n"
662 " specular_color * light_color_4[2].xyz * light_specular_power_4[2] * pow(cos_alpha[2], light_specular_shininess_4[2]) +\n"
663 " diffuse_color * light_color_4[3].xyz * light_diffuse_power_4[3] * cos_theta[3] +\n"
664 " specular_color * light_color_4[3].xyz * light_specular_power_4[3] * pow(cos_alpha[3], light_specular_shininess_4[3]), 1);\n"
665 "}\n"
666 ;
667 
668 } // namespace open3d::glsl
669 
670 } // namespace open3d::visualization
671 
672 } // namespace open3d
673 
674 // clang-format on
675 // clang-format off
676 namespace open3d {
677 
678 namespace visualization {
679 
680 namespace glsl {
681 
682 const char * const TexturePhongVertexShader =
683 "#version 330\n"
684 "\n"
685 "in vec3 vertex_position;\n"
686 "in vec3 vertex_normal;\n"
687 "in vec2 vertex_uv;\n"
688 "\n"
689 "out vec3 vertex_position_world;\n"
690 "out vec3 vertex_normal_camera;\n"
691 "out vec3 eye_dir_camera;\n"
692 "out mat4 light_dir_camera_4;\n"
693 "out vec2 fragment_uv;\n"
694 "\n"
695 "uniform mat4 MVP;\n"
696 "uniform mat4 V;\n"
697 "uniform mat4 M;\n"
698 "uniform mat4 light_position_world_4;\n"
699 "\n"
700 "void main()\n"
701 "{\n"
702 " gl_Position = MVP * vec4(vertex_position, 1);\n"
703 " vertex_position_world = (M * vec4(vertex_position, 1)).xyz;\n"
704 "\n"
705 " vec3 vertex_position_camera = (V * M * vec4(vertex_position, 1)).xyz;\n"
706 " eye_dir_camera = vec3(0, 0, 0) - vertex_position_camera;\n"
707 "\n"
708 " vec4 v = vec4(vertex_position_camera, 1);\n"
709 " light_dir_camera_4 = V * light_position_world_4 - mat4(v, v, v, v);\n"
710 "\n"
711 " vertex_normal_camera = (V * M * vec4(vertex_normal, 0)).xyz;\n"
712 " if (dot(eye_dir_camera, vertex_normal_camera) < 0.0)\n"
713 " vertex_normal_camera = vertex_normal_camera * -1.0;\n"
714 "\n"
715 " fragment_uv = vertex_uv;\n"
716 "}\n"
717 "\n"
718 ;
719 
720 } // namespace open3d::glsl
721 
722 } // namespace open3d::visualization
723 
724 } // namespace open3d
725 
726 // clang-format on
727 // clang-format off
728 namespace open3d {
729 
730 namespace visualization {
731 
732 namespace glsl {
733 
734 const char * const TextureSimpleFragmentShader =
735 "#version 330\n"
736 "\n"
737 "in vec2 fragment_uv;\n"
738 "out vec4 FragColor;\n"
739 "\n"
740 "uniform sampler2D diffuse_texture;\n"
741 "\n"
742 "void main()\n"
743 "{\n"
744 " FragColor = texture(diffuse_texture, fragment_uv);\n"
745 "}\n"
746 ;
747 
748 } // namespace open3d::glsl
749 
750 } // namespace open3d::visualization
751 
752 } // namespace open3d
753 
754 // clang-format on
755 // clang-format off
756 namespace open3d {
757 
758 namespace visualization {
759 
760 namespace glsl {
761 
762 const char * const TextureSimpleVertexShader =
763 "#version 330\n"
764 "\n"
765 "in vec3 vertex_position;\n"
766 "in vec2 vertex_uv;\n"
767 "uniform mat4 MVP;\n"
768 "\n"
769 "out vec2 fragment_uv;\n"
770 "\n"
771 "void main()\n"
772 "{\n"
773 " gl_Position = MVP * vec4(vertex_position, 1);\n"
774 " fragment_uv = vertex_uv;\n"
775 "}\n"
776 ;
777 
778 } // namespace open3d::glsl
779 
780 } // namespace open3d::visualization
781 
782 } // namespace open3d
783 
784 // clang-format on
const char *const PhongFragmentShader
Definition: Shader.h:191
const char *const TextureSimpleVertexShader
Definition: Shader.h:762
const char *const PickingVertexShader
Definition: Shader.h:342
const char *const TexturePhongVertexShader
Definition: Shader.h:682
const char *const PickingFragmentShader
Definition: Shader.h:316
const char *const ImageFragmentShader
Definition: Shader.h:13
const char *const TextureSimpleFragmentShader
Definition: Shader.h:734
const char *const ImageMaskFragmentShader
Definition: Shader.h:41
const char *const Simple2DVertexShader
Definition: Shader.h:471
const char *const NormalFragmentShader
Definition: Shader.h:132
const char *const TexturePhongFragmentShader
Definition: Shader.h:607
const char *const RGBDImageFragmentShader
Definition: Shader.h:377
Definition: Open3DViewer.h:29
const char *const PhongVertexShader
Definition: Shader.h:265
const char *const ImageMaskVertexShader
Definition: Shader.h:72
const char *const SimpleBlackFragmentShader
Definition: Shader.h:500
const char *const ImageVertexShader
Definition: Shader.h:101
const char *const SimpleVertexShader
Definition: Shader.h:577
const char *const Simple2DFragmentShader
Definition: Shader.h:445
const char *const SimpleBlackVertexShader
Definition: Shader.h:525
const char *const SimpleFragmentShader
Definition: Shader.h:551
const char *const NormalVertexShader
Definition: Shader.h:158