Last update: February 17, 2012
This page holds some of the stuff Jeff has written using
REALstudio. They are provided as-is and free of charge. If you do use these in other projects, all I ask is for credit be provided. I'd also love to know what you might be using it for, so please
email me to let me know!
Preview of what's coming
February 17, 2012
Just a few quick notes on what's being worked on:
- Using GLSL directly in rendering code for faster rendering.
- More demo apps to showcase how to use the classes.
As always, if you want the latest please email me.
GL - v0.42
Released: February 17, 2012
GL is a complete REALbasic-written replacement of RB3D, the (now deprecated) 3D API built into REALbasic. It currently runs on Macs and Windows.
The goal was to not only write as close to a feature-complete implementation of RB3D using
OpenGL calls and thus obviating the need for Quesa, but also takes things a step further,
allowing one to accomplish things which are now difficult to achieve without resorting to
declares. Basically, I added what I always wanted to see in RB3D. See the included readme PDF for more details, but some of the features are:
- Compiles under REALstudio 2009 and greater for Mac and Windows
- Import of 3DMF, Wavefront OBJ, and Milkshape 3D objects
- Multiple textures and blend styles per object
- Per-object opacity, among other per-object attributes
- Support for GLSL and OpenGL low-level shaders
- Basic shapes: Box, torus, disk, sphere, cylinder
- Extensive support for OpenGL extensions
NOTE: This is a work in progress. Therefore some functionality might change. Consider yourself warned!
NOTE #2: Support for older REALstudio versions lower than 2009 is no longer supported. This is primarily due to a switch to using the built-in OpenGLSurface, which makes it easier for me to emulate the canvas-like property of the original RB3Dsurface and also mostly eliminates the need for the .DLL file for Windows. Also, RS2011r3 and above will compile apps that the Mac App Store likes, so there's that consideration as well.
NOTE #3: The documentation is not complete, and by this I mean that there is no inclusion of the original RB3D functions. If you need this, download an earlier version of REALbasic and refer to the Language Reference. Also, the included documentation itself is not complete yet.
Download v0.42
- [NEW] glElement.GetPositionWorld and SetPositionWorld are used to read/modify the absolute world coordinates of an element. glElement.Position now affects its position within its Parent's local coordinate space that it's in. This is a fundamental shift that could break older code as Position no longer is understood as world coordinates, but it makes the underlying framework easier to maintain. If you need to retrieve world coordinates, glElement.PositionWorld will give you this.
- [NEW] gVector3D adds TimesVec3 and MultiplyVec3 - convenience methods takes each component and multiplies it by its corresponding input component: X = X * input.X, Y = Y *
input.Y, Z = Z * input.Z.
- [NEW] Custom blending now has variable for setting the blend equation used. You need to pass the correct constant based on glBlendEquation.
- [NEW] glTextures now default to using trilinear filtering combined with anisotropic filtering. This results in better-looking textures. To do: Make this a modifiable option.
- [UPDATE] Sprites created by glTrimesh now have vertex normals.
- [FIX] glSpace.DrawGlow correctly binds texture.
- [FIX] glSpace.FindObject working again (broken in 0.41).
- [FIX] Screenshots can now be taken again (broken in 0.41).
- [FIX] Bounds3D better accounts for scaling.
- [FIX] Windows GLSL should be working correctly now.
- [FIX] Texture import on 32-bit pictures with an alpha now works correctly.
- [FIX] glSpace now allows user access to Open, Resized, and Render Events. Note that any user code added here happens AFTER the glSpace has run its own code.
- [FIX] Texture updating is now faster.
- [FIX] glElement3D.MoveFoward now works correctly with its orientation. Before this it would only move an element along its Z-axis regardless of orientation.
As always, please refer to the included readme PDF for more information.
GL - v0.41
Released: December 23, 2011
Download v0.41
- [NEW] Updating glMaterial.Texture now updates the model's texture immediately. There is still
an overhead for such updates, so update sparingly.
- [NEW] gTrimesh.AddShapeMaterial and AddShapeMaterials. These are convenience methods
for creating sprites with already-created glMaterials.
- [NEW] glBillboard and glBillboards: creates a single or multiple camera-facing sprites. More
flexible than glPointSprites but are slower to draw.
- [NEW] glPointSprites: creates camera-facing sprites with nothing more than a texture and
a center point. If used, this bumps up the OpenGL version requirements to 1.5 or requires
access to ARB_point_sprite. NOTE: Not fully tested on Windows.
- [NEW] Added Negate method to glVector3D, returning negation of that vector (or you can use
the overloaded operator mentioned below).
- [NEW] Overloaded add, multiply, divide, subtract, and negate operators for glVector3D to
make it easier to perform or read complex math with vectors (ie: vec1 + vec2 instead of vec1.
add(vec2)).
- [NEW] glSpace.FindMouseRay: Given the mouse's X, Y coordinates, return a ray consisting of
start point and direction (normalized and pointing into screen) vectors.
- [NEW] MatrixMath Module removes matrix stuff from glManager Module.
The fixes and updates are too numerous to list — please refer to the included readme PDF for more information.
GL - v0.35
Released: March 23, 2010
Download v0.35
- [FIX] glCopyTexSubImage2D was incorrectly declared for RB2009r2 and lower (correctly declared for RB2009r3 and above, however).
- [FIX] MatrixMath.Mult4x4Matrix multiplication order switched. Previously multiplied B x A instead of the expected A x B.
- [NEW] MatrixMath Module removes matrix stuff from glManager Module.
- [FIX] glGroup3D.Opacity is now working.
- [FIX] Update to Quaternion.MultiplyBy. Older version may have been inaccurate.
- [FIX] OpenGL declares to built-in OpenGL Module now only for RB2009r3 and above.
- [FIX] Stability improvements to grabbing large screenshots.
- [FIX] Texturing mistakes cleaned up. Before, it was possible that a texture might be applied to the wrong object under certain circumstances. Note that more ' xes may be still forthcoming in this area.
Older versions:
> Download v0.31
> Download v0.2
> Download v0.1
Test models that I've created for other REALbasic games can be downloaded here.