/// <summary> /// Create the <see cref="uvTestPattern"/>, <see cref="screenTextureShader"/>, and <see cref="screenTriangle"/>. /// Requires an OpenTK context to be current. /// </summary> public GraphicsResources() { // Texture setup from a bitmap. uvTestPattern = new Texture2D(); uvTestPattern.LoadImageData(Properties.Resources.UVPattern); floatMagentaBlackStripes = CreateTextureFromFloatValues(true, 64, 64); screenTextureShader = CreateShader(); CreateSamplerObject(); screenTriangle = new ScreenTriangle(); lutTexture = new Texture3D(); lutTexture.LoadImageData(1, 1, 1, new float[] { 1, 1, 1, 1 }, new TextureFormatUncompressed(PixelInternalFormat.Rgba, PixelFormat.Rgba, PixelType.Float)); Benchmark(); }
/// <summary> /// Create the <see cref="uvTestPattern"/>, <see cref="screenTextureShader"/>, and <see cref="screenTriangle"/>. /// Requires an OpenTK context to be current. /// </summary> public GraphicsResources() { // Texture setup from a bitmap. uvTestPattern = new Texture2D(); using (var bmp = Image.FromFile("Resources/UVPattern.png")) { uvTestPattern.LoadImageData((Bitmap)bmp); } floatMagentaBlackStripes = TextureGenerator.CreateStripes(true, 64, 64); screenTextureShader = CreateScreenTextureShader(); CreateObjModelShader(); CreateSamplerObject(); screenTriangle = new ScreenTriangle(); Benchmark(); }