Development: 3D mouse, drag to walk, SSAO, screen effects with anti-aliasing, triangulation, X3D 3.3, soft shadows demo, VisibilitySensor, 3D world improvements for games
Hi everyone! We have a lot of news about new features and improvements in our engine and view3dscene. No new release yet, we just announce what is available in SVN (and can be tested by downloading view3dscene from snapshots). I really have to start making these news posts more often, otherwise they get ridiculously long, well.. as long as this one :)
Oh, and before we start: if you like seeing the engine grow so much, please consider donating. I really appreciate it, especially as I plan to spend next year without a regular job, focusing mostly on the development of "Castle 2", a new great open-source game using our engine.
Features and improvements implemented in the last months:
First of all, great news — we have new developer working on our engine: Jan Adamec. He's also the author of Room Arranger, a shareware program to design your room, apartment, house and more. The next version will use our engine for the internal viewer of generated VRML models :) Here' a movie of our engine used to render a house model from RoomArranger:
Thanks to Jan Adamec, we have a lot of new features and improvements to navigation in Walk/Fly modes:
We support 3D mouse devices in all our tools (like view3dscene and all engine examples, games etc.). Only under Windows for now — contributions for other OSes are welcome, of course.
The video below shows how 3D mouse works in various navigation modes:
Navigation by mouse dragging is now possible in Walk/Fly modes (similar to other VRML/X3D viewers). Drag with left mouse button to move forward, backward and rotate. Drag with right mouse button to move sideways (strafe) and fly up/down.
Holding Shift during movement allows to run (speed increases * 2).
Mouse wheel (look up / down) works for cameras inside Lazarus control (just like in TCastleWindow).
This nice screen summarizes most new controls used in Walk/Fly modes:
Also thanks to Jan Adamec, we have Screen Space Ambient Occlusion implemented inside our engine. Available as comfortable view3dscene menu item "View -> Screen Effects -> Screen Space Ambient Occlusion" (for developers: TCastleAbstractViewport.ScreenSpaceAmbientOcclusion
.) Works on arbitrary models out-of-the-box :) Uses our screen effects framework.
Screen effects cooperate now wit multi-sampling (anti-aliasing). Previously, any screen effect (like SSAO, or view3dscene effects, or effects in VRML/X3D files like demo_models/screen_effects/
from demo models) was disabling anti-aliasing.
Now we can use OpenGL ARB_texture_multisample to have multi-sample textures used with screen effects. The GLSL code of every screen effect is linked with some helper screen_xxx
functions. If you use them, your effects will work both with and without multi-sampling. The new functions are documented in future Screen Effects docs (this will replace the current Screen Effects docs at the next release). All existing engine effects, like SSAO and other view3dscene effects in "View->Screen Effects", are already ported to use scene_xxx functions and cooperate with anti-aliasing.
Triangulator fixes for complicated concave polygons. Various fixes to account for duplicated vertexes and (more general) collinear triangles inside polygon. Previously, they could cause problems, with normal vectors of polygon and ears determined incorrectly, and allowing invalid non-empty ear triangles. The video below visualizes how our simple triangulation algorithm (by ear clipping) works:
X3D 3.3 handling. See X3D 3.3 specification for details.
UNIT
statement handled (in both classic and XML encoding), see demo_models/x3d/units*
. Angle and length conversion is actually done.
For example, you can now express angles in degrees by simple declaration at the beginning of X3D file. This affects interpretation of these fields:
Length conversion is also possible. This is less useful IMHO — you can as well just wrap your model in a Transform with some scale. Actually, that's exactly our implementation of "UNIT length" for now — we simply add appropriate scale (calculated looking at length unit of inlined model (inner), and looking at length unit of inlining model (outer)).
MetadataBoolean
node added.
GravityPhysicsModelNode
renamed to ForcePhysicsModelNode
(spec was mistakenly confusing these two names). (Only parsing.)
Added SliderJoint.sliderForce
(Only parsing.)
DISEntityTypeMapping
has X3DUrlObject as ancestor (Only parsing.)
The only relevant thing still missing from full X3D 3.3 implementation is the new, very exciting for me, Volume rendering component. I would like to tackle it at some point, as it may be quite fun, impressive and useful. (But no deadline yet, so if you're really interested in seeing it implemented — contact me, patches are welcome :)
Victor Amat send us some very nice 3D model of German Pavillion in the Universal Expo of Barcelona of 1929, see the screenshots on the right, with very nice water and reflections.
And, also from Victor Amat, a nice soft shadows demo based on shadow maps. It's an adaptation from nVidia SDK 9, but using a PoissonDisk sampler instead of a jittered grid pattern. You can see a screenshot from it on the side. The source X3D file is inside demo models SVN, see subdirectory demo_models/shadow_maps/soft_shadow_poisson_sampling/
. Thousand thanks!
The X3D feature to specify height of the tallest object you can climb inside NavigationInfo.avatarSize[2]
field is now correctly supported. The demo model is inside demo models (open demo_models/navigation/avatar_climb_stairs.x3dv
; only in SVN for now, until next release).
VisibilitySensor
node is implemented (looking only at frustum for now). See the testcase sensors_environmental/visibility_sensor.x3dv in demo models SVN.
The speed of Examine rotation by keys is now capped at a maximum constant, to prevent accidentally making wildly fast (and, as such, useless and confusing) rotations.
view3dscene gets the "Screenshot" button on the toolbar (as it's an often used feature).
Making a screenshot in view3dscene doesn't capture GUI controls (like toolbar buttons). Previously, it was inconsistent, e.g. "movie screenshot" was not capturing toolbar but "single image screenshot" was capturing them (unless it was initiated from command-line...). The general rule now is: screenshot avoids the buttons, visualizations (bounding box), and such. You can always capture a screenshot using external application, with window frames and all features you want. view3dscene screenshot's purpose is to capture your scene — not any GUI cruft.
Our Blender X3D exporter updated to be compatible to Blender 2.62 (and as close as possible to distributed original Blender exporter).
Memory and speed optimizations for scenes with many shapes (iteration by "is nested" callbacks instead of temporary lists, better opaque/transparent detection and more). Also, Lazarus package settings are now more suitable for production use (no assertions, no range/overflow checks, optimization level = 2).
This also causes an upgrade of our requirements for FPC version: we require now FPC >= 2.6.0. We need the "is nested" feature, which I like a lot — it allows to utilize callbacks in more places, making things like traversing various trees more optimized and at the same time comfortable.
Developers: A lot of T3D class improvements to unify collision detection for all 3D objects. We now make all collision checks (every 3D object vs all others) go through exactly the same methods and look at the same properties. Of course you can customize it (e.g. player may not want to collide with items, to allow picking up items by stepping on them), but it's all uniform in the base T3D class. Previously, various collisions in "The Castle" (player vs level/creatures/items, creature vs level/other creatures/player etc.) had specialized hacky code.
Also more useful base 3D objects, transformed in more ways, aware of the world around them. The idea is to move "Castle 1" creatures AI to the engine, to make it trivial to use creature AI in your own games. I want to allow both using existing AI (like our walk-attack state AI), and easy designing of your own AI for specific game needs. Details:
Developers: a lot of improvements to game data handling, to make developing new games (like "Castle 2") more comfortable.
Developers: picking improvements with T3D hierarchy: unified "The Castle" style of picking, common to FPS games (pressing the "e" button when looking at item, stateless interaction with 3D items) with VRML/X3D pointer sensors (operating with TouchSensors and drag sensors, that is stateful, tracks isOver/isActive and generally more powerful). Now it all goes through T3D.PointingDeviceActivate/Move
, that can be overridden at each T3D.
The user-visible benefit from this is that you can now pick creatures to see their name and health status. (Press "e" (interact key) to see info about creature or item at the center of the screen.) The real benefit is that new games can use picking easily, for more purposes.
Developers: camera classes improvements: their input shortcuts are now published (making it possible to customize them from Lazarus object inspector), they do not descend from TUIControl (as you should only use cameras on SceneManager.Camera
), TCastleSceneManager.DefaultVisibilityLimit, better Camera.Radius
treatment.
Developers:Various improvements to example examples/lazarus/model_3d_viewer/
, based on Jan Adamec patches: buttons to change navigation mode, to make a screenshot, and nice engine logo.
Website stuff:
As you may have seen at our header, our small website joined the protests against the bad legislations being pushed lately — pretending to be about anti-piracy, in fact being about censorship and anti-privacy. Stop PIPA and SOPA in USA, Stop ACTA (in Polish) (list of ACTA issues in English here.)
Fundry.com (crowdfunding for software) has shut down in March/April. It was one of the ways to donate to our engine, where you could donate to a development of a particular feature (suggested by you or someone else). It's sad that the site bankrupted, as I liked the idea very much (even if my particular project didn't yet earn anything this way). Fortunately, I found quite a few alternatives for crowdfunding specifically for FOSS projects:
If you have any experience with these sites and would like to suggest some of them (or others), please share on our forum :)