Commit Graph

178 Commits

Author SHA1 Message Date
Benoit Bolsee
3abb8e8e68 BGE performance: second round of scenegraph improvement.
Use dynamic linked list to handle scenegraph rather than dumb scan
of the whole tree. The performance improvement depends on the fraction
of moving objects. If most objects are static, the speed up is 
considerable. The following table compares the time spent on 
scenegraph before and after this commit on a scene with 10000 objects
in various configuratons:

Scenegraph time (ms)              Before         After
(includes culling)

All objects static,               8.8            1.7  
all visible but small fraction          
in the view frustrum

All objects static,               7,5            0.01
all invisible.

All objects moving,               14.1           8.4
all visible but small fraction
in the view frustrum

This tables shows that static and invisible objects take no CPU at all
for scenegraph and culling. In the general case, this commit will 
speed up the scenegraph between 2x and 5x. Compared to 2.48a, it should
be between 4x and 10x faster. Further speed up is possible by making
the scenegraph cache-friendly.

Next round of performance improvement will be on the rasterizer: use
the same dynamic linked list technique for the mesh slots.
2009-05-03 22:29:00 +00:00
Benoit Bolsee
ba563216e9 BGE: Fix Orthographic mode and viewport scaling
- the BGE now uses correct glOrtho projection whe camera is in orthographic mode
-
2009-04-26 12:23:30 +00:00
Benoit Bolsee
d11a5bbef2 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
2009-04-21 11:01:09 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Andrea Weikert
629c4bf8bf 2.5 MSVC9 projectfiles
* long time due: copy the executables to the install/msvc9 or install/msvc9d dir instead of keeping them in the source tree in the bin folder!
* copy the new ui scripts to the install dir
2009-04-18 10:08:19 +00:00
Andrea Weikert
73f4401ac3 2.5 MSVC9 projectfiles
- added editors/keyingsets.c
2009-04-18 08:40:14 +00:00
Benoit Bolsee
0b8661ab4d BGE: Occlusion culling and other performance improvements.
Added occlusion culling capability in the BGE. 
More info: http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.49/Game_Engine#BGE_Scenegraph_improvement
MSVC, scons, cmake, Makefile updated.

Other minor performance improvements:
- The rasterizer was computing the openGL model matrix of the objects too many times
- DBVT view frustrum culling was not properly culling behind the near plane:
  Large objects behind the camera were sent to the GPU
- Remove all references to mesh split/join feature as it is not yet functional
2009-04-13 20:08:33 +00:00
Andrea Weikert
e625d9875e 2.5 MSVC projectfiles
- added missing files
- cleanup of some project settings
- RNA building has dependency issue: had to add interface_api.c to the makesrna project and makesrna and rna projects now include editors.
- added debug libraries for OpenExr, please update lib/windows/openexr to get them
2009-04-12 20:34:46 +00:00
Benoit Bolsee
2074128fad Patch #18462: Fisheye (Dome) and Spherical Panoramic mode in BGE.
User guide:
http://wiki.blender.org/index.php/Dev:Source/GameEngine/Fisheye_Dome_Camera

Fixed two bugs from original patch:
- deleting a text will clear the warp field from Game framing settings
- removed spurious black dots along the edge of the cube map in the gameplayer 

Known limitation:
- resizing of the screen doesn't work in the gameplayer

Known bugs:
- Texture with reflexion are not rendered correctly
- Spurious problems with light
2009-04-08 15:06:20 +00:00
Benoit Bolsee
51b4145841 BGE Scenegraph and View frustrum culling improvement.
This commit contains a number of performance improvements for the
BGE in the Scenegraph (parent relation between objects in the
scene) and view frustrum culling.

The scenegraph improvement consists in avoiding position update
if the object has not moved since last update and the removal
of redundant updates and synchronization with the physics engine.

The view frustrum culling improvement consists in using the DBVT
broadphase facility of Bullet to build a tree of graphical objects
in the scene. The elements of the tree are Aabb boxes (Aligned 
Axis Bounding Boxes) enclosing the objects. This provides good
precision in closed and opened scenes. This new culling system
is enabled by default but just in case, it can be disabled with
a button in the World settings. There is no do_version in this
commit but it will be added before the 2.49 release. For now you
must manually enable the DBVT culling option in World settings
when you open an old file.

