From 783256d8e16af5d36a95f064e77e80dd3bec78ae Mon Sep 17 00:00:00 2001 From: David Gossow Date: Thu, 7 Feb 2013 10:59:07 -0800 Subject: [PATCH 1/2] separated shaders into glsl120 and glsl150, added explicit gl version detection --- .../materials/glsl/glsl_programs.program | 202 ------------------ .../materials/{glsl => glsl120}/black.frag | 0 .../materials/{glsl => glsl120}/depth.frag | 0 .../materials/{glsl => glsl120}/depth.vert | 0 .../{glsl => glsl120}/depth_circle.frag | 0 .../{glsl => glsl120}/flat_color.frag | 0 .../{glsl => glsl120}/flat_color_circle.frag | 0 ogre_media/materials/glsl120/glsl120.program | 152 +++++++++++++ .../include/circle_impl.frag | 0 .../{glsl => glsl120}/include/pack_depth.frag | 0 .../{glsl => glsl120}/include/pass_depth.vert | 0 .../materials/{glsl => glsl120}/nogp.program | 26 +-- .../{glsl => glsl120}/nogp/billboard.vert | 1 - .../nogp/billboard_tile.vert | 0 .../materials/{glsl => glsl120}/nogp/box.frag | 0 .../materials/{glsl => glsl120}/nogp/box.vert | 0 .../{glsl => glsl120}/pass_color.frag | 0 .../{glsl => glsl120}/pass_color_circle.frag | 0 .../{glsl => glsl120}/pickcolor.frag | 0 .../{glsl => glsl120}/pickcolor_circle.frag | 0 .../materials/{glsl => glsl120}/point.vert | 0 .../{glsl => glsl120}/shaded_circle.frag | 0 .../{glsl => glsl120}/smooth_square.frag | 0 .../materials/{glsl => glsl120}/test_glsl.sh | 0 .../materials/{glsl => glsl150}/box.geom | 0 ogre_media/materials/glsl150/glsl150.program | 50 +++++ .../{glsl => glsl150}/pass_pos_color.vert | 0 .../scripts/default_pick_and_depth.material | 16 +- .../scripts/point_cloud_box.material | 96 --------- .../scripts/point_cloud_flat_square.material | 16 +- .../scripts/point_cloud_point.material | 16 +- .../scripts/point_cloud_sphere.material | 16 +- .../scripts/point_cloud_square.material | 16 +- .../scripts/point_cloud_tile.material | 16 +- .../scripts120/point_cloud_box.material | 45 ++++ .../scripts150/point_cloud_box.material | 59 +++++ src/rviz/ogre_helpers/render_system.cpp | 59 ++++- src/rviz/ogre_helpers/render_system.h | 10 + 38 files changed, 432 insertions(+), 364 deletions(-) delete mode 100644 ogre_media/materials/glsl/glsl_programs.program rename ogre_media/materials/{glsl => glsl120}/black.frag (100%) rename ogre_media/materials/{glsl => glsl120}/depth.frag (100%) rename ogre_media/materials/{glsl => glsl120}/depth.vert (100%) rename ogre_media/materials/{glsl => glsl120}/depth_circle.frag (100%) rename ogre_media/materials/{glsl => glsl120}/flat_color.frag (100%) rename ogre_media/materials/{glsl => glsl120}/flat_color_circle.frag (100%) create mode 100644 ogre_media/materials/glsl120/glsl120.program rename ogre_media/materials/{glsl => glsl120}/include/circle_impl.frag (100%) rename ogre_media/materials/{glsl => glsl120}/include/pack_depth.frag (100%) rename ogre_media/materials/{glsl => glsl120}/include/pass_depth.vert (100%) rename ogre_media/materials/{glsl => glsl120}/nogp.program (72%) rename ogre_media/materials/{glsl => glsl120}/nogp/billboard.vert (97%) rename ogre_media/materials/{glsl => glsl120}/nogp/billboard_tile.vert (100%) rename ogre_media/materials/{glsl => glsl120}/nogp/box.frag (100%) rename ogre_media/materials/{glsl => glsl120}/nogp/box.vert (100%) rename ogre_media/materials/{glsl => glsl120}/pass_color.frag (100%) rename ogre_media/materials/{glsl => glsl120}/pass_color_circle.frag (100%) rename ogre_media/materials/{glsl => glsl120}/pickcolor.frag (100%) rename ogre_media/materials/{glsl => glsl120}/pickcolor_circle.frag (100%) rename ogre_media/materials/{glsl => glsl120}/point.vert (100%) rename ogre_media/materials/{glsl => glsl120}/shaded_circle.frag (100%) rename ogre_media/materials/{glsl => glsl120}/smooth_square.frag (100%) rename ogre_media/materials/{glsl => glsl120}/test_glsl.sh (100%) rename ogre_media/materials/{glsl => glsl150}/box.geom (100%) create mode 100644 ogre_media/materials/glsl150/glsl150.program rename ogre_media/materials/{glsl => glsl150}/pass_pos_color.vert (100%) delete mode 100644 ogre_media/materials/scripts/point_cloud_box.material create mode 100644 ogre_media/materials/scripts120/point_cloud_box.material create mode 100644 ogre_media/materials/scripts150/point_cloud_box.material diff --git a/ogre_media/materials/glsl/glsl_programs.program b/ogre_media/materials/glsl/glsl_programs.program deleted file mode 100644 index 292ec28aec..0000000000 --- a/ogre_media/materials/glsl/glsl_programs.program +++ /dev/null @@ -1,202 +0,0 @@ - -//includes: -fragment_program rviz/include/circle_impl.frag glsl { source include/circle_impl.frag } -fragment_program rviz/include/pack_depth.frag glsl { source include/pack_depth.frag } -vertex_program rviz/include/pass_depth.vert glsl { source include/pass_depth.vert } - -//all shaders, sorted by name - - -geometry_program rviz/box.geom glsl -{ - source box.geom - input_operation_type points - output_operation_type triangle_strip - max_output_vertices 24 - default_params - { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto size custom 0 - param_named_auto auto_size custom 6 - } -} -geometry_program rviz/box.geom(with_depth) glsl -{ - source box.geom - input_operation_type points - output_operation_type triangle_strip - max_output_vertices 24 - preprocessor_defines WITH_DEPTH=1 - default_params - { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto worldview_matrix worldview_matrix - param_named_auto size custom 0 - param_named_auto auto_size custom 6 - } -} -geometry_program rviz/box.geom(with_lighting) glsl -{ - source box.geom - input_operation_type points - output_operation_type triangle_strip - max_output_vertices 24 - preprocessor_defines WITH_LIGHTING=1 - default_params - { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto size custom 0 - param_named_auto auto_size custom 6 - } -} - - -fragment_program rviz/depth_circle.frag glsl -{ - source depth_circle.frag - attach rviz/include/pack_depth.frag - attach rviz/include/circle_impl.frag - default_params - { - param_named_auto alpha custom 1 - param_named_auto far_clip_distance far_clip_distance - } -} - - -fragment_program rviz/depth.frag glsl -{ - source depth.frag - attach rviz/include/pack_depth.frag - default_params - { - param_named_auto alpha custom 1 - param_named_auto far_clip_distance far_clip_distance - } -} - - -vertex_program rviz/depth.vert glsl -{ - source depth.vert - preprocessor_defines WITH_DEPTH=1 - attach rviz/include/pass_depth.vert - default_params { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto worldview_matrix worldview_matrix - } -} - - -fragment_program rviz/flat_color.frag glsl -{ - source flat_color.frag - default_params - { - param_named_auto highlight custom 5 - param_named_auto alpha custom 1 - } -} - - -fragment_program rviz/flat_color_circle.frag glsl -{ - source flat_color_circle.frag - attach rviz/include/circle_impl.frag - default_params - { - param_named_auto highlight custom 5 - param_named_auto alpha custom 1 - } -} - - -fragment_program rviz/pass_color_circle.frag glsl -{ - source pass_color_circle.frag - attach rviz/include/circle_impl.frag -} - - -fragment_program rviz/pass_color.frag glsl -{ - source pass_color.frag -} - - -vertex_program rviz/pass_pos_color.vert glsl -{ - source pass_pos_color.vert -} - - -fragment_program rviz/pickcolor_circle.frag glsl -{ - source pickcolor_circle.frag - attach rviz/include/circle_impl.frag - default_params - { - param_named_auto pick_color custom 2 - } -} - - -fragment_program rviz/pickcolor.frag glsl -{ - source pickcolor.frag - default_params - { - param_named_auto pick_color custom 2 - } -} - - -fragment_program rviz/black.frag glsl -{ - source black.frag -} - - -vertex_program rviz/point.vert glsl -{ - source point.vert - default_params { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto size custom 0 - } -} -vertex_program rviz/point.vert(with_depth) glsl -{ - source point.vert - preprocessor_defines WITH_DEPTH=1 - attach rviz/include/pass_depth.vert - default_params { - param_named_auto worldviewproj_matrix worldviewproj_matrix - param_named_auto worldview_matrix worldview_matrix - param_named_auto size custom 0 - } -} - - - -fragment_program rviz/shaded_circle.frag glsl -{ - source shaded_circle.frag - default_params - { - param_named_auto highlight custom 5 - param_named_auto alpha custom 1 - } -} - - -fragment_program rviz/smooth_square.frag glsl -{ - source smooth_square.frag - default_params - { - param_named_auto highlight custom 5 - param_named_auto alpha custom 1 - } -} - diff --git a/ogre_media/materials/glsl/black.frag b/ogre_media/materials/glsl120/black.frag similarity index 100% rename from ogre_media/materials/glsl/black.frag rename to ogre_media/materials/glsl120/black.frag diff --git a/ogre_media/materials/glsl/depth.frag b/ogre_media/materials/glsl120/depth.frag similarity index 100% rename from ogre_media/materials/glsl/depth.frag rename to ogre_media/materials/glsl120/depth.frag diff --git a/ogre_media/materials/glsl/depth.vert b/ogre_media/materials/glsl120/depth.vert similarity index 100% rename from ogre_media/materials/glsl/depth.vert rename to ogre_media/materials/glsl120/depth.vert diff --git a/ogre_media/materials/glsl/depth_circle.frag b/ogre_media/materials/glsl120/depth_circle.frag similarity index 100% rename from ogre_media/materials/glsl/depth_circle.frag rename to ogre_media/materials/glsl120/depth_circle.frag diff --git a/ogre_media/materials/glsl/flat_color.frag b/ogre_media/materials/glsl120/flat_color.frag similarity index 100% rename from ogre_media/materials/glsl/flat_color.frag rename to ogre_media/materials/glsl120/flat_color.frag diff --git a/ogre_media/materials/glsl/flat_color_circle.frag b/ogre_media/materials/glsl120/flat_color_circle.frag similarity index 100% rename from ogre_media/materials/glsl/flat_color_circle.frag rename to ogre_media/materials/glsl120/flat_color_circle.frag diff --git a/ogre_media/materials/glsl120/glsl120.program b/ogre_media/materials/glsl120/glsl120.program new file mode 100644 index 0000000000..d88d4402c4 --- /dev/null +++ b/ogre_media/materials/glsl120/glsl120.program @@ -0,0 +1,152 @@ + +//includes: +fragment_program rviz/glsl120/include/circle_impl.frag glsl { source include/circle_impl.frag } +fragment_program rviz/glsl120/include/pack_depth.frag glsl { source include/pack_depth.frag } +vertex_program rviz/glsl120/include/pass_depth.vert glsl { source include/pass_depth.vert } + +//all shaders, sorted by name + + +fragment_program rviz/glsl120/depth_circle.frag glsl +{ + source depth_circle.frag + attach rviz/glsl120/include/pack_depth.frag + attach rviz/glsl120/include/circle_impl.frag + default_params + { + param_named_auto alpha custom 1 + param_named_auto far_clip_distance far_clip_distance + } +} + + +fragment_program rviz/glsl120/depth.frag glsl +{ + source depth.frag + attach rviz/glsl120/include/pack_depth.frag + default_params + { + param_named_auto alpha custom 1 + param_named_auto far_clip_distance far_clip_distance + } +} + + +vertex_program rviz/glsl120/depth.vert glsl +{ + source depth.vert + preprocessor_defines WITH_DEPTH=1 + attach rviz/glsl120/include/pass_depth.vert + default_params { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto worldview_matrix worldview_matrix + } +} + + +fragment_program rviz/glsl120/flat_color.frag glsl +{ + source flat_color.frag + default_params + { + param_named_auto highlight custom 5 + param_named_auto alpha custom 1 + } +} + + +fragment_program rviz/glsl120/flat_color_circle.frag glsl +{ + source flat_color_circle.frag + attach rviz/glsl120/include/circle_impl.frag + default_params + { + param_named_auto highlight custom 5 + param_named_auto alpha custom 1 + } +} + + +fragment_program rviz/glsl120/pass_color_circle.frag glsl +{ + source pass_color_circle.frag + attach rviz/glsl120/include/circle_impl.frag +} + + +fragment_program rviz/glsl120/pass_color.frag glsl +{ + source pass_color.frag +} + + +fragment_program rviz/glsl120/pickcolor_circle.frag glsl +{ + source pickcolor_circle.frag + attach rviz/glsl120/include/circle_impl.frag + default_params + { + param_named_auto pick_color custom 2 + } +} + + +fragment_program rviz/glsl120/pickcolor.frag glsl +{ + source pickcolor.frag + default_params + { + param_named_auto pick_color custom 2 + } +} + + +fragment_program rviz/glsl120/black.frag glsl +{ + source black.frag +} + + +vertex_program rviz/glsl120/point.vert glsl +{ + source point.vert + default_params { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto size custom 0 + } +} +vertex_program rviz/glsl120/point.vert(with_depth) glsl +{ + source point.vert + preprocessor_defines WITH_DEPTH=1 + attach rviz/glsl120/include/pass_depth.vert + default_params { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto worldview_matrix worldview_matrix + param_named_auto size custom 0 + } +} + + + +fragment_program rviz/glsl120/shaded_circle.frag glsl +{ + source shaded_circle.frag + default_params + { + param_named_auto highlight custom 5 + param_named_auto alpha custom 1 + } +} + + +fragment_program rviz/glsl120/smooth_square.frag glsl +{ + source smooth_square.frag + default_params + { + param_named_auto highlight custom 5 + param_named_auto alpha custom 1 + } +} + diff --git a/ogre_media/materials/glsl/include/circle_impl.frag b/ogre_media/materials/glsl120/include/circle_impl.frag similarity index 100% rename from ogre_media/materials/glsl/include/circle_impl.frag rename to ogre_media/materials/glsl120/include/circle_impl.frag diff --git a/ogre_media/materials/glsl/include/pack_depth.frag b/ogre_media/materials/glsl120/include/pack_depth.frag similarity index 100% rename from ogre_media/materials/glsl/include/pack_depth.frag rename to ogre_media/materials/glsl120/include/pack_depth.frag diff --git a/ogre_media/materials/glsl/include/pass_depth.vert b/ogre_media/materials/glsl120/include/pass_depth.vert similarity index 100% rename from ogre_media/materials/glsl/include/pass_depth.vert rename to ogre_media/materials/glsl120/include/pass_depth.vert diff --git a/ogre_media/materials/glsl/nogp.program b/ogre_media/materials/glsl120/nogp.program similarity index 72% rename from ogre_media/materials/glsl/nogp.program rename to ogre_media/materials/glsl120/nogp.program index dca2a313d2..1ef8f1f243 100644 --- a/ogre_media/materials/glsl/nogp.program +++ b/ogre_media/materials/glsl120/nogp.program @@ -5,11 +5,11 @@ //includes: -fragment_program rviz/include/circle_impl.frag glsl { source include/circle_impl.frag } -fragment_program rviz/include/pack_depth.frag glsl { source include/pack_depth.frag } -vertex_program rviz/include/pass_depth.vert glsl { source include/pass_depth.vert } +fragment_program rviz/glsl120/include/circle_impl.frag glsl { source include/circle_impl.frag } +fragment_program rviz/glsl120/include/pack_depth.frag glsl { source include/pack_depth.frag } +vertex_program rviz/glsl120/include/pass_depth.vert glsl { source include/pass_depth.vert } -vertex_program rviz/nogp/billboard_tile.vert glsl +vertex_program rviz/glsl120/nogp/billboard_tile.vert glsl { source nogp/billboard_tile.vert default_params @@ -20,11 +20,11 @@ vertex_program rviz/nogp/billboard_tile.vert glsl param_named_auto up custom 4 } } -vertex_program rviz/nogp/billboard_tile.vert(with_depth) glsl +vertex_program rviz/glsl120/nogp/billboard_tile.vert(with_depth) glsl { source nogp/billboard_tile.vert preprocessor_defines WITH_DEPTH=1 - attach rviz/include/pass_depth.vert + attach rviz/glsl120/include/pass_depth.vert default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix @@ -36,7 +36,7 @@ vertex_program rviz/nogp/billboard_tile.vert(with_depth) glsl } -vertex_program rviz/nogp/billboard.vert glsl +vertex_program rviz/glsl120/nogp/billboard.vert glsl { source nogp/billboard.vert default_params { @@ -46,11 +46,11 @@ vertex_program rviz/nogp/billboard.vert glsl param_named_auto auto_size custom 6 } } -vertex_program rviz/nogp/billboard.vert(with_depth) glsl +vertex_program rviz/glsl120/nogp/billboard.vert(with_depth) glsl { source nogp/billboard.vert preprocessor_defines WITH_DEPTH=1 - attach rviz/include/pass_depth.vert + attach rviz/glsl120/include/pass_depth.vert default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix param_named_auto worldview_matrix worldview_matrix @@ -61,7 +61,7 @@ vertex_program rviz/nogp/billboard.vert(with_depth) glsl } -vertex_program rviz/nogp/box.vert glsl +vertex_program rviz/glsl120/nogp/box.vert glsl { source nogp/box.vert default_params { @@ -70,11 +70,11 @@ vertex_program rviz/nogp/box.vert glsl param_named_auto auto_size custom 6 } } -vertex_program rviz/nogp/box.vert(with_depth) glsl +vertex_program rviz/glsl120/nogp/box.vert(with_depth) glsl { source nogp/box.vert preprocessor_defines WITH_DEPTH=1 - attach rviz/include/pass_depth.vert + attach rviz/glsl120/include/pass_depth.vert default_params { param_named_auto worldviewproj_matrix worldviewproj_matrix param_named_auto worldview_matrix worldview_matrix @@ -84,7 +84,7 @@ vertex_program rviz/nogp/box.vert(with_depth) glsl } -fragment_program rviz/nogp/box.frag glsl +fragment_program rviz/glsl120/nogp/box.frag glsl { source nogp/box.frag default_params diff --git a/ogre_media/materials/glsl/nogp/billboard.vert b/ogre_media/materials/glsl120/nogp/billboard.vert similarity index 97% rename from ogre_media/materials/glsl/nogp/billboard.vert rename to ogre_media/materials/glsl120/nogp/billboard.vert index 0e0f878f9d..70249a1697 100644 --- a/ogre_media/materials/glsl/nogp/billboard.vert +++ b/ogre_media/materials/glsl120/nogp/billboard.vert @@ -6,7 +6,6 @@ // of the billboard we compute. uniform mat4 worldviewproj_matrix; -uniform mat4 worldview_matrix; uniform vec4 camera_pos; uniform vec4 size; uniform vec4 auto_size; diff --git a/ogre_media/materials/glsl/nogp/billboard_tile.vert b/ogre_media/materials/glsl120/nogp/billboard_tile.vert similarity index 100% rename from ogre_media/materials/glsl/nogp/billboard_tile.vert rename to ogre_media/materials/glsl120/nogp/billboard_tile.vert diff --git a/ogre_media/materials/glsl/nogp/box.frag b/ogre_media/materials/glsl120/nogp/box.frag similarity index 100% rename from ogre_media/materials/glsl/nogp/box.frag rename to ogre_media/materials/glsl120/nogp/box.frag diff --git a/ogre_media/materials/glsl/nogp/box.vert b/ogre_media/materials/glsl120/nogp/box.vert similarity index 100% rename from ogre_media/materials/glsl/nogp/box.vert rename to ogre_media/materials/glsl120/nogp/box.vert diff --git a/ogre_media/materials/glsl/pass_color.frag b/ogre_media/materials/glsl120/pass_color.frag similarity index 100% rename from ogre_media/materials/glsl/pass_color.frag rename to ogre_media/materials/glsl120/pass_color.frag diff --git a/ogre_media/materials/glsl/pass_color_circle.frag b/ogre_media/materials/glsl120/pass_color_circle.frag similarity index 100% rename from ogre_media/materials/glsl/pass_color_circle.frag rename to ogre_media/materials/glsl120/pass_color_circle.frag diff --git a/ogre_media/materials/glsl/pickcolor.frag b/ogre_media/materials/glsl120/pickcolor.frag similarity index 100% rename from ogre_media/materials/glsl/pickcolor.frag rename to ogre_media/materials/glsl120/pickcolor.frag diff --git a/ogre_media/materials/glsl/pickcolor_circle.frag b/ogre_media/materials/glsl120/pickcolor_circle.frag similarity index 100% rename from ogre_media/materials/glsl/pickcolor_circle.frag rename to ogre_media/materials/glsl120/pickcolor_circle.frag diff --git a/ogre_media/materials/glsl/point.vert b/ogre_media/materials/glsl120/point.vert similarity index 100% rename from ogre_media/materials/glsl/point.vert rename to ogre_media/materials/glsl120/point.vert diff --git a/ogre_media/materials/glsl/shaded_circle.frag b/ogre_media/materials/glsl120/shaded_circle.frag similarity index 100% rename from ogre_media/materials/glsl/shaded_circle.frag rename to ogre_media/materials/glsl120/shaded_circle.frag diff --git a/ogre_media/materials/glsl/smooth_square.frag b/ogre_media/materials/glsl120/smooth_square.frag similarity index 100% rename from ogre_media/materials/glsl/smooth_square.frag rename to ogre_media/materials/glsl120/smooth_square.frag diff --git a/ogre_media/materials/glsl/test_glsl.sh b/ogre_media/materials/glsl120/test_glsl.sh similarity index 100% rename from ogre_media/materials/glsl/test_glsl.sh rename to ogre_media/materials/glsl120/test_glsl.sh diff --git a/ogre_media/materials/glsl/box.geom b/ogre_media/materials/glsl150/box.geom similarity index 100% rename from ogre_media/materials/glsl/box.geom rename to ogre_media/materials/glsl150/box.geom diff --git a/ogre_media/materials/glsl150/glsl150.program b/ogre_media/materials/glsl150/glsl150.program new file mode 100644 index 0000000000..a36483fa01 --- /dev/null +++ b/ogre_media/materials/glsl150/glsl150.program @@ -0,0 +1,50 @@ +//all shaders, sorted by name + +geometry_program rviz/box.geom glsl +{ + source box.geom + input_operation_type points + output_operation_type triangle_strip + max_output_vertices 24 + default_params + { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto size custom 0 + param_named_auto auto_size custom 6 + } +} +geometry_program rviz/box.geom(with_depth) glsl +{ + source box.geom + input_operation_type points + output_operation_type triangle_strip + max_output_vertices 24 + preprocessor_defines WITH_DEPTH=1 + default_params + { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto worldview_matrix worldview_matrix + param_named_auto size custom 0 + param_named_auto auto_size custom 6 + } +} +geometry_program rviz/box.geom(with_lighting) glsl +{ + source box.geom + input_operation_type points + output_operation_type triangle_strip + max_output_vertices 24 + preprocessor_defines WITH_LIGHTING=1 + default_params + { + param_named_auto worldviewproj_matrix worldviewproj_matrix + param_named_auto size custom 0 + param_named_auto auto_size custom 6 + } +} + +vertex_program rviz/pass_pos_color.vert glsl +{ + source pass_pos_color.vert +} + diff --git a/ogre_media/materials/glsl/pass_pos_color.vert b/ogre_media/materials/glsl150/pass_pos_color.vert similarity index 100% rename from ogre_media/materials/glsl/pass_pos_color.vert rename to ogre_media/materials/glsl150/pass_pos_color.vert diff --git a/ogre_media/materials/scripts/default_pick_and_depth.material b/ogre_media/materials/scripts/default_pick_and_depth.material index eef5290f96..bc9a8e6603 100644 --- a/ogre_media/materials/scripts/default_pick_and_depth.material +++ b/ogre_media/materials/scripts/default_pick_and_depth.material @@ -7,7 +7,7 @@ material rviz/DefaultPickAndDepth lighting off scene_blend one zero cull_hardware clockwise - fragment_program_ref rviz/pickcolor.frag {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} } } @@ -18,7 +18,7 @@ material rviz/DefaultPickAndDepth lighting off scene_blend one zero cull_hardware clockwise - fragment_program_ref rviz/black.frag {} + fragment_program_ref rviz/glsl120/black.frag {} } } @@ -28,8 +28,8 @@ material rviz/DefaultPickAndDepth { scene_blend one zero cull_hardware clockwise - vertex_program_ref rviz/depth.vert {} - fragment_program_ref rviz/depth.frag {} + vertex_program_ref rviz/glsl120/depth.vert {} + fragment_program_ref rviz/glsl120/depth.frag {} } } @@ -40,7 +40,7 @@ material rviz/DefaultPickAndDepth lighting off scene_blend one zero cull_hardware none - fragment_program_ref rviz/pickcolor.frag {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} } } @@ -51,7 +51,7 @@ material rviz/DefaultPickAndDepth lighting off scene_blend one zero cull_hardware none - fragment_program_ref rviz/black.frag {} + fragment_program_ref rviz/glsl120/black.frag {} } } @@ -61,8 +61,8 @@ material rviz/DefaultPickAndDepth { scene_blend one zero cull_hardware none - vertex_program_ref rviz/depth.vert {} - fragment_program_ref rviz/depth.frag {} + vertex_program_ref rviz/glsl120/depth.vert {} + fragment_program_ref rviz/glsl120/depth.frag {} } } } diff --git a/ogre_media/materials/scripts/point_cloud_box.material b/ogre_media/materials/scripts/point_cloud_box.material deleted file mode 100644 index 526ccbc082..0000000000 --- a/ogre_media/materials/scripts/point_cloud_box.material +++ /dev/null @@ -1,96 +0,0 @@ -material rviz/PointCloudBox -{ - // the 'gp' techniques need one input vertex per box - // and use geometry shaders to create the geometry - - technique gp - { - // This will disable the technique on a Mac - gpu_device_rule exclude OpenGL Engine - pass - { - vertex_program_ref rviz/pass_pos_color.vert {} - geometry_program_ref rviz/box.geom(with_lighting) {} - fragment_program_ref rviz/smooth_square.frag {} - } - } - - technique gp_depth - { - // This will disable the technique on a Mac - gpu_device_rule exclude OpenGL Engine - scheme Depth - pass - { - vertex_program_ref rviz/pass_pos_color.vert {} - geometry_program_ref rviz/box.geom(with_depth) {} - fragment_program_ref rviz/depth.frag {} - } - } - - technique gp_selection_first_pass - { - // This will disable the technique on a Mac - gpu_device_rule exclude OpenGL Engine - scheme Pick - pass - { - vertex_program_ref rviz/pass_pos_color.vert {} - geometry_program_ref rviz/box.geom {} - fragment_program_ref rviz/pickcolor.frag {} - } - } - - technique gp_selection_second_pass - { - // This will disable the technique on a Mac - gpu_device_rule exclude OpenGL Engine - scheme Pick1 - pass - { - vertex_program_ref rviz/pass_pos_color.vert {} - geometry_program_ref rviz/box.geom {} - fragment_program_ref rviz/pass_color.frag {} - } - } - - /* the 'nogp' techniques require the full box geometry as input */ - technique nogp - { - pass - { - vertex_program_ref rviz/nogp/box.vert {} - fragment_program_ref rviz/nogp/box.frag {} - } - } - - technique nogp_depth - { - scheme Depth - pass - { - vertex_program_ref rviz/nogp/box.vert(with_depth) {} - fragment_program_ref rviz/depth.frag {} - } - } - - technique nogp_selection_first_pass - { - scheme Pick - pass - { - vertex_program_ref rviz/nogp/box.vert {} - fragment_program_ref rviz/pickcolor.frag {} - } - } - - technique nogp_selection_second_pass - { - scheme Pick1 - pass - { - vertex_program_ref rviz/nogp/box.vert {} - fragment_program_ref rviz/pass_color.frag {} - } - } -} diff --git a/ogre_media/materials/scripts/point_cloud_flat_square.material b/ogre_media/materials/scripts/point_cloud_flat_square.material index caff39b859..dc37af2fff 100644 --- a/ogre_media/materials/scripts/point_cloud_flat_square.material +++ b/ogre_media/materials/scripts/point_cloud_flat_square.material @@ -3,8 +3,8 @@ material rviz/PointCloudFlatSquare { technique nogp { pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/flat_color.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/flat_color.frag {} } } @@ -12,16 +12,16 @@ material rviz/PointCloudFlatSquare { scheme Depth pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert(with_depth) {} - fragment_program_ref rviz/depth.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth.frag {} } } technique nogp_selection_first_pass { scheme Pick pass { - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pickcolor.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} } } @@ -29,8 +29,8 @@ material rviz/PointCloudFlatSquare { scheme Pick1 pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pass_color.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pass_color.frag {} } } } diff --git a/ogre_media/materials/scripts/point_cloud_point.material b/ogre_media/materials/scripts/point_cloud_point.material index 952f0a4750..9357a20ddf 100644 --- a/ogre_media/materials/scripts/point_cloud_point.material +++ b/ogre_media/materials/scripts/point_cloud_point.material @@ -7,8 +7,8 @@ material rviz/PointCloudPoint alpha_rejection greater_equal 1 point_size_attenuation on point_sprites on - vertex_program_ref rviz/point.vert {} - fragment_program_ref rviz/flat_color_circle.frag {} + vertex_program_ref rviz/glsl120/point.vert {} + fragment_program_ref rviz/glsl120/flat_color_circle.frag {} } } @@ -18,8 +18,8 @@ material rviz/PointCloudPoint pass { point_size_attenuation on - vertex_program_ref rviz/point.vert(with_depth) {} - fragment_program_ref rviz/depth_circle.frag {} + vertex_program_ref rviz/glsl120/point.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth_circle.frag {} } } @@ -29,8 +29,8 @@ material rviz/PointCloudPoint pass { point_size_attenuation on - vertex_program_ref rviz/point.vert {} - fragment_program_ref rviz/pickcolor_circle.frag {} + vertex_program_ref rviz/glsl120/point.vert {} + fragment_program_ref rviz/glsl120/pickcolor_circle.frag {} } } @@ -40,8 +40,8 @@ material rviz/PointCloudPoint pass { point_size_attenuation on - vertex_program_ref rviz/point.vert {} - fragment_program_ref rviz/pass_color_circle.frag {} + vertex_program_ref rviz/glsl120/point.vert {} + fragment_program_ref rviz/glsl120/pass_color_circle.frag {} } } } diff --git a/ogre_media/materials/scripts/point_cloud_sphere.material b/ogre_media/materials/scripts/point_cloud_sphere.material index 581c3a55db..1e6a122746 100644 --- a/ogre_media/materials/scripts/point_cloud_sphere.material +++ b/ogre_media/materials/scripts/point_cloud_sphere.material @@ -3,8 +3,8 @@ material rviz/PointCloudSphere { technique nogp { pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/shaded_circle.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/shaded_circle.frag {} } } @@ -12,8 +12,8 @@ material rviz/PointCloudSphere { scheme Depth pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert(with_depth) {} - fragment_program_ref rviz/depth_circle.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth_circle.frag {} } } @@ -21,8 +21,8 @@ material rviz/PointCloudSphere { scheme Pick pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pickcolor_circle.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pickcolor_circle.frag {} } } @@ -30,8 +30,8 @@ material rviz/PointCloudSphere { scheme Pick1 pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pass_color_circle.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pass_color_circle.frag {} } } diff --git a/ogre_media/materials/scripts/point_cloud_square.material b/ogre_media/materials/scripts/point_cloud_square.material index fb1c759260..a47db4aad9 100644 --- a/ogre_media/materials/scripts/point_cloud_square.material +++ b/ogre_media/materials/scripts/point_cloud_square.material @@ -3,8 +3,8 @@ material rviz/PointCloudSquare { technique nogp { pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/smooth_square.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/smooth_square.frag {} } } @@ -12,16 +12,16 @@ material rviz/PointCloudSquare { scheme Depth pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert(with_depth) {} - fragment_program_ref rviz/depth.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth.frag {} } } technique nogp_selection_first_pass { scheme Pick pass { - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pickcolor.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} } } @@ -29,8 +29,8 @@ material rviz/PointCloudSquare { scheme Pick1 pass { alpha_rejection greater_equal 1 - vertex_program_ref rviz/nogp/billboard.vert {} - fragment_program_ref rviz/pass_color.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard.vert {} + fragment_program_ref rviz/glsl120/pass_color.frag {} } } } diff --git a/ogre_media/materials/scripts/point_cloud_tile.material b/ogre_media/materials/scripts/point_cloud_tile.material index 1c24dc7442..afa6188f11 100644 --- a/ogre_media/materials/scripts/point_cloud_tile.material +++ b/ogre_media/materials/scripts/point_cloud_tile.material @@ -5,8 +5,8 @@ material rviz/PointCloudTile alpha_rejection greater_equal 1 cull_hardware none cull_software none - vertex_program_ref rviz/nogp/billboard_tile.vert {} - fragment_program_ref rviz/smooth_square.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard_tile.vert {} + fragment_program_ref rviz/glsl120/smooth_square.frag {} } } @@ -16,8 +16,8 @@ material rviz/PointCloudTile alpha_rejection greater_equal 1 cull_hardware none cull_software none - vertex_program_ref rviz/nogp/billboard_tile.vert(with_depth) {} - fragment_program_ref rviz/depth.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard_tile.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth.frag {} } } @@ -27,8 +27,8 @@ material rviz/PointCloudTile alpha_rejection greater_equal 1 cull_hardware none cull_software none - vertex_program_ref rviz/nogp/billboard_tile.vert {} - fragment_program_ref rviz/pickcolor.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard_tile.vert {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} } } @@ -38,8 +38,8 @@ material rviz/PointCloudTile alpha_rejection greater_equal 1 cull_hardware none cull_software none - vertex_program_ref rviz/nogp/billboard_tile.vert {} - fragment_program_ref rviz/pass_color.frag {} + vertex_program_ref rviz/glsl120/nogp/billboard_tile.vert {} + fragment_program_ref rviz/glsl120/pass_color.frag {} } } } \ No newline at end of file diff --git a/ogre_media/materials/scripts120/point_cloud_box.material b/ogre_media/materials/scripts120/point_cloud_box.material new file mode 100644 index 0000000000..119ce727e2 --- /dev/null +++ b/ogre_media/materials/scripts120/point_cloud_box.material @@ -0,0 +1,45 @@ +material rviz/PointCloudBox +{ + /* This material should only be used with glsl < 1.50 /* + + /* the 'nogp' techniques require the full box geometry as input */ + + technique nogp + { + pass + { + vertex_program_ref rviz/glsl120/nogp/box.vert {} + fragment_program_ref rviz/glsl120/nogp/box.frag {} + } + } + + technique nogp_depth + { + scheme Depth + pass + { + vertex_program_ref rviz/glsl120/nogp/box.vert(with_depth) {} + fragment_program_ref rviz/glsl120/depth.frag {} + } + } + + technique nogp_selection_first_pass + { + scheme Pick + pass + { + vertex_program_ref rviz/glsl120/nogp/box.vert {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} + } + } + + technique nogp_selection_second_pass + { + scheme Pick1 + pass + { + vertex_program_ref rviz/glsl120/nogp/box.vert {} + fragment_program_ref rviz/glsl120/pass_color.frag {} + } + } +} diff --git a/ogre_media/materials/scripts150/point_cloud_box.material b/ogre_media/materials/scripts150/point_cloud_box.material new file mode 100644 index 0000000000..29be5d8e2e --- /dev/null +++ b/ogre_media/materials/scripts150/point_cloud_box.material @@ -0,0 +1,59 @@ +material rviz/PointCloudBox +{ + /* This material should only be used with glsl < 1.50 /* + + // the 'gp' techniques need one input vertex per box + // and use geometry shaders to create the geometry + + technique gp + { + // This will disable the technique on a Mac + gpu_device_rule exclude "OpenGL Engine" + pass + { + vertex_program_ref rviz/glsl150/pass_pos_color.vert {} + geometry_program_ref rviz/glsl150/box.geom(with_lighting) {} + fragment_program_ref rviz/glsl120/smooth_square.frag {} + } + } + + technique gp_depth + { + // This will disable the technique on a Mac + gpu_device_rule exclude "OpenGL Engine" + scheme Depth + pass + { + vertex_program_ref rviz/glsl150/pass_pos_color.vert {} + geometry_program_ref rviz/glsl150/box.geom(with_depth) {} + fragment_program_ref rviz/glsl120/depth.frag {} + } + } + + technique gp_selection_first_pass + { + // This will disable the technique on a Mac + gpu_device_rule exclude "OpenGL Engine" + scheme Pick + pass + { + vertex_program_ref rviz/glsl150/pass_pos_color.vert {} + geometry_program_ref rviz/glsl150/box.geom {} + fragment_program_ref rviz/glsl120/pickcolor.frag {} + } + } + + technique gp_selection_second_pass + { + // This will disable the technique on a Mac + gpu_device_rule exclude "OpenGL Engine" + scheme Pick1 + pass + { + vertex_program_ref rviz/glsl150/pass_pos_color.vert {} + geometry_program_ref rviz/glsl150/box.geom {} + fragment_program_ref rviz/glsl150/pass_color.frag {} + } + } + +} diff --git a/src/rviz/ogre_helpers/render_system.cpp b/src/rviz/ogre_helpers/render_system.cpp index 3ca77d89c6..d1fbda0eeb 100644 --- a/src/rviz/ogre_helpers/render_system.cpp +++ b/src/rviz/ogre_helpers/render_system.cpp @@ -78,10 +78,11 @@ RenderSystem::RenderSystem() loadOgrePlugins(); setupRenderSystem(); ogre_root_->initialise(false); - setupResources(); makeRenderWindow( dummy_window_id_, 1, 1 ); + detectGlVersion(); + setupResources(); Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); -} + } void RenderSystem::setupDummyWindowId() { @@ -119,6 +120,45 @@ void RenderSystem::loadOgrePlugins() ogre_root_->loadPlugin( plugin_prefix + "Plugin_ParticleFX" ); } +void RenderSystem::detectGlVersion() +{ + Ogre::RenderSystem *renderSys = ogre_root_->getRenderSystem(); + renderSys->createRenderSystemCapabilities(); + const Ogre::RenderSystemCapabilities* caps = renderSys->getCapabilities(); + int major = caps->getDriverVersion().major; + int minor = caps->getDriverVersion().minor; + gl_version_ = major * 100 + minor*10; + switch ( gl_version_ ) + { + case 200: + glsl_version_ = 110; + break; + case 210: + glsl_version_ = 120; + break; + case 300: + glsl_version_ = 130; + break; + case 310: + glsl_version_ = 140; + break; + case 320: + glsl_version_ = 150; + break; + default: + if ( gl_version_ > 320 ) + { + glsl_version_ = gl_version_; + } + else + { + glsl_version_ = 0; + } + break; + } + ROS_INFO_STREAM( "OpenGl version: " << major << "." << minor << " (GLSL " << (float)glsl_version_ / 100.0 << ")." ); +} + void RenderSystem::setupRenderSystem() { Ogre::RenderSystem *renderSys; @@ -172,8 +212,19 @@ void RenderSystem::setupResources() Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/models", "FileSystem", ROS_PACKAGE_NAME ); Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials", "FileSystem", ROS_PACKAGE_NAME ); Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/scripts", "FileSystem", ROS_PACKAGE_NAME ); - Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/cg", "FileSystem", ROS_PACKAGE_NAME ); - Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/glsl", "FileSystem", ROS_PACKAGE_NAME ); + Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/glsl120", "FileSystem", ROS_PACKAGE_NAME ); + // Add resources that depend on a specific glsl version. + // Unfortunately, Ogre doesn't have a notion of glsl versions so we can't go + // the 'official' way of defining multiple schemes per material and let Ogre decide which one to use. + if ( getGlslVersion() >= 150 ) + { + Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/glsl150", "FileSystem", ROS_PACKAGE_NAME ); + Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/scripts150", "FileSystem", ROS_PACKAGE_NAME ); + } + else + { + Ogre::ResourceGroupManager::getSingleton().addResourceLocation( rviz_path + "/ogre_media/materials/scripts120", "FileSystem", ROS_PACKAGE_NAME ); + } } // On Intel graphics chips under X11, there sometimes comes a diff --git a/src/rviz/ogre_helpers/render_system.h b/src/rviz/ogre_helpers/render_system.h index c7b3b3efad..53b165176d 100644 --- a/src/rviz/ogre_helpers/render_system.h +++ b/src/rviz/ogre_helpers/render_system.h @@ -44,6 +44,12 @@ class RenderSystem Ogre::Root* root() { return ogre_root_; } + // @brief return OpenGl Version as integer, e.g. 320 for OpenGl 3.20 + int getGlVersion() { return gl_version_; } + + // @brief return GLSL Version as integer, e.g. 150 for GLSL 1.50 + int getGlslVersion() { return glsl_version_; } + private: RenderSystem(); void setupDummyWindowId(); @@ -52,6 +58,7 @@ class RenderSystem // Find and configure the render system. void setupRenderSystem(); void setupResources(); + void detectGlVersion(); static RenderSystem* instance_; @@ -59,6 +66,9 @@ class RenderSystem unsigned long dummy_window_id_; Ogre::Root* ogre_root_; + + int gl_version_; + int glsl_version_; }; } // end namespace rviz From 86d83c0bcf01950b258af224116be2385927cd1e Mon Sep 17 00:00:00 2001 From: David Gossow Date: Thu, 7 Feb 2013 17:21:20 -0800 Subject: [PATCH 2/2] bugfixes to glsl 150 shaders/scripts --- ogre_media/materials/glsl150/glsl150.program | 8 ++++---- .../materials/scripts120/point_cloud_box.material | 2 +- .../materials/scripts150/point_cloud_box.material | 10 +--------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/ogre_media/materials/glsl150/glsl150.program b/ogre_media/materials/glsl150/glsl150.program index a36483fa01..313fd25b38 100644 --- a/ogre_media/materials/glsl150/glsl150.program +++ b/ogre_media/materials/glsl150/glsl150.program @@ -1,6 +1,6 @@ //all shaders, sorted by name -geometry_program rviz/box.geom glsl +geometry_program rviz/glsl150/box.geom glsl { source box.geom input_operation_type points @@ -13,7 +13,7 @@ geometry_program rviz/box.geom glsl param_named_auto auto_size custom 6 } } -geometry_program rviz/box.geom(with_depth) glsl +geometry_program rviz/glsl150/box.geom(with_depth) glsl { source box.geom input_operation_type points @@ -28,7 +28,7 @@ geometry_program rviz/box.geom(with_depth) glsl param_named_auto auto_size custom 6 } } -geometry_program rviz/box.geom(with_lighting) glsl +geometry_program rviz/glsl150/box.geom(with_lighting) glsl { source box.geom input_operation_type points @@ -43,7 +43,7 @@ geometry_program rviz/box.geom(with_lighting) glsl } } -vertex_program rviz/pass_pos_color.vert glsl +vertex_program rviz/glsl150/pass_pos_color.vert glsl { source pass_pos_color.vert } diff --git a/ogre_media/materials/scripts120/point_cloud_box.material b/ogre_media/materials/scripts120/point_cloud_box.material index 119ce727e2..20ae9a7677 100644 --- a/ogre_media/materials/scripts120/point_cloud_box.material +++ b/ogre_media/materials/scripts120/point_cloud_box.material @@ -1,6 +1,6 @@ material rviz/PointCloudBox { - /* This material should only be used with glsl < 1.50 /* + /* This material should only be used with glsl < 1.50 */ /* the 'nogp' techniques require the full box geometry as input */ diff --git a/ogre_media/materials/scripts150/point_cloud_box.material b/ogre_media/materials/scripts150/point_cloud_box.material index 29be5d8e2e..7fa983099f 100644 --- a/ogre_media/materials/scripts150/point_cloud_box.material +++ b/ogre_media/materials/scripts150/point_cloud_box.material @@ -1,14 +1,12 @@ material rviz/PointCloudBox { - /* This material should only be used with glsl < 1.50 /* + /* This material should only be used with glsl < 1.50 */ // the 'gp' techniques need one input vertex per box // and use geometry shaders to create the geometry technique gp { - // This will disable the technique on a Mac - gpu_device_rule exclude "OpenGL Engine" pass { vertex_program_ref rviz/glsl150/pass_pos_color.vert {} @@ -19,8 +17,6 @@ material rviz/PointCloudBox technique gp_depth { - // This will disable the technique on a Mac - gpu_device_rule exclude "OpenGL Engine" scheme Depth pass { @@ -32,8 +28,6 @@ material rviz/PointCloudBox technique gp_selection_first_pass { - // This will disable the technique on a Mac - gpu_device_rule exclude "OpenGL Engine" scheme Pick pass { @@ -45,8 +39,6 @@ material rviz/PointCloudBox technique gp_selection_second_pass { - // This will disable the technique on a Mac - gpu_device_rule exclude "OpenGL Engine" scheme Pick1 pass {