Dark Bit Factory &  Gravity

Dark Bit Factory & Gravity

  • September 09, 2010 *
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Pages: [1]   Go Down

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

0 Members and 1 Guest are viewing this topic.

efecto

  • ZX 81
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 24
    • 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
Logged

rbz

  • MOD
  • Senior Member
  • *******
  • Karma: 272
  • Offline Offline
  • Posts: 2140
    • View Profile
    • WWW
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 );

Logged
rbz ^ Codigos

madeyes

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

Shockwave

  • good/evil
  • ADMIN
  • Senior Member
  • ********
  • Karma: 357
  • Offline Offline
  • Posts: 15098
  • evil/good
    • View Profile
    • WWW
Re: Pixel shaders being buffered?
« Reply #3 on: December 12, 2009 »
Sounds delicious.
Logged
Shockwave ^ Codigos....  Error: Keyboard not attached.... Press F1 to continue.
Pages: [1]   Go Up
 

 

B l a c k R a i n V.2 by C r i p

Page created in 0.111 seconds with 19 queries.