Example #1
0
 private TrefoilKnotRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                             AttributeMap attributeMap, string positionNameInIBufferable, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
     this.stateList.Add(new LineWidthState(3));
     this.stateList.Add(new PointSizeState(3));
 }
Example #2
0
 /// <summary>
 /// Render propeller in legacy opengl.
 /// </summary>
 private RectangleRenderer(RectangleModel model, IShaderProgramProvider renderProgramProvider,
                           AttributeMap attributeMap, string positionNameInVertexShader,
                           params GLState[] switches)
     : base(model, renderProgramProvider, attributeMap, positionNameInVertexShader, switches)
 {
     this.ModelSize = model.ModelSize;
 }
Example #3
0
 protected GridViewRenderer(vec3 originalWorldPosition, GridViewModel model, IShaderProgramProvider shaderProgramProvider,
                            AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.WorldPosition = originalWorldPosition;
     this.Grid          = model;
 }
Example #4
0
 public PointSpriteRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                            AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.pointSpriteState = new PointSpriteState();
     this.stateList.Add(this.pointSpriteState);
     this.PointSpriteEnabled = true;
 }
Example #5
0
 /// <summary>
 /// Rendering something using GLSL shader and VBO(VAO).
 /// </summary>
 /// <param name="model">model data that can be transfermed into OpenGL Buffer's pointer.</param>
 /// <param name="shaderProgramProvider">All shader codes needed for this renderer.</param>
 /// <param name="attributeMap">Mapping relations between 'in' variables in vertex shader in <see cref="shaderProgramProvider"/> and buffers in <see cref="DataSource"/>.</param>
 ///<param name="switches">OpenGL switches.</param>
 public Renderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                 AttributeMap attributeMap, params GLState[] switches)
 {
     this.DataSource            = model;
     this.shaderProgramProvider = shaderProgramProvider;
     this.attributeMap          = attributeMap;
     this.stateList.AddRange(switches);
 }
Example #6
0
 private BillboardRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                           AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.Width      = 1.0f; this.Height = 0.125f;
     this.Percentage = new vec2(0.2f, 0.05f);
     this.PixelSize  = new ivec2(100, 10);
 }
Example #7
0
 private TeapotRenderer(Teapot model, IShaderProgramProvider shaderProgramProvider,
                        AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, inPosition, switches)
 {
     this.ModelSize       = model.GetModelSize();
     this.RenderWireframe = true;
     this.RenderBody      = true;
 }
Example #8
0
 private HemisphereLightingRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                    AttributeMap attributeMap, string positionNameInIBufferable,
                                    params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
     this.LightPosition = new vec3(0, 2, 0);
     this.SkyColor      = new vec3(1, 0, 0);
     this.GroundColor   = new vec3(0, 1, 0);
 }
Example #9
0
        private UniformStructRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                      AttributeMap attributeMap, params GLState[] switches)
            : base(model, shaderProgramProvider, attributeMap, switches)
        {
            var groundRenderer = GroundRenderer.Create(new GroundModel(20));

            groundRenderer.Scale = new vec3(10, 10, 10);
            this.groundRenderer  = groundRenderer;
        }
Example #10
0
        /// <summary>
        /// 支持"拾取"的渲染器
        /// </summary>
        /// <param name="model">一种渲染方式</param>
        /// <param name="shaderProgramProvider">各种类型的shader代码</param>
        /// <param name="attributeMap">关联<paramref name="model"/>和<paramref name="shaderProgramProvider"/>中的属性</param>
        /// <param name="positionNameInIBufferable">描述顶点位置信息的buffer的名字</param>
        ///<param name="switches"></param>
        public PickableRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                AttributeMap attributeMap, string positionNameInIBufferable,
                                params GLState[] switches)
            : base(model, shaderProgramProvider, attributeMap, switches)
        {
            var innerPickableRenderer = InnerPickableRendererFactory.GetRenderer(
                model, attributeMap, positionNameInIBufferable);

            this.innerPickableRenderer = innerPickableRenderer;
        }
