Blender Git Commit Log

Git Commits -> Revision d11a5bb

Revision d11a5bb by Benoit Bolsee (master)
April 21, 2009, 11:01 (GMT)
BGE: Support mesh modifiers in the game engine.

Realtime modifiers applied on mesh objects will be supported in
the game engine with the following limitations:

- Only real time modifiers are supported (basically all of them!)
- Virtual modifiers resulting from parenting are not supported:
armature, curve, lattice. You can still use these modifiers
(armature is really not recommended) but in non parent mode.
The BGE has it's own parenting capability for armature.
- Modifiers are computed on the host (using blender modifier
stack).
- Modifiers are statically evaluated: any possible time dependency
in the modifiers is not supported (don't know enough about
modifiers to be more specific).
- Modifiers are reevaluated if the underlying mesh is deformed
due to shape action or armature action. Beware that this is
very CPU intensive; modifiers should really be used for static
objects only.
- Physics is still based on the original mesh: if you have a
mirror modifier, the physic shape will be limited to one half
of the resulting object. Therefore, the modifiers should
preferably be used on graphic objects.
- Scripts have no access to the modified mesh.
- Modifiers that are based on objects interaction (boolean,..)
will not be dependent on the objects position in the GE.
What you see in the 3D view is what you get in the GE regardless
on the object position, velocity, etc.

Besides that, the feature is compatible with all the BGE features
that affect meshes: armature action, shape action, relace mesh,
VideoTexture, add object, dupligroup.

Known problems:
- This feature is a bit hacky: the BGE uses the derived mesh draw
functions to display the object. This drawing method is a
bit slow and is not 100% compatible with the BGE. There may
be some problems in multi-texture mode: the multi-texture
coordinates are not sent to the GPU.
Texface and GLSL on the other hand should be fully supported.
- Culling is still based on the extend of the original mesh.
If you have a modifer that extends the size of the mesh,
the object may disappear while still in the view frustrum.
- Derived mesh is not shared between replicas.
The derived mesh is allocated and computed for each object
with modifiers, regardless if they are static replicas.
- Display list are not created on objects with modifiers.

I should be able to fix the above problems before release.
However, the feature is already useful for game development.
Once you are ready to release the game, you can apply the modifiers
to get back display list support and mesh sharing capability.

MSVC, scons, Cmake, makefile updated.

Enjoy
/benoit

Commit Details:

Full Hash: d11a5bbef2750c9e95c0657eb9d965de375b2982
SVN Revision: 19841
Parent Commit: 3e7cbd5
Lines Changed: +663, -91

2 Added Paths:

/source/gameengine/Converter/BL_ModifierDeformer.cpp (+149, -0) (View)
/source/gameengine/Converter/BL_ModifierDeformer.h (+97, -0) (View)

36 Modified Paths:

/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj (+0, -8) (Diff)
/projectfiles_vc9/gameengine/converter/KX_converter.vcproj (+12, -4) (Diff)
/projectfiles_vc9/gameengine/rasterizer/openglrasterizer/RAS_openglrasterizer.vcproj (+7, -6) (Diff)
/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj (+7, -6) (Diff)
/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj (+0, -1) (Diff)
/source/blender/blenkernel/BKE_DerivedMesh.h (+3, -0) (Diff)
/source/blender/blenkernel/intern/DerivedMesh.c (+19, -2) (Diff)
/source/gameengine/Converter/BL_BlenderDataConversion.cpp (+13, -5) (Diff)
/source/gameengine/Converter/BL_ShapeDeformer.cpp (+7, -3) (Diff)
/source/gameengine/Converter/BL_ShapeDeformer.h (+2, -1) (Diff)
/source/gameengine/Converter/BL_SkinDeformer.cpp (+32, -26) (Diff)
/source/gameengine/Converter/BL_SkinDeformer.h (+3, -1) (Diff)
/source/gameengine/Converter/BL_SkinMeshObject.cpp (+1, -1) (Diff)
/source/gameengine/Ketsji/BL_Material.cpp (+1, -1) (Diff)
/source/gameengine/Ketsji/BL_Material.h (+1, -2) (Diff)
/source/gameengine/Ketsji/KX_BlenderMaterial.cpp (+23, -1) (Diff)
/source/gameengine/Ketsji/KX_BlenderMaterial.h (+3, -1) (Diff)
/source/gameengine/Ketsji/KX_PolygonMaterial.cpp (+14, -0) (Diff)
/source/gameengine/Ketsji/KX_PolygonMaterial.h (+3, -3) (Diff)
/source/gameengine/Ketsji/KX_Scene.cpp (+34, -2) (Diff)
/source/gameengine/Rasterizer/CMakeLists.txt (+1, -0) (Diff)
/source/gameengine/Rasterizer/Makefile (+1, -0) (Diff)
/source/gameengine/Rasterizer/RAS_Deformer.h (+4, -0) (Diff)
/source/gameengine/Rasterizer/RAS_IPolygonMaterial.cpp (+30, -0) (Diff)
/source/gameengine/Rasterizer/RAS_IPolygonMaterial.h (+10, -1) (Diff)
/source/gameengine/Rasterizer/RAS_MaterialBucket.cpp (+39, -0) (Diff)
/source/gameengine/Rasterizer/RAS_MaterialBucket.h (+3, -0) (Diff)
/source/gameengine/Rasterizer/RAS_MeshObject.cpp (+13, -0) (Diff)
/source/gameengine/Rasterizer/RAS_MeshObject.h (+1, -0) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/CMakeLists.txt (+4, -0) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/Makefile (+5, -0) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.cpp (+23, -13) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_ListRasterizer.h (+5, -3) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp (+79, -0) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_VAOpenGLRasterizer.cpp (+12, -0) (Diff)
/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript (+2, -0) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021