Grainy camera effect

Blitz3D Forums/Blitz3D Programming/Grainy camera effect

Something like this .... untested and you'll need to play with the texturescale and spritescale due to power of 2 textures etc.. and screen aspect etc...


global QGW = graphicswidth()*.25
global QGH = graphicsheight()*.25
global MainCam = createcamera()
global PixelCam = createcamera()
global PixelTex = createtexture( QGW , QGH )
global PixelSprite = createsprite( MainCam )
positionentity PixelSprite , 0, 0, 1
scalesprite PixelSprite , ?? , ?? ; 
scaletexture PixelTex, ??, ??
textureblend PixelTex , 3  ; additive blend or maybe use entityalpha 


In the main loop ....

Cameraprojmode MainCam, 0
Cameraprojmode PixelCam, 1
renderworld()
copyrect 0,0, QGW, QGH , 0, 0, backbuffer(), texturebuffer( PixelTex )
cameraprojmode PixelCam, 0
cameraprojmode MainCam, 1
renderworld()
flip


This should give you a basis, if you need a working example then give me a shout.

Stevie