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)); }
/// <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; }
protected GridViewRenderer(vec3 originalWorldPosition, GridViewModel model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, switches) { this.WorldPosition = originalWorldPosition; this.Grid = model; }
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; }
/// <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); }
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); }
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; }
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); }
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; }
/// <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; }
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); }
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; }
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)); } }
/// <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; }
/// <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) { }
/// <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; }
/// <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; }
/// <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) { }
private LinesRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, switches) { }
private GroundRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, switches) { this.LineColor = Color.White; }
public BuildInRenderer(vec3 lengths, IBufferable model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, switches) { this.ModelSize = lengths; }
private FlabellumRenderer(Flabellum model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, switches) { this.ModelSize = model.GetModelSize(); }
/// <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; }
private InnerImageProcessingRenderer(IBufferable model, IShaderProgramProvider shaderProgramProvider, AttributeMap attributeMap, string positionNameInIBufferable, params GLState[] switches) : base(model, shaderProgramProvider, attributeMap, positionNameInIBufferable, switches) { }