Example #11
0
        private PLYRenderer(PLY model, IShaderProgramProvider shaderProgramProvider,
                            AttributeMap attributeMap, params GLState[] switches)
            : base(model, shaderProgramProvider, attributeMap, inPosition, switches)
        {
            vec3 size = model.ModelSize;

            this.ModelSize = size;
            const float factor  = 12.0f;
            float       average = (size.x + size.y + size.z) / 3.0f;

            this.Scale = new vec3(factor / average, factor / average, factor / average);
        }
        /// <summary>
        /// 支持"拾取"的渲染器
        /// </summary>
        /// <param name="model">一种渲染方式</param>
        /// <param name="renderProgramProvider">各种类型的shader代码</param>
        /// <param name="attributeMap">关联<paramref name="model"/>和<paramref name="shaderProgramProvider"/>中的属性</param>
        /// <param name="positionNameInVertexShader">vertex shader种描述顶点位置信息的in变量的名字</param>
        ///<param name="switches"></param>
        public PickableRenderer(IBufferable model, IShaderProgramProvider renderProgramProvider,
                                AttributeMap attributeMap, string positionNameInVertexShader,
                                params GLState[] switches)
        {
            this.PositionNameInVertexShader = positionNameInVertexShader;
            this.pickProgramProvider        = PickingShaderHelper.GetPickingShaderProgramProvider();

            this.DataSource            = model;
            this.renderProgramProvider = renderProgramProvider;
            this.attributeMap          = attributeMap;
            this.stateList.AddRange(switches);
        }
Example #13
0
 private DirectonalLightRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                 AttributeMap attributeMap, string positionNameInIBufferable,
                                 params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
     this.AmbientLightColor         = new vec3(0.2f);
     this.DirectionalLightDirection = new vec3(1);
     this.DirectionalLightColor     = new vec3(1);
     //this.HalfVector = new vec3(1);
     this.Shininess = 10.0f;
     this.Strength  = 1.0f;
 }
Example #14
0
 private PointLightRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                            AttributeMap attributeMap, string positionNameInIBufferable,
                            params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
     this.Ambient       = new vec3(0.2f);
     this.LightPosition = new vec3(400);
     this.LightColor    = new vec3(1);
     //this.HalfVector = new vec3(1);
     this.Shininess            = 10.0f;
     this.Strength             = 1.0f;
     this.ConstantAttenuation  = 0.2f;
     this.LinearAttenuation    = 0.0f;
     this.QuadraticAttenuation = 0.0f;
 }
 /// <summary>
 /// Renderer that supports color-coded rendering.
 /// </summary>
 /// <param name="model">model data that can be transfermed into OpenGL Buffer's pointer.</param>
 /// <param name="shaderProgramProvider">All shader codes needed for this renderer.</param>
 /// <param name="attributeMap">Mapping relations between 'in' variables in vertex shader in <paramref name="shaderProgramProvider"/> and buffers in <paramref name="model"/>.</param>
 /// <param name="positionNameInIBufferable">Name of buffer that describes model's position.</param>
 ///<param name="switches">OpenGL switches.</param>
 internal InnerPickableRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                AttributeMap attributeMap, string positionNameInIBufferable,
                                params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.PositionNameInIBufferable = positionNameInIBufferable;
     this.stateList.Add(polygonModeState);
     {
         float min, max;
         OpenGL.LineWidthRange(out min, out max);
         this.stateList.Add(new LineWidthState(max));
     }
     {
         float min, max;
         OpenGL.PointSizeRange(out min, out max);
         this.stateList.Add(new PointSizeState(max));
     }
 }
Example #16
0
 /// <summary>
 /// A smallest unit that can render somthing.
 /// </summary>
 /// <param name="programProvider"></param>
 /// <param name="positionNameInIBufferSource"></param>
 /// <param name="states"></param>
 public IPickableRenderUnitBuilder(IShaderProgramProvider programProvider, string positionNameInIBufferSource, params GLState[] states)
 {
     this.programProvider             = programProvider;
     this.positionNameInIBufferSource = positionNameInIBufferSource;
     this.states = states;
 }