The above improvements speed up scenegraph and culling up to 5x.
However, this performance improvement is only visible when
you have hundreds or thousands of objects.

The main interest of the DBVT tree is to allow easy occlusion
culling and automatic LOD system. This will be the object of further
improvements.
2009-04-07 22:14:06 +00:00
Benoit Bolsee
14e3b041ba MSVC9 project file update 2009-04-07 19:57:30 +00:00
Benoit Bolsee
29f5c7dd5d MSVC9 project file. 2009-04-03 19:19:02 +00:00
Benoit Bolsee
8a840c35be MSVC9 project file update. 2009-04-02 21:53:52 +00:00
Daniel Genrich
03759bc248 Adding missing files to vcproj:
/source/blender/blenfont/intern/blf_font_helv10.h
/source/blender/blenfont/intern/blf_internal.c
2009-03-30 14:07:59 +00:00
Andrea Weikert
64f2dd52cb 2.5 MSVC 9 projectfiles
- update for editors/armature
- update for RNA_context
2009-03-29 08:40:43 +00:00
Benoit Bolsee
bd13f30224 MSVC project files updated for ffmpeg 0.5 and armature. You must also update lib/windows. 2009-03-22 23:39:36 +00:00
Brecht Van Lommel
d52400bfbd 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r18677:19317
Notes:
* Sequence transform strip uses G.scene global, this is commented
  out now, should be fixed.
* Etch-a-ton code was most difficult to merge. The files already in
  2.5 got merged, but no new files were added. Calls to these files
  are commented out with "XXX etch-a-ton". editarmature.c and
  transform_snap.c were complex to merge. Martin, please check?
* Game engine compiles and links again here for scons/make/cmake
  (player still fails to link).
