Commit Graph

460 Commits

Author SHA1 Message Date
Porteries Tristan
2da9a39418 BGE : Fix black material on meshes without materials in blenderplayer.
Blenderplayer forgot to initialize the default material (defmaterail) with function init_def_material().
This reverts also the plumber commit 2fa4a48bcef05671890fafc3fe50a8fa619f0259.

Reviewers: campbellbarton
2015-05-24 11:46:57 +02:00
Sergey Sharybin
23a79c42b5 BGE Player: Fix compilation error after cleanup commit da8a62a 2015-05-04 14:39:12 +05:00
Thomas Szepe
e36b0cb8f3 BGE: New API method getDisplayDimensions
This patch adds a new API function to get the actual display dimensions in pixels.

Reviewers: dfelinto, sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Differential Revision: https://developer.blender.org/D648
2015-04-07 18:32:25 +02:00
Antony Riakiotakis
828c85a1bf sound module: Append functions with BKE (makes it easier to make them
out from local functions)
2015-03-26 11:35:41 +01:00
Bastien Montagne
d9fa9bffd5 Grmll, sorry for the noise, fix stupi cpoypaste typo in previous commit. 2015-02-26 11:46:05 +01:00
Bastien Montagne
ac26a61385 Attempt to fix BGE build on windows.
Caused by rBb5b359b48f7f35a79b3eec, better to try a full build before pushing that type of commit. :/
2015-02-26 11:42:22 +01:00
Antony Riakiotakis
b5b359b48f Warning messagebox for windows when an unsupported implementation of
OpenGL is detected:

Hoping to decrease the frequency of by far one of the most frequent bug
reports by windows users.

There is some reorganization of the GHOST API to allow easy addition of
further OpenGL options in the future. The change is not propagated too
deep to keep the size of the patch managable. We might reorganize things
here later.

For OpenGL we do two checks here:
One is a combination of GDI generic renderer or vendor microsoft
corporation and OpenGL version 1.1. This means the system does not
use GPU acceleration at all. We warn user to install a graphics
driver and of cases where this might happen (remote connection, using
blender through virtual machine)

The other one just checks if OpenGL version is less than 1.4 (we can
easily change that in the future of course) and warns that it is
deprecated.

Both cases will still let blender startup correctly but users should now
have a clear idea of the system being unsupported.

A user preference flag is provided to turn the warning off.

Now stop posting those bug reports without installing a driver first -
please?
2015-02-25 13:51:53 +01:00
HG1
f1a65a9fab makeScreenshot - adding frame number to the filename 2015-02-21 12:16:20 +00:00
Bastien Montagne
31219415d6 Fix BGE compilation after recent renames in BKE_image (tsst...). 2015-01-24 14:57:57 +01:00
Campbell Barton
29d2c71117 Fix for bool flag use 2015-01-07 12:08:55 +11:00
Jens Verwiebe
c1f54bcdcc OSX: revive GHOST_HACK_getFirstFile cause it breaks things on older OSX versions.
Dunno exactly why this was done earlier, but propose not to remove code not understood.
2014-12-25 15:12:56 +01:00
Campbell Barton
43fa4baa6c Refactor: BLI_path_util (part 2)
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23 18:55:52 +01:00
Campbell Barton
6308c16675 Refactor: BLI_path_util (split out app directory access)
This module is intended for path manipulation functions
but had utility functions added to access various directories.
2014-11-23 18:42:18 +01:00
Sergey Sharybin
80d1d624d3 Support dynamic loading of SDL libraries
This is mainly to address old issue when one need to have SDL library installed
in order to use our official builds. Some hip distros already installs SDL,
but it's not quite the same across all the variety of the distros.

We also now switching to SDL-2.0, most of the distros have it in repositories
already, so it shouldn't be huge deal to install it if needed.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D878
2014-11-17 17:43:18 +05:00
Jason Wilkins
8d084e8c8f Ghost Context Refactor
https://developer.blender.org/D643
Separates graphics context creation from window code in Ghost so that they can vary separately.
2014-10-07 15:47:32 -05:00
Campbell Barton
2e840e56cf CMake: correct include dirs 2014-07-01 09:36:28 +10:00
Bastien Montagne
414c70435d T39690: Modifications to Blender's 'temp dir' system.
Current temporary data of Blender suffers one major issue - default 'temp' dir on Windows is never
automatically cleaned up, and can end being quite big when used by Blender, especially when we have
to store per-process data (using getpid() in file names).

To address this, this patch:
* Divides tempdir paths in two, one for 'base' temp dir (the same as previous unique tempdir path),
  the other is a mkdtemp-generated sub-dir, specific to each Blender instance.
* Only uses base tempdir when we need some shallow persistance accross Blender sessions - and we always
  reuse the same filename (quit.blend...) or generate small file (crash reports...).
* Uses temp sub-dir for heavy files like pointcache or renderEXRs (Save Buffer option).
* Erases temp sub-dir on quit or crash.

To get this working it also adds a working 'recursive delete' to BLI_delete() under Windows.

Note that, as in current code, the 'recover render result' hack-feature that was possible
with SaveBuffer option is still removed. A real renderresult cache feature will be added
soon, though.

