public override void draw(bool useTexture) { _fbo_color.bind(); Depth.clear(); Buffer.draw(DrawBufferMode.ColorAttachment0); Buffer.clear(0, 0, 0, 0); _rendering.use(); { Texture.active(TextureUnit.Texture0); _tex_blend.bind(); if (useTexture) { Texture.active(TextureUnit.Texture1); Example._scene.backgroundTexture.bind(); Texture.sampler.bind(1); } else { _rendering.bindUniform4("color_background", Example._scene.backgroundColor); } _rendering.bindUniform1("useTexture", useTexture ? 1 : 0); Texture.image.draw(); } Shading.close(); FrameBuffer.unbind(); Buffer.draw(DrawBufferMode.Back); Depth.clear(); Buffer.clear(0, 0, 0, 0); _tex_color.draw(); }
public override void draw(bool useTexture) { _fbo_color.bind(); Depth.clear(); Buffer.draw(DrawBufferMode.ColorAttachment0); Buffer.clear(0, 0, 0, 0); _rendering.use(); { Texture.active(TextureUnit.Texture0); _tex_blend.bind(); Texture.active(TextureUnit.Texture1); _tex_back.bind(); Texture.image.draw(); } Shading.close(); FrameBuffer.unbind(); Buffer.draw(DrawBufferMode.Back); Depth.clear(); Buffer.clear(0, 0, 0, 0); _tex_color.draw(); }