In the Extended 0.41, how do I apply a shader?

BlitzMax Forums/MiniB3D Module/In the Extended 0.41, how do I apply a shader?

zcbeaton(Posted 2008) [#1]
I'm trying to apply a Bloom shader to the world, but I cannot figure out how. As far as I can see, I can only apply shaders to specific entities? I tried to brush the camera, but that only made the game crash. How do I "brush" the entire world with a bloom shader?


klepto2(Posted 2008) [#2]
Bloomshaders and the like are so called postprocessing effects. So a step by step algo (pseudo) would look like this:

1. create a sprite (fullscreen)
2. create a texture and attach it to the sprite and apply the bloomshader to the sprite
3. mainloop
4. hide the sprite
5. render the scene
6. copy the backbuffer to the spritetexture
7. show the sprite
8. turnon the bloomshader
9. render the scene again


this is just in short terms. the new version will have (hopefully easy) a posteffect system which will be easy to extend.


zcbeaton(Posted 2008) [#3]
Hmm, I'm sure that works great, although I guess my shader is dodgy because the sprite seems to be showing a solid colour, although the colour does change from blacks and browns as I move around the map.

Do you see anything wrong with my shader?

bloom.frag