There's been quite a bit happening behind the scenes in PlayBASIC over the last few months.

While the individual beta releases haven't always looked particularly dramatic from the outside, Beta 80 through to Beta 92 represent a fairly substantial amount of work under the hood — particularly around the rendering and 3D side of PlayBASIC.

So, rather than simply listing the changes in Beta 92, it's probably worth taking a look at what has been happening across the last dozen or so revisions.

A lot more work on 3D

The biggest area of development has been the **Vertex Object** system.

Vertex Objects have been expanded considerably, with new support for:

* Vertex batching
* Improved clipping
* Vertex lighting
* Ambient lighting
* Fog
* Mesh generation
* Simple primitive meshes
* OBJ and MD2 mesh loading

New libraries have also been added to make working with meshes easier, including VertexObjectMeshes for creating simple primitives and VertexObjectLoader for loading basic OBJ and MD2 models.

This is still very much PlayBASIC's flavour of 3D — lightweight, accessible and intended to be useful from BASIC rather than attempting to turn PlayBASIC into something it isn't.

But underneath that simple interface, the rendering system is becoming considerably more capable.

TranslateMeshToScene gets rebuilt

A large part of this work centred around `TranslateMeshToScene()`.

Rather than continuing to patch the existing implementation, much of the routine has now been replaced.

The new implementation includes its own clipping system, texture surface caching and polygon subdivision, with support for both triangle and quad modes.

It also gained support for:

* Point sprites
* Wireframe rendering
* Frame writing/capture
* Gouraud support for point sprites
* Custom surface types for mesh capturing

The polygon capture system used by `TranslateMeshToScene()` was also replaced as part of this work.

This has been one of those pieces of development where the visible feature list doesn't really tell the whole story. A lot of the work has been about replacing the machinery underneath the existing commands so that it has a better foundation to build on.

More control over projection

Beta 83/84 also introduced the new camera projection origin commands:

PlayBASIC Code:
CameraProjectionOrigin CameraIndex, Xpos, Ypos

Xpos = GetCameraProjectionOriginX(CameraIndex)
Ypos = GetCameraProjectionOriginY(CameraIndex)
COMMANDS USED:


These provide direct control over where the camera's projection originates, giving a little more flexibility when working with the rendering system.

Making the renderer harder to break

Alongside the new features, there has also been quite a bit of work on the less glamorous side of rendering: finding the strange cases that make graphics code fall over.

There have been fixes for things such as:

* Polygon fillers underflowing on extremely small polygons.
* Gouraud polygon spans overlapping their final pixels.
* Polygon subdivision encountering a zero Z value during projection.
* Integer `MOD()` crashing when dividing by zero.
* Typed array parameter matching becoming stuck when supplied with an invalid type.

These aren't necessarily bugs you're going to encounter while drawing a box on screen, but they're exactly the sort of edge cases that tend to show up when you start pushing the renderer harder.

A new line clipper

The latest work in Beta 91/92 also introduces a new line clipping implementation behind the line drawing functions.

This is now being used by:

PlayBASIC Code:
LINE
LINEC
LineIntersectRect()
COMMANDS USED: LINE | LINEC | LINEINTERSECTRECT |


Early testing has shown the new implementation to be considerably more stable, particularly for `LineIntersectRect()`.

There was also a fix for a particularly nasty Sprite Debug rendering case where an offset sprite handle could result in a shape being rendered incorrectly outside the expected clipping conditions — and, in some circumstances, cause a runtime crash.

Replacing some of the older infrastructure

Not everything has been about rendering.

Beta 90 replaced the PlayUFF library and the PlayMapperClassic loader, continuing the gradual process of replacing some of the older supporting infrastructure around PlayBASIC.

There's also been plenty of testing and general cleanup happening alongside the larger changes.

So, what's actually changed?

Quite a lot, really.

The last few months have been less about adding a long list of isolated BASIC commands and more about strengthening the machinery underneath PlayBASIC.

The 3D side has received the biggest push, with the Vertex Object system gaining lighting, fog, clipping, batching, mesh generation and model loading, while the underlying mesh rendering and polygon processing code has been substantially reworked.

And that's really what Beta 92 represents.

It's not a new 3D engine suddenly appearing overnight. It's PlayBASIC's existing rendering system being progressively rebuilt and extended, one piece at a time.

There's still plenty more to do, but the foundations are considerably more interesting than they were a few months ago.