@classmethod
    def _build_fragment_shader(cls, texture, view_width, view_height):

        sampling_code, sampler_type = cls._generate_sampling_code(texture, view_width, view_height)

        # Build actual shader
        built = """
            #version 400
            #pragma include "render_pipeline_base.inc.glsl"
            in vec2 texcoord;
            out vec3 result;
            uniform int mipmap;
            uniform int slice;
            uniform float brightness;
            uniform bool tonemap;
            uniform """ + sampler_type + """ p3d_Texture0;
            void main() {
                int view_width = """ + str(view_width) + """;
                int view_height = """ + str(view_height) + """;
                ivec2 display_coord = ivec2(texcoord * vec2(view_width, view_height));
                int int_index = display_coord.x + display_coord.y * view_width;
                """ + sampling_code + """
                result *= brightness;
                if (tonemap)
                    result = result / (1 + result);
            }
        """

        # Strip trailing spaces
        built = '\n'.join([i.strip() for i in built.split("\n")])

        return built
Create a tool bar manager implementation from a definition.
dataset/ETHPy150Open tobspr/RenderPipeline/rpcore/util/display_shader_builder.py/DisplayShaderBuilder._build_fragment_shader--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/ui/workbench/workbench_action_manager_builder.py/WorkbenchActionManagerBuilder._create_tool_bar_manager