Reviewers: campbellbarton, brecht, sergey

Reviewed By: campbellbarton, sergey

CC: sergey

Differential Revision: https://developer.blender.org/D531
2014-06-23 13:42:54 +02:00
brita
1194037327 blenderplayer - Reviewed some command line options and the respective help
Doubts: are written as comments in the code
Current Problems:
 - stereo modes sometimes have different names and are ordered differently everywhere (blender properties panel names and tooltips, blenderplayer cmndline)
 - dome mode as several options, but can only take one at a time, like -D mode bla -D tilt X -D ...
 - gameoptions are also given one at a time, like above, but with an assignment -g option = X  . This is inconsistent.
 - gameoptions need to be reviewed and docummented
 - parent to window (-i) is useful for what? (there is no wiki on this either)
 - there is no support for verbose options like --help (blender itself supports it)

Reviewers: dfelinto, moguri

CC:

Differential Revision: https://developer.blender.org/D312
2014-04-06 14:38:15 -07:00
Campbell Barton
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
brita
9753641c5d Fix T38645 - Mouse reversed in standalone player with kde
Reviewers: moguri

Differential Revision: https://developer.blender.org/D344
2014-02-22 17:23:18 -08:00
Mitchell Stokes
6a2c467443 Blenderplayer: Fixing a memory leak.
IMB_moviecache_destruct() was not being called.
2014-02-03 14:25:59 -08:00
Campbell Barton
3b71cab420 Fix T38110: GameEngine keyboard sensor ignores unicode characters 2014-01-23 14:58:04 +11:00
Benoit Bolsee
c7029f06d9 Add new BGE Stereo mode: 3DTV top-bottom.
This mode is designed for passive 3D TV: the viewport is split
horizontally - left eye above, right eye below - but the original camera
viewport is squashed in each half (with half the vertical resolution).
This is necessary to restore the aspect ratio in the 3D output because the TV expands each half to the full screen size.
2014-01-02 00:26:15 +01:00
Campbell Barton
0d6ae3fda2 Main API: refactor naming, use BKE_main_ prefix and add main arg. 2013-12-30 13:25:27 +11:00
Sergey Sharybin
709041ed0b Threaded object update and EvaluationContext
Summary:
Made objects update happening from multiple threads. It is a task-based
scheduling system which uses current dependency graph for spawning new
tasks. This means threading happens on object level, but the system is
flexible enough for higher granularity.

Technical details:

- Uses task scheduler which was recently committed to trunk
  (that one which Brecht ported from Cycles).

- Added two utility functions to dependency graph:
  * DAG_threaded_update_begin, which is called to  initialize threaded
    objects update. It will also schedule root DAG node to the queue,
    hence starting evaluation process.

    Initialization will calculate how much parents are to be evaluation
    before current DAG node can be scheduled. This value is used by task
    threads for faster detecting which nodes might be scheduled.

  * DAG_threaded_update_handle_node_updated which is  called from task
    thread function when node was fully handled.

	This function decreases num_pending_parents of node children and
	schedules children with zero valency.

    As it might have become clear, task thread receives DAG nodes and
    decides which callback to call for it.

    Currently only BKE_object_handle_update is called for object nodes.

    In the future it'll call node->callback() from Ali's new DAG.

- This required adding some workarounds to the render pipeline.
  Mainly to stop using get_object_dm() from modifiers' apply callback.
  Such a call was only a workaround for dependency graph glitch when
  rendering scene with, say, boolean modifiers before displaying
  this scene.

  Such change moves workaround from one place to another, so overall
  hackentropy remains the same.

- Added paradigm of EvaluaitonContext. Currently it's more like just a
  more reliable replacement for G.is_rendering which fails in some
  circumstances.

  Future idea of this context is to also store all the local data needed
  for objects evaluation such as local time, Copy-on-Write data and so.

  There're two types of EvaluationContext:

  * Context used for viewport updated and owned by Main. In the future
    this context might be easily moved to Window or Screen to allo
    per-window/per-screen local time.

  * Context used by render engines to evaluate objects for render purposes.
    Render engine is an owner of this context.

  This context is passed to all object update routines.

Reviewers: brecht, campbellbarton

Reviewed By: brecht

CC: lukastoenne

Differential Revision: https://developer.blender.org/D94
2013-12-26 17:24:42 +06:00
Sergey Sharybin
ff9974ed69 Fix T37898: blenderplayer painfully slow in recent builds
Issue was caused by recent image cache rewrite and root of
the issue goes to the fact that blender player doesn't
initialize cache limiter and it uses 32meg of memory only.

This leads to infinite image loading/freeing.

For now disabled cache limiter in game engine, this brings
back old behavior.

