Irregular Viewport

Blitz3D Forums/Blitz3D Beginners Area/Irregular Viewport

Buggy(Posted 2006) [#1]
Just wondering... is there a simple way to create an irregularly-shaped camera viewport, such as a circle? Or would you need tons of cameras, each capturing a single pixel or two?


t3K|Mac(Posted 2006) [#2]
use a mesh and render to texture (oldschool with copyrect from backbuffer or newschool using TOMs DLL with r2t) - apply texture to this mesh. et voila.


Buggy(Posted 2006) [#3]
Whoa. That's surprisingly simple!


t3K|Mac(Posted 2006) [#4]
didn't test it though. but it should work. i'll need that in my upcoming game. so sooner or later i will code that.


Dreamora(Posted 2006) [#5]
there is one point missing here:

Apply texture to a sprite and apply the "shape mask" as a second layer (with multiply. ie the white part defines the "viewport" and the black the cutout)

Putting it onto a self made shape would work as well but need much more polygons to do so.


Buggy(Posted 2006) [#6]
Thanks a bundle!