Exemplo n.º 1
0
 public static CatesianGridRenderer Create(vec3 originalWorldPosition, CatesianGrid grid, Texture codedColorSampler)
 {
     var shaderCodes = new ShaderCode[2];
     shaderCodes[0] = new ShaderCode(File.ReadAllText(@"shaders\HexahedronGrid.vert"), ShaderType.VertexShader);
     shaderCodes[1] = new ShaderCode(File.ReadAllText(@"shaders\HexahedronGrid.frag"), ShaderType.FragmentShader);
     var map = new AttributeMap();
     map.Add("in_Position", CatesianGrid.strPosition);
     map.Add("in_uv", CatesianGrid.strColor);
     var renderer = new CatesianGridRenderer(originalWorldPosition, grid, shaderCodes, map, codedColorSampler);
     renderer.ModelSize = (grid.DataSource.SourceActiveBounds.MaxPosition - grid.DataSource.SourceActiveBounds.MinPosition).Abs();
     renderer.WorldPosition = -grid.DataSource.Position;
     return renderer;
 }
Exemplo n.º 2
0
        protected override void DoInitialize()
        {
            base.DoInitialize();

            Bitmap bitmap;
            if (string.IsNullOrEmpty(this.bitmapFilename))// display a cursor as default.
            { bitmap = ManifestResourceLoader.LoadBitmap(@"Resources\cursor_gold.png"); }
            else
            { bitmap = new Bitmap(this.bitmapFilename); }
            var texture = new Texture(TextureTarget.Texture2D, bitmap, new SamplerParameters());
            texture.Initialize();
            bitmap.Dispose();
            this.SetUniform("tex", texture);
        }
        protected override void DoInitialize()
        {
            base.DoInitialize();

            Bitmap bitmap = this.codedColors.GetBitmap(1024);
            var texture = new Texture(TextureTarget.Texture1D, bitmap, new SamplerParameters());
            this.codedColors = null;
            texture.Initialize();
            this.Sampler = texture;
            bitmap.Dispose();
            var renderer = this.Renderer as Renderer;
            renderer.SetUniform("codedColorSampler", new samplerValue(TextureTarget.Texture1D,
                texture.Id, 0));
        }
Exemplo n.º 4
0
 private CatesianGridRenderer(vec3 originalWorldPosition, CatesianGrid catesianGrid, ShaderCode[] shaderCodes,
     AttributeMap attributeMap, Texture codedColorSampler, params GLState[] switches)
     : base(originalWorldPosition, catesianGrid, shaderCodes, attributeMap, switches)
 {
     this.codedColorSampler = codedColorSampler;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ShadowMappingUnderLightEventArgs"/> class.
 /// </summary>
 public ShadowMappingUnderLightEventArgs(ActionParams param, ICamera camera, Texture shadowMap, LightBase light)
     : base(param, camera)
 {
     this.ShadowMap = shadowMap;
     this.Light     = light;
 }