hardware accelerated Balloon3D (wonderland) under Windows

Andreas Raab andreas.raab at gmx.de
Mon Mar 22 18:57:12 UTC 2004


Hi Ferdinand,

> I'm a Squeak newbie and tried to get hardware
> acceleration to wotk with Squeak 3.6 and Wonderworld.
> The steps I tried:
>
> * call the accelerationEnabled: true - method of
> my WonderlandCameraMorph instance (after a few tries,
> myCameraWindow accelerationEnabled returns true,
> but the framerate doesn't go up)

You can use the entry from the 3D-Morphs red halo menu to "enable
acceleration" (or whatever it is called).

> * build a new vm with the vmmaker and include
> B3DAccelerationPlugin as internal plugin
> (no clue if that is the case in the default vm -
> don't know how to check that either)

It is. The way to check is to evaluate "Smalltalk listBuiltinModules" which
gives you a long list of plugins that are right built in the VM.

> What am I doing wrong?

Many things can go wrong. One of the first things to check is whether you
use D3D or OpenGL as the acceleration layer (this can be found by pressing
F2 then go to "display and sound" and see if "use OpenGL instead of D3D" is
on). Depending on the layer you use your system might (or might not) have
the appropriate drivers. Note that if you change the settings you may have
to restart Squeak.

> P.S.: I'm not shure if I understood that right:
> B3DAccelerationPlugin initialiseModule calls a method
> b3dxInitialize that doesn't seem to exist in Smalltalk.
> But there is a equivalent in the C- sourcecode.
> Is that the case because this method is translated and
> linked C to the other C-functions or have I still overlooked
> the b3dxInitialize-Smalltalk variant?

No, this is precisely correct. The B3DAcceleratorPlugin is translated to C
and linked against the various bits and pieces of the support code.

> I haven't found the point, where the system decides if
> it should use hardware or software-rendering by default,
> so I thought it could be there...

"By default" the system doesn't choose anything. The code has to be specific
about a) whether to try to enable the hardware acceleration at all (this is
what happens when you use "enable acceleration") and b) whether it is
acceptable or not if the system falls back onto a software renderer in its
own acceleration layer. The latter can be useful as the builtin software
renderer has certain limitations and depending on what exactly you do it may
be advantageous to use the "other simulation layer" because of its features.
So basically you have three choices:
a) Use Squeak's builtin 3D renderer (this what Wonderland starts up with)
b) Use the underlying 3D layer for rendering,
    b1) hardware accelerated
    b2) simulated
Wonderland works in the way that it uses a) and if you "enable acceleration"
b1) and b2) in that order.

The underlying support code (which lives in sqWin32[D3D|OpenGL].c) tries
*hard* to find a suitable representation for the accelerated mode but
depending on driver and requested features it may not be able to create an
accelerated renderer. In this case, if it is allowed to do so, it will use a
software renderer, or fail entirely.

Cheers,
  - Andreas





More information about the Squeak-dev mailing list