Dark Bit Factory & Gravity

PROGRAMMING => General coding questions => Topic started by: efecto on November 15, 2009

Title: Pixel shaders being buffered?
Post by: efecto on November 15, 2009
Hi all,
I was playing around with pixel shader code in C++ and visual studio, and i have the following strange thing:

I had a mandelbroth rendered in a pixel shader.
I then removed all the logic from the pixel shader and basically had it returning a solid color for each pixel.
yet, after rebuilding the program, when i run the programm from withing visual studio or the exe the mandelbroth is still being displayed???

Are shaders being buffered?
What is going wrong?

tnx,
Efecto
Title: Re: Pixel shaders being buffered?
Post by: Rbz on November 15, 2009
Yes, this is normal, it's buffered in the front/back buffer, you need to clear back buffer an then flip it.
In Opengl you just need to execute the following code:
Code: [Select]
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
SwapBuffers ( hDC );

Title: Re: Pixel shaders being buffered?
Post by: madeyes on December 12, 2009
Mandelbroth? Is that some sort of fractal soup? ;D ;)
Title: Re: Pixel shaders being buffered?
Post by: Shockwave on December 12, 2009
Sounds delicious.