A downloadable tool for Windows

 Pseudo2D - 2D made in 3D, for Blitz3D

These functions provide a simple way to perform the 2D commands Line, Rect, Plot, Cls and Oval without to use the internal ones, but pure writepixelfast-based alternatives, and have it in the texture of a canvas mesh that is parented to the camera. The mesh is placed so a virtual screen (same resolution as backbuffer) is provided, existing only in 3D.  Esp. useful for Semitransparent HUD or GUI elements.

The reason why I implemented this was because I noticed some 2D commands are executed very slowly on my current laptop (win10, Radeon R3). Later I realized it's mainly the "Line" command (1000 random lines dropped to 0.5 frames/s!) , so I also wrote a Line-substitute in plain 2D, that will write to the backbuffer (see other file in the zip.) and not use any 3D elements. That one may be a better choice to simply speed up some old Blitz programs that use a lot of "Line" and became mysteriously slow, almost unresponsive (often it's the GUI).

However, this one has some potential too: it allows to use BrushAlpha to make an entire GUI (or anything "2D") semi-translucent, and to use other blending modes, like "additional" to make it glow. It also allows to draw things once and then have it on display with almost no speed loss, faster than to draw an image of the screen size - because it's just 2 additional triangles in the 3D scene.

Unlike in real 2D, where you draw things after a 3D renderworld, here you need to draw them before and also call UpdatePseudo2D() before the renderworld() (actually, you could let the 2D drawing commands where they are and just add the  UpdatePseudo2D() before the renderworld, but it would display those 2D things with a one-frame-delay.)

Download

Download
blitz3D_pseudo2d.zip 858 kB
Download
pseudo2D_v1_1.zip 19 kB

Install instructions

Load in Blitz3D and hit F5.

Development log

Comments

Log in with itch.io to leave a comment.

(+1)

I ❤️ it! will check it out..

(+1)

Thanks. Check out the update, it rocks.