In theory we might be smarter here, but better caching
policy is to be discussed.
2013-12-22 15:26:59 +06:00
Campbell Barton
c1c26c36f6 Style Cleanup: remove preprocessor indentation (updated wiki style guide too) 2013-12-22 14:12:19 +11:00
Jens Verwiebe
dba787f529 OSX/player: Remove some very old code ( 11 years+ ), was commented anyway 2013-11-05 20:30:09 +00:00
Jens Verwiebe
1808dd0828 Scons: Fix BGE compile after cleanup 2013-11-05 10:56:52 +00:00
Mitchell Stokes
64c346ed1e BGE Rasterizer Cleanup: The Blenderplayer now loads the monospace font so it can properly draw the framerate and profile display. 2013-11-04 19:22:15 +00:00
Mitchell Stokes
0cec5c63da BGE Rasterizer Cleanup: Removing the Singletexture material mode. More conversion code will probably be needed. 2013-11-04 19:21:50 +00:00
Mitchell Stokes
cf9fe8f329 BGE Rasterizer Cleanup: Removing RAS_IRenderTools and moving the functionality to RAS_IRasterizer. RAS_OpenGLRasterizer is a bit of a mess now with references to Ketsji and other modules it shouldn't be accessing. 2013-11-04 19:21:07 +00:00
Campbell Barton
23440884fe fix for casting shadows of scaled objects was made to X_BlenderRenderTools.cpp but not to GPC_RenderTools.cpp. 2013-10-07 12:14:59 +00:00
Campbell Barton
11087d4a82 remove minor differences between these 2 files which are almost exact duplicates (tsk tsk!) 2013-10-07 12:12:59 +00:00
Campbell Barton
43217da6d9 set mempool debug in the game-engine-player too. also remove redundant mempool includes. 2013-10-03 16:34:00 +00:00
Daniel Stokes
494687908c BGE: Potential fix for [#35522] Broken game engine compatibility since 2.66a on some ATI cards?
Disabling display lists for legacy ATI cards since they don't support display lists well.

Also removing an unused variable from the display list rasterizer.
2013-09-11 23:24:45 +00:00
Mitchell Stokes
f7388c1f2e BGE: Cleaning up the vsync code a little. 2013-08-26 08:14:52 +00:00
Campbell Barton
2889448b94 blenderplayer builds again 2013-08-25 21:24:16 +00:00
Sergey Sharybin
c0f8e15295 Speedup for guarded allocator
- Re-arrange locks, so no actual memory allocation
  (which is relatively slow) happens from inside
  the lock. operation system will take care of locks
  which might be needed there on it's own.

- Use spin lock instead of mutex, since it's just
  list operations happens from inside lock, no need
  in mutex here.

- Use atomic operations for memory in use and total
  used blocks counters.

This makes guarded allocator almost the same speed
as non-guarded one in files from Tube project.

There're still MemHead/MemTail overhead which might
be bad for CPU cache utilization
2013-08-19 10:51:40 +00:00
Sergey Sharybin
beffaa293e Made modifiers_getVirtualModifierList safe for threading
Move static variables to context filling in by this fcuntion
and owned by a callee function. This ensures no conflicts
between threads happens because of static variables used in
this function.

Also moved modifier types and virtual modifiers data to a
function called from creator. This is needed to be sure all
the information is properly initialied to the time when
threads starts to use this data.

--
svn merge -r57899:57900 ^/branches/soc-2013-depsgraph_mt
2013-08-19 09:05:34 +00:00
Mitchell Stokes
51bca0d7dc BGE: Flipping vsync constants so VSYNC_ON is 0.
This will make transitions from older versions of Blender easier since VSYNC_ON
will be the default. This could have been changed in a do_version, but the vsync
code has yet to see an official release, so I figured this would be a bit nicer.
Also, this makes VSYNC_ON the default for new scenes as well.
2013-08-17 02:06:45 +00:00
Mitchell Stokes
3627541894 BGE: Fixing the memory leaks reported when the BlenderPlayer exits.
They were caused by not having a free_windowmanager_cb set and by not having registered SpaceTypes, which meant data allocated for thosse SpaceTypes could not be freed. These were solved by defining a free_windowmanager_cb for the player that just frees wmWindows, and by making sure we only allocate memory for registered SpaceTypes.
2013-08-10 21:17:46 +00:00
Mitchell Stokes
98176b4e1e BGE: Making sure the BlenderPlayer calls Py_Finalize(). 2013-08-06 02:05:32 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Daniel Stokes
4f8fd8c68b BGE Fix [#18804] Shadow type faces cast onto invisible faces (non-GLSL)
Changing the RayHit method to ignore invisible faces
2013-07-25 23:42:20 +00:00
Campbell Barton
3ff3d1bc0f replace use of strcat() where the string offset is known.
also correct bad logic with converting a textblock to 3d-text, bytes-vs-number of chars wasn't handled right.
2013-07-23 12:49:30 +00:00
Daniel Stokes
ff165fa986 Re fixing BGE bug [#36223] Strange page fault of "Game" actuator
Thanks to Campbell for helping me get a better fix put together.
2013-07-20 03:01:50 +00:00
Mitchell Stokes
efad3eb928 Add the Boost include to the right CMakeLists.txt... 2013-07-20 01:17:00 +00:00
Mitchell Stokes
81769b4f58 More build fixes for r58428. 2013-07-20 01:15:36 +00:00
Mitchell Stokes
f84563d213 SCons fix for r58428. 2013-07-20 01:09:16 +00:00