Example #17
0
 /// <summary>
 /// 支持"拾取"的渲染器
 /// </summary>
 /// <param name="model">一种渲染方式</param>
 /// <param name="renderProgramProvider">各种类型的shader代码</param>
 /// <param name="attributeMap">关联<paramref name="model"/>和<paramref name="shaderProgramProvider"/>中的属性</param>
 /// <param name="positionNameInVertexShader">vertex shader种描述顶点位置信息的in变量的名字</param>
 ///<param name="switches"></param>
 private TranslateRenderer(IBufferable model, IShaderProgramProvider renderProgramProvider,
                           AttributeMap attributeMap, string positionNameInVertexShader,
                           params GLState[] switches)
     : base(model, renderProgramProvider, attributeMap, positionNameInVertexShader, switches)
 {
 }
 private EmitNormalLineRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                AttributeMap attributeMap, string positionNameInIBufferable, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
 }
 private OrderDependentTransparencyRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                            AttributeMap attributeMap, string positionNameInIBufferable,
                                            params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
 }
Example #20
0
 /// <summary>
 /// A smallest unit that can render somthing.
 /// </summary>
 /// <param name="programProvider"></param>
 /// <param name="positionNameInIBufferSource"></param>
 /// <param name="switches"></param>
 public IPickableRenderMethodBuilder(IShaderProgramProvider programProvider, string positionNameInIBufferSource, params GLSwitch[] switches)
 {
     this.programProvider             = programProvider;
     this.positionNameInIBufferSource = positionNameInIBufferSource;
     this.switches = switches;
 }
Example #21
0
 /// <summary>
 /// A smallest unit that can render somthing.
 /// </summary>
 /// <param name="programProvider"></param>
 /// <param name="map"></param>
 /// <param name="states"></param>
 public RenderMethodBuilder(IShaderProgramProvider programProvider, AttributeMap map, params GLState[] states)
 {
     this.programProvider = programProvider;
     this.map             = map;
     this.states          = states;
 }
 private RandomPointsRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider, CSharpGL.AttributeMap attributeMap, params GLState[] switches) :
     base(model, shaderProgramProvider, attributeMap, switches)
 {
 }
 private CatesianGridRenderer(vec3 originalWorldPosition, CatesianGrid catesianGrid, IShaderProgramProvider shaderProgramProvider,
                              AttributeMap attributeMap, Texture codedColorSampler, params GLState[] switches)
     : base(originalWorldPosition, catesianGrid, shaderProgramProvider, attributeMap, switches)
 {
     this.codedColorSampler = codedColorSampler;
 }
Example #24
0
 /// <summary>
 /// renders well pipeline(several cylinders)
 /// </summary>
 /// <param name="model"></param>
 /// <param name="shaderProgramProvider"></param>
 /// <param name="attributeMap"></param>
 /// <param name="switches"></param>
 private WellRenderer(WellModel model, IShaderProgramProvider shaderProgramProvider,
                      AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
 }
Example #25
0
 private LinesRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                       AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
 }
Example #26
0
 private GroundRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                        AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.LineColor = Color.White;
 }
Example #27
0
 public BuildInRenderer(vec3 lengths, IBufferable model, IShaderProgramProvider shaderProgramProvider,
                        AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.ModelSize = lengths;
 }
Example #28
0
 private FlabellumRenderer(Flabellum model, IShaderProgramProvider shaderProgramProvider,
                           AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.ModelSize = model.GetModelSize();
 }
Example #29
0
 /// <summary>
 /// Renders a label(a single line of text).
 /// </summary>
 /// <param name="model"></param>
 /// <param name="shaderProgramProvider"></param>
 /// <param name="attributeMap"></param>
 /// <param name="switches"></param>
 private TextRenderer(TextModel model, IShaderProgramProvider shaderProgramProvider,
                      AttributeMap attributeMap, params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, switches)
 {
     this.textModel = model;
 }
Example #30
0
 private InnerImageProcessingRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider,
                                      AttributeMap attributeMap, string positionNameInIBufferable,
                                      params GLState[] switches)
     : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches)
 {
 }