2009-03-17 21:44:58 +00:00
Andrea Weikert
b907b9fd9b 2.5 filebrowser
* added filter buttons to header
* changed large icon for movie files to match small icon
* fixed small stack corruption in interface_draw.c (Matt, check if this is ok)
* moved nice display of file size to storage.c, where string is created.
2009-03-14 13:12:11 +00:00
Benoit Bolsee
51b3bba1c0 Update MSVC9 project file for VideoTexture 2009-03-05 15:35:15 +00:00
Andrea Weikert
1a380356fc 2.5 MSVC9 projectfiles
- space_text update
2009-03-02 13:55:53 +00:00
Benoit Bolsee
9265150942 MSVC9 project file: add ffmpeg avdevice lib to linker for the blenderplayer. 2009-02-28 21:37:49 +00:00
Andrea Weikert
924ff0dc98 2.5: updated MSVC9 project files
- blenfont
- editors: sculpt changed to sculpt_draw
- some RNA additions (rna_animation.c)
- fixed some game engine include directories
2009-02-28 09:59:27 +00:00
Benoit Bolsee
95f91f2a46 MSVC9 project files: reactivate VideoTexture module in BGE; it that was disabled for some reason. 2009-02-19 23:15:27 +00:00
Benoit Bolsee
4f3768af49 Update MSVC9 project files 2009-02-07 20:47:23 +00:00
Andrea Weikert
d3dd4f6a86 2.5 MSVC9 projectfiles
update for renaming space_ipo -> space_graph
2009-02-06 21:18:36 +00:00
Andrea Weikert
3783d7fcbb 2.5 MSVC9 projectfiles
updates: 
* project blenfont added
2009-02-01 13:40:07 +00:00
Andrea Weikert
f29a20043c 2.5 MSVC9 projectfiles
updates: 
* windowmanager/wm_draw.c
* editors/space_ipo: ipo_draw.c, ipo_edit.c and ipo_ops.c
2009-01-28 18:02:15 +00:00
Brecht Van Lommel
8762737400 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17853:HEAD 2009-01-26 08:34:40 +00:00
Andrea Weikert
94a4a2066a 2.5 MSVC9 projectfiles
updates: 
* windowmanager/wm_jos.c
* editors/datafiles/preview.blend.c
2009-01-22 18:09:59 +00:00
Andrea Weikert
cf9d0cf2e8 2.5 MSVC9 projectfiles
updates: 
* windowmanager/wm_draw.c
2009-01-21 19:11:20 +00:00
Andrea Weikert
e673edd388 2.5 MSVC9 projectfiles
updates: 
* several new files added to editors/space_sequencer
* several new files added to editors/preview
2009-01-20 19:00:00 +00:00
Andrea Weikert
332517957d 2.5 MSVC9 projectfiles
updates: 
* RNA: rna_space.c and rna_vpaint.c
* DNA: DNA_anim_types.c
* blenkernel: anim_sys.c, fcurve.c
* editors: space_image several files added
* editors: uvedit several files added
* editors: gpencil: several files added
2009-01-18 15:37:09 +00:00
Andrea Weikert
b22fecea79 2.5 MSVC9 projectfiles
* added new files in editors/object and editors/space_sequence
* added seqeffects.c in blenkernel
2009-01-13 20:30:22 +00:00
Andrea Weikert
f4c2a9fa7c 2.5 MSVC9 projectfiles
small update: 
* added editors/space_ipo(ipo_draw.c
* added editors/object/editconstraint.c
2009-01-11 15:15:15 +00:00
Andrea Weikert
38e263171e 2.5 MSVC9 projectfiles
* update of RNA project after reorganisation
* added editors/space_view3d/vpaint.c and editors/mesh/editdeforn.c to projectfiles
2009-01-08 18:20:47 +00:00
Andrea Weikert
7c251bffaf 2.5 MSVC9 projectfiles
updates:
- booleanops.c and booleanops_mesh in blenkernel
- screendump.c in editors/screen
- keyval.c in editors/interface
- RNA: rna_pose.c
2009-01-07 18:04:14 +00:00
Andrea Weikert
ad3d552226 2.5 MSVC9 projectfiles
update: editors/sculpt files
2009-01-06 22:41:47 +00:00
Andrea Weikert
fc28d3cf75 2.5 filebrowser
further cleanup:
- moved struct FileList* back to SpaceFile
- fix for memory related errors and freeing operator in file_free
- removed wmSubWindowSet, we're not doing OpenGL select in filebrowser
- removed drawing of load button when invoked from windowtype pupmenu
2.5 MSVC projectfiles:
- slipped in removal of multires_firstlevel.c in blenkernel
2009-01-06 19:22:29 +00:00
Andrea Weikert
b1cb844e05 2.5 - Start of filebrowser.
- basic drawing of list and thumbnail view (switchable through 'favourits' icon in header)
- selection of files and directories (bookmarks) works with the RMB (right mouse button)
- load operator for files still unstable (no check for correct file type) and incomplete. (WM_operator_free missing)
immediate TODOS:
- fix load file operator
- finish drawing of buttons in header
- drawing of detailed list with all file info.
- finish selection and execute operators (LMB and MMB execute)
later todos:
- parent dir
- keymap for all the shortcuts
- append/link and databrowse
- ...
2009-01-06 14:42:54 +00:00
Andrea Weikert
aa95fc1768 2.5 MSVC9 projectfiles
updates:
* stubs.c was moved from editors/screen to python
* RNA: rna_action.c
* Armature: all in editors/armature added.
2009-01-06 09:08:43 +00:00
Andrea Weikert
33dd818310 2.5 MSVC9 projectfiles
updates:
* RNA: several files (rna_cloth, rna_object_force.c, rna_particle.c, rna_scriptlink.c, rna_text.c, rna_texture.c, rna_userdef.c)
* complete removal of verse and cleanup of WITH_VERSE from projectfiles
* deleted projectfiles for BL_src - not needed anymore.
* editors/mesh: mesh_intern.h was renamed from editmesh.h, new file mesh_ops.c
* editors/util: editmode_undo.c, undo.c and util_intern.h added
* editors/animation: anim_channels.c  added
* editors/space_action: action_edit.c  added
2009-01-04 19:39:35 +00:00
Andrea Weikert
14d1538941 2.5 MSVC9 projectfiles
updates:
* editors/mesh: added all files
* editors/transform: transform_input.c
* RNA: rna_fluidsim.c
2008-12-30 16:04:27 +00:00
Benoit Bolsee
d91daaa5f6 MSVC project file update for ffmpeg device lib, release build 2008-12-29 14:26:36 +00:00
Andrea Weikert
b928d90021 2.5 MSVC9 projectfiles
updates:
* editors/transform: added all files
* editors/animation: keyframes_general.c
* editors/space_node: node_state.c
note: had to remove WITH_VERSE from editors, due to BIF_verse not beeing ported (yet?)
2008-12-29 09:19:37 +00:00
Andrea Weikert
7a7fb5add9 2.5 MSVC9 projectfiles
updates:
* BPY_python: bpy_opwrapper.c, bpy_util.c
* editors/space_action: action_edit_keyframes.c
* editors/space_node: node_ops.c, node_select.c
2008-12-28 11:27:54 +00:00
Andrea Weikert
f10e828b1e 2.5 MSVC9 projectfiles
updates:
* rna_sound.c
2008-12-26 17:37:16 +00:00
Andrea Weikert
21b45f3b00 2.5 MSVC9 projectfiles
updates:
* new file editors/interface/interface_panel.c
* new files in editors/space_node
* new file editors/space_buttons/buttons_scene.c
* new files in editors/space_script
* new files in editors/object
2008-12-26 15:52:59 +00:00
Andrea Weikert
7563e5e454 2.5 MSVC9 projectfiles
* update for editors/animation editors/space_outliner and editors/screen
* also fix compile error when INTERNATIONAL is set (will likely be solved with new font API)
2008-12-23 12:25:44 +00:00
Andrea Weikert
fa12c089b1 2.5 MSVC9 projectfiles
* small update for anim_keyframes_draw.c and space_action/action_draw.c
2008-12-22 10:07:13 +00:00
Andrea Weikert
bdb3e2eb2b 2.5 MSVC9 projectfiles
* update for view3d_draw and view3d_select
* update for bpy_operator
2008-12-21 16:20:28 +00:00
Andrea Weikert
cc80111b2b 2.5
* fix lost declaration and missing includes after blenlib cleanup.
* bump warning level to W3 for Debug in a few libraries for MSVC9 projectfiles. Others will follow.
2008-12-20 12:43:53 +00:00
Andrea Weikert
019c15c1c9 2.5 MSVC9 projectfiles
* update for editors/animation
2008-12-20 10:19:24 +00:00
Andrea Weikert
ebb6628a01 2.5 BLI_blenlib cleanup
DONE:
* moved almost all declarations from BLI_blenlib.h into their own proper header files.
* BLI_blenlib.h still includes all the declarations for convenience and to avoid changes in existing code
* split util.c into several files, where it wasn't done already
*    DynamicList -> dynamiclist, 
*    ListBase    -> listbase, 
*    String utility functions -> string.c
* removed a few unused macros and functions, if they're needed back, they're still in svn ;)
TODO:
* btempdir global
* further cleanup in the code of the different modules (especially util.c)
2008-12-20 10:02:00 +00:00
Andrea Weikert
7729ddd424 2.5 MSVC9 projectfiles
updates for briging back view3d.
2008-12-19 18:11:17 +00:00
Andrea Weikert
af746acaad 2.5
Adding back internal files for file/imagebrowser.
2008-12-18 19:21:30 +00:00
Andrea Weikert
1d3a42451d 2.5 MSVC9 projectfiles
updates: 
* context.c and report.c in blenkernel (moved from wm)
* view3d_draw in editors 
* rna for sequence
2008-12-18 18:49:38 +00:00
Andrea Weikert
5858ce4495 2.5 MSVC9 projectfiles
update for space_action, space_nla,  space_script, space_sequencer, space_text,space_sound.
2008-12-14 18:12:30 +00:00
Brecht Van Lommel
ec00764dd2 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17434:HEAD 2008-12-14 17:32:24 +00:00
Andrea Weikert
8beed4b033 2.5 MSVC9 projectfiles
update for space_info and new files in space_file.
2008-12-14 13:03:33 +00:00
Andrea Weikert
a3c77e4d9e 2.5
Skeleton for bringing back SpaceFile.
Code to initialize the SpaceFile struct missing still, I think this is the right time to cleanup there :)
2008-12-14 11:25:00 +00:00
Andrea Weikert
616ab233fa == MSVC9 projectfiles ==
* lots of updates for space types/ editors: ipo, view3d, node and image
* rna: update for constraints and armatures
2008-12-14 10:33:18 +00:00
Andrea Weikert
6241b8a57f RNA
* rna for DNA_key_types.h, also linked to key member of Lattice, others need to be checked.
2008-12-03 21:18:10 +00:00
Andrea Weikert
23a77e7688 RNA
* DNA_packedFile_types: added rna definitions for packed files
* also experimentally filled in correct struct 'PackedFile' in image rna for testing.
* updated MSVC projectfiles (also for rna_curve.c and rna_vfont.c)

Note:
I removed PackedFile->flags, I did grep through source and a complete recompile of blender trunk svn without them too, so they obviously aren't needed anymore. A bit of cleaning up :)
2008-12-01 21:23:58 +00:00
Andrea Weikert
a821b7e5d1 == MSVC9 projectfiles ==
- update for several new rna files.
2008-12-01 20:53:01 +00:00
Andrea Weikert
a141e44e55 RNA
* DNA_lattice_types: added rna definitions for lattice u,v,w and some flags
* updated MSVC projectfiles
2008-11-30 16:38:56 +00:00
Andrea Weikert
743f3b7222 == MSVC projectfiles ==
== MSVC projectfiles ==
- update for python RNA API
- update for editors: ed_util.c
- fixed RNA_rna library project, doesn't need the c files included in rna.c
2008-11-30 11:55:44 +00:00
Joshua Leung
43b26b72ab View2D - Initial commit of Pan-View Operator
* Moved View2D data from space-data to ARegion (aka regions). This has been done because drawing occurs in regions not areas anymore. The View2D struct is currently stored in the ARegion struct (not as pointer), given that most of the regions in use will be 2D anyway (only the 3d-view's "window" region is the exception).
Added version patch code for outliner and timeline only for now. Headers are also likely to need this.

* Added separate keymap for View2D operators. All regions that use View2D will need this added. This includes headers too. 

* Pan view operator (ED_View2D_OT_view_pan), currently works for Outliner and Timeline. Use MMB-drag as before. 
- It currently doesn't exposed any parameters for redo (via RNA-ID-Props), but only uses some customdata. Suggestions on what these parameters could be are welcomed. 
- I've yet to implement the necessary axis-locking features for this panning (which is required in Timeline for example to prevent vertical panning, which moves the markers out of view).
2008-11-30 06:15:33 +00:00
Andrea Weikert
d1c0d0aa2c == MSVC projectfiles ==
- update for RNA_sensors.c
- added missing projectfile fpr DNA_DNA lib
2008-11-29 11:30:39 +00:00
Nathan Letwory
228ce647e0 * add material, node and screen RNA to project files 2008-11-29 01:33:22 +00:00
Benoit Bolsee
e988a9276c MSVC9 project file update for TEX nodes 2008-11-26 17:34:10 +00:00
Benoit Bolsee
c508db5659 MSVC9 project file update for blenderplayer 2008-11-26 17:23:22 +00:00
Andrea Weikert
03f9b73216 Bringing back icons:
Part 3/3: new icons
- Icon set done by jendrzych! Great job!
- cleaned up unnecessary includes and removed commented out code
- preview icons (for materials, textures,..) don't work yet, have to be ported to new event system
2008-11-25 19:23:54 +00:00
Andrea Weikert
af6b221107 == MSVC 2.50 projectfiles ==
- fixed dependencies and some glitches for RNA
- still WIP, but Blender Release and Blender Debug should compile now.
2008-11-23 20:06:47 +00:00
Andrea Weikert
369bdcc702 == MSVC project files ==
updated VisualStudio 9 projectfiles for blender 2.50
notes:
- still WIP
- dependencies have to be reviewed
- gameengine has been removed from build for now, needs to be added back at some point
- time, outliner and view3d editors have been added, other editors will have to be added when ported
2008-11-16 16:53:37 +00:00
Brecht Van Lommel
b3c238e8bc 2.5: merge with trunk, previous merge was only up to yesterday.
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r17416:HEAD
2008-11-12 22:03:11 +00:00
Andrea Weikert
8449f0d776 == MSVC projectfiles ==
update for texture nodes
2008-11-12 21:03:42 +00:00
Benoit Bolsee
6b86f835f8 MSVC90 project files: Tune projects build order to allow error-free build from clean state. 2008-11-11 16:48:34 +00:00
Benoit Bolsee
61a83d2fba Add MSVC90 project files - part 3. Extern and Intern projects are merged in projectfiles_vc9\blender\blender.sln solution, you just need to open that solution to compile everything with VS2008. 2008-11-10 21:22:22 +00:00