public void Dispose() { Convert?.Dispose(); ScaleShader?.Dispose(); QuadShader?.Dispose(); Upload?.Dispose(); }
public void Dispose() { Convert?.Dispose(); ScaleShader?.Dispose(); QuadShader?.Dispose(); Upload?.Dispose(); Sync?.Dispose(); padding?.Dispose(); LinearSampler?.Dispose(); PointSampler?.Dispose(); }
protected override void OnLoad() { base.OnLoad(); var shaderDir = "resources/shader/"; spriteShader = new QuadShader(shaderDir + "sprite.vert", shaderDir + "sprite.geo", shaderDir + "sprite.frag"); quadRenderer = new QuadRenderer(4, spriteShader); //texture = new Texture(@"C:\Users\bobub\Downloads\garo.jpg"); texture = new Texture("resources/image/vex.png"); vex = new Sprite(texture: texture); //vex.Color = Color4.White; vex.Pos = new Vector2(0f, 0f); //vex.Size = new Vector2(2f, 2f); //vex.Origin = new Vector2(-1, 1f); vex.CenterOrigin(); //vex.Origin = new Vector2(1f, -1f); vex.QuickScale(.5f); //vex.Rotation = 45; nilep = new MonoFont("resources/font/nilep.png", "resources/font/nilep.json"); helloText = new Text(nilep); helloText.Color = Color4.MediumPurple; helloText.String = "HEQ"; helloText.Position = new Vector2(.5f); //helloText.QuickScale(1.5f); helloText.CenterOrigin(); //helloText.Origin.Y = 0; //helloText.Origin = new Vector2(.6f, 0.1125f); //helloText.Rotation = -90; colorAnimator = new LinearColorAnimator(new TextColorSetter(helloText), true, Color4.White, new Color4(.5f, .5f, .5f, .5f), Color4.Black); posAnimator = new LinearVector2Animator(new TextPositionSetter(helloText), true, new Vector2(-1, -1), new Vector2(1f, 1), new Vector2(.2f)); colorAnimator.Active = false; //posAnimator.Active = false; }
public ThumbnailModel(QuadShader quad) { this.quad = quad; convert2D = new DirectX.Shader(DirectX.Shader.Type.Pixel, GetSource(ShaderBuilder.Builder2D), "ThumbnailPixelShader2D"); convert3D = new DirectX.Shader(DirectX.Shader.Type.Pixel, GetSource(ShaderBuilder.Builder3D), "ThumbnailPixelShader3D"); var samplerDesc = new SamplerStateDescription { AddressU = TextureAddressMode.Clamp, AddressV = TextureAddressMode.Clamp, AddressW = TextureAddressMode.Clamp, BorderColor = new RawColor4(), ComparisonFunction = Comparison.Never, Filter = SharpDX.Direct3D11.Filter.MinLinearMagMipPoint, MaximumAnisotropy = 1, MaximumLod = float.MaxValue, MinimumLod = 0, MipLodBias = 0 }; sampler = new SamplerState(Device.Get().Handle, samplerDesc); }
public CropOverlay(Models models) { quad = models.SharedModel.QuadShader; cbuffer = models.SharedModel.Upload; images = models.Images; }
internal GifModel(QuadShader quad, UploadBuffer upload, ProgressModel progressModel) { this.progressModel = progressModel; shader = new GifShader(quad, upload); }
internal GifModel(QuadShader quad, UploadBuffer upload) { shader = new GifShader(quad, upload); }
public Graphics(UserControl control, SceneTime time, ShadingTechnique technique) { Assert.NotNull(control); Assert.NotNull(time); IsDisposed = false; CurrentShadingTechnique = technique; if (GL.GetCurrent(false) != null || GetCurrent(false) != null) { var error = "Only one NetGL view per thread is now supported. Try launching 3D view in different thread."; Log.Error(error); throw new InvalidOperationException(error); } _control = control; _time = time; try { _glContext = new GL(_control.Handle); } catch { Dispose(); throw; } _currentContext.Value = this; _glContext.Enable(EnableCap.DepthTest); _glContext.Enable(EnableCap.Texture2D); _glContext.Enable(EnableCap.CullFace); _glContext.Enable(EnableCap.ProgramPointSize); _glContext.Enable(EnableCap.PointSprite); _glContext.CullFace(MaterialFace.Back); _glContext.FrontFace(FrontFaceDirection.CounterClockwise); _glContext.BlendEquation(BlendEquations.FuncAdd); _glContext.BlendFunc(BlendMode.SrcAlpha, BlendMode.OneMinusSrcAlpha); _glContext.SwapInterval(_swapInterval); _globalUniforms = new GlobalUniformsBufferObject(); _standartUniforms = new StandardUniformsBufferObject(); _defaultMaterial = new Material(MaterialType.DiffuseColor); _blankTexture = new Texture2(); _blankTexture.SetImage(new byte[4] { 255, 0, 255, 255 }, new Size(1, 1), Core.PixelFormat.Rgba, Core.PixelInternalFormat.Rgba8); _quadShader = new QuadShader(); _displayQuadVao = CreateDisplayQuadVao(); switch (CurrentShadingTechnique) { case ShadingTechnique.Forward: _renderTechnique = new ForwardRender(); break; case ShadingTechnique.Deferred: _renderTechnique = new DeferredRender(); break; default: throw new NotSupportedException(CurrentShadingTechnique.ToString()); } ScreenSize = _control.ClientSize; }