I am currently drawing 3D graphics using C#OpenTK
For questions, please let me know if it is possible to GL.Clear in semi-transparent black (0,0,0,0.5).
Currently, I draw music waveforms using Lines
At that time, instead of clearing it in black every time,
by clearing in semi-transparent black
I'm thinking that the line in front of one frame will be thin and the production will look like a blur.
Even if GL.ClearColor (0,0,0,0.5) is
It can only be cleared in black without transparency, and translucent lines will not remain.
Would it be possible to leave the color of the previous frame transparent?
I would appreciate it if you could let me know.
Thank you for your cooperation
protected override void OnRenderFrame (FrameEventArgse)
{
GL.ClearColor (0.0f, 0.0f, 0.0f);
GL.Clear (ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
GL.Begin (BeginMode.Lines);
int N = dataset.Length;
for (int n = 1; n<N;n++)
{
float v1 = dataset [n-1];
float v2 = dataset [n];
Vector3zero=0.5f*(py-p0)+p0;
Vector3nx = px-p0;
Vector3 P1 = zero+nx*(float)(n-1)/N;
Vector3 P2 = zero+nx*(float)n/N;
Vector3Value1 = v1*(py-p0)*0.5f;
Vector3Value2 = v2*(py-p0)*0.5f;
P1 = P1 + Value1;
P2 = P2 + Value 2;
GL.Color3 (Color.Red);
GL.Vertex3 (P1);
GL.Vertex3 (P2);
}
GL.End();
// SwapBuffer
SwapBuffers();
}
When you ask questions, be sure to write down the environmental information first as a minimum of manners.
The OS, device drivers, IDE, SDK, library and other versions, hardware model numbers, and more.
Pattern language when asking questions in technical mailing lists
While glClearColor() and glClear() can clear alpha channels to any value (uniform setting), the behavior is only clear and does not blend the values to suit the previous drawing results.Also, the default frame buffer (back buffer) is always impermeable.
Use Frame Buffer Object (FBO) if you want OpenGL to synthesize with the previous (pre-frame) drawing results.Save the drawing results in a 2D texture and paste them into a rectangular polygon in the next frame for alpha synthesis.The buffers are ping-ponged.
However, FBO is a standardized feature in OpenGL 3.0, and is provided as an enhanced GL_EXT_framebuffer_object in OpenGL 2.1 and earlier.Another method is to use a pixel buffer object (PBO), which is standardized in OpenGL 2.1, and is provided as an enhanced GL_ARB_pixel_buffer_object in OpenGL 2.0 and earlier.
You can also use a computer shader to draw 2D textures equally translucent.
C#/OpenTK information is probably hard to get, and both quality and quantity are low, so it's faster to look for C/C++ information.
© 2024 OneMinuteCode. All rights reserved.