Author Topic: Pixel shaders being buffered?  (Read 3743 times)

0 Members and 1 Guest are viewing this topic.

Offline efecto

  • C= 64
  • **
  • Posts: 90
  • Karma: 4
    • View Profile
Pixel shaders being buffered?
« 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

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Pixel shaders being buffered?
« Reply #1 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 );

Challenge Trophies Won:

Offline madeyes

  • ZX 81
  • *
  • Posts: 23
  • Karma: 4
    • View Profile
Re: Pixel shaders being buffered?
« Reply #2 on: December 12, 2009 »
Mandelbroth? Is that some sort of fractal soup? ;D ;)

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: Pixel shaders being buffered?
« Reply #3 on: December 12, 2009 »
Sounds delicious.
Shockwave ^ Codigos
Challenge Trophies Won: