Beispiel #1
0
        public MapObject2DShader()
        {
            Shader = new ShaderProgram(GetShader(ShaderType.VertexShader), GetShader(ShaderType.FragmentShader));

            Shader.Bind();

            Perspective = Camera = ModelView = SelectionTransform = Matrix4.Identity;
            SelectedOnly = UnselectedOnly = false;
            SelectedColour = new Vector4(1, 0, 0, 0.5f);

            Shader.Unbind();
        }
Beispiel #2
0
        public MapObject3DShader()
        {
            Shader = new ShaderProgram(GetShader(ShaderType.VertexShader), GetShader(ShaderType.FragmentShader));

            Shader.Bind();

            Perspective = Camera = ModelView = SelectionTransform = Matrix4.Identity;
            IsTextured = true;
            IsLit = true;
            Show3DGrid = false;
            GridSpacing = 64;
            SelectionColourMultiplier = new Vector4(1, 0.5f, 0.5f, 1);
            Transformation = Matrix4.Identity;

            GL.ActiveTexture(TextureUnit.Texture0);
            Shader.Set("currentTexture", 0);

            Shader.Unbind();
        }
        public ArrayRendererGL3(Document document)
        {
            _document = document;
            _array = new ArrayManager(document.Map);
            Shader = new ShaderProgram(
                new Shader(ShaderType.VertexShader, VertexShader),
                new Shader(ShaderType.FragmentShader, FragmentShader));
            GridRenderables = ViewportManager.Viewports.OfType<Viewport2D>().ToDictionary(x => (ViewportBase)x, x => new GridRenderable(_document));

            // Set up default values
            Shader.Bind();
            Perspective = Camera = ModelView = SelectionTransform = Matrix4.Identity;
            IsTextured = IsWireframe = In3D = false;
            Show3DGrid = document.Map.Show3DGrid;
            GridSpacing = (float) document.Map.GridSpacing;
            WireframeColour = Vector4.Zero;
            SelectionColourMultiplier = new Vector4(1, 0.5f, 0.5f, 1);
            Shader.Unbind();
        }