Пример #1
0
        /// <summary>
        /// 高亮显示指定的图元。
        /// </summary>
        /// <param name="model">一种渲染方式</param>
        /// <param name="positionNameInIBufferable">描述顶点位置信息的buffer的名字</param>
        ///<param name="switches"></param>
        public HighlightRenderer(IBufferable model,
                                 string positionNameInIBufferable,
                                 params GLState[] switches)
            : base(model, HighlightShaderHelper.GetHighlightShaderProgramProvider(),
                   new AttributeMap("in_Position", positionNameInIBufferable),
                   switches)
        {
            this.positionNameInIBufferable = positionNameInIBufferable;

            this.StateList.Add(new PolygonModeState(PolygonMode.Line));
            this.StateList.Add(new LineWidthState(10.0f));
            this.StateList.Add(new PointSizeState(20.0f));
            this.StateList.Add(new PolygonOffsetFillState());
            this.StateList.Add(new PolygonOffsetPointState());
        }
Пример #2
0
 /// <summary>
 /// 高亮显示指定的图元。
 /// </summary>
 /// <param name="model">一种渲染方式</param>
 /// <param name="positionNameInIBufferable">描述顶点位置信息的buffer的名字</param>
 ///<param name="switches"></param>
 public HighlightRenderer(IBufferable model,
                          string positionNameInIBufferable,
                          params GLSwitch[] switches)
     : base(model, HighlightShaderHelper.GetHighlightShaderCode(),
            new AttributeMap("in_Position", positionNameInIBufferable),
            switches)
 {
     this.positionNameInIBufferable = positionNameInIBufferable;
     this.UniformVariables.Add(new UniformVec4("highlightColor", new vec4(1, 1, 1, 1)));
     this.UniformVariables.Add(this.uniformMVP);
     this.SwitchList.Add(new PolygonModeSwitch(PolygonMode.Line));
     this.SwitchList.Add(new LineWidthSwitch(10.0f));
     this.SwitchList.Add(new PointSizeSwitch(20.0f));
     this.SwitchList.Add(new PolygonOffsetFillSwitch());
     this.SwitchList.Add(new PolygonOffsetPointSwitch());
 }