Commit Graph

162 Commits

Author SHA1 Message Date
Dalai Felinto
1c80388a73 bge fix: framing mode "Expanded" not updated when resizing blenderplayer
now, with a 'resize' routine for the engine we can/should also recreate some
buffers that are created only at init time (e.g., 2d filters, dome fbos, ...).

This bug was always present in Blender (since 2.49 at least).

Bugfix supported by NF-UBC Nereus Program as part of the development
of OceanViz/NereusViz
2013-04-12 01:52:30 +00:00
Mitchell Stokes
1356e3b490 BGE: getting rid of a few maybe-uninitialized warnings. 2013-03-23 03:04:02 +00:00
Mitchell Stokes
e6020cd320 BGE: Adding a getProfileInfo() function to bge.logic. This function returns a Python dictionary with the same information as the on screen profiler. 2013-03-19 04:51:37 +00:00
Dalai Felinto
3a1ee13278 BGE Profile : visual feedback bars and improvements
You can see a screenshot of the funcionality here:
http://wiki.blender.org/index.php/Doc:2.6/manual/Game_Engine/Performance/Display/Framerate_and_Profile

This patch creates a bar-like graph to quickly allow the game dev to see the performance changes.
Also it changes the font to monospace (too allow ' ' padding) and reduced shadow border to
match the blenderplayer one.

Patch finalized and commited at Global Game Jam Vancouver (last one, time to sleep forever now)
2013-01-28 01:26:36 +00:00
Campbell Barton
9c003a36d6 patch from Harley Acheson to remove multiple inline defines. 2013-01-12 17:12:48 +00:00
Campbell Barton
47ee5f56b6 minor cleanup to debug drawing code in the BGE, dont convert strings to STR_String, only to get them back as regular strings. 2013-01-12 16:49:37 +00:00
Campbell Barton
4d7583b66f code cleanup: warnings, also add check in crash handler that a wmWindowManager is present. 2013-01-11 03:21:24 +00:00
Mitchell Stokes
62b6303735 BGE: Fixing an assert with the canvas' GetViewPort(). bf_gpu was changing the viewport when handling shadow buffers. KX_LightObject::BindShadowBuffer() now updates the canvas with the new viewport information from bf_gpu. 2012-12-25 06:20:50 +00:00
Mitchell Stokes
84966c3d0a BGE: Committing async LibLoad from Swiss. This does the lib loading in a separate thread to keep the BGE from freezing. Here is an example from the docs:
# Print a message when an async LibLoad is done
      import bge

      def finished_cb(status):
          print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken))

      bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb

LibLoad() now returns a KX_LibLoadStatus object for information on the library loading. LibNew() and LibFree() are unaffected by this commit. In other words, the async option only works for LibLoad(). Furthermore it only works for Scenes, not Actions or Meshes.
2012-12-22 05:38:32 +00:00
Mitchell Stokes
ef0473994b BGE: Some as of yet unmerged work I did in the Swiss branch. These changes include:
* Cleaning up the conversion code to avoid a per-face material conversion. Materials are now stored in buckets and only converted if a new material is found. This replaces some of Campbell's earlier work on the subject. His work wasn't as thorough, but it was much safer for a release.
  * Shaders are only compiled for LibLoaded materials once. Before they could be compiled twice, which could really slow things down.
  * Refactoring the rasterizer code to use a strategy design pattern to handle different geometry rendering methods such as immediate mode, vertex arrays and vertex buffer objects. VBOs are added, but they will be disabled in a following commit since they are still slower than vertex arrays with display lists. However, VBOs are still useful for mobile, so it's good to keep them around.
  * Better multi-uv support. The BGE should now be able to handle more than two UV layers, which should help it better match the viewport.
2012-12-18 20:56:25 +00:00
Mitchell Stokes
993d5e58bd BGE: Implementing a fix for the "Problem With Clock" issues reported in #32708 and #33088. At the moment this feels like a bit of a stop gap, but it does solve the stuttering issue that #33088 mentioned. 2012-11-24 08:10:56 +00:00
Campbell Barton
796988adc9 modify the python stub to include __file__ and __name__, also correct odd indent in KX_KetsjiEngine.cpp 2012-11-22 05:20:51 +00:00
Mitchell Stokes
028d5a64fc BGE: Committing patch #32291 "Updated profiling layout for BGE" from Angus Hollands (agoose77). This patch adds a headers for the profiling information and for the debug properties so they are no longer jumbled together. It also modifies how debug properties are displayed; changes "swap" to "Frametime"; and changes the display from seconds to ms, which is much more useful.
In addition to this patch, I've also modified the precision of the numbers displayed in the profiling information to make things a little cleaner.
2012-10-30 22:45:08 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
ab86e9593b add missing redraw notifier for separate UV operator, also some style cleanup and remove unused define. 2012-10-15 03:17:10 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
Mitchell Stokes
244ce92dbd BGE: Setting up the RAS_ICanvas interface as the primary way to alter the OpenGL
viewport. This helps to eliminate OpenGL calls in weird places like the physics
code and to reduce glGet calls, which are expensive.

There should be no functional changes (except maybe a very slight speed improvement).
2012-10-08 03:28:11 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Mitchell Stokes
ae483e0cd2 BGE: When using the "Restrict Animation Updates" option, animations are now truly frame rate independent. Thanks to vrav for reporting the issue in IRC. 2012-07-29 23:53:21 +00:00
Mitchell Stokes
02b9ba16bc Fix for bug [#26122] "Overlay scene gets transparent when motion blur is enabled" reported by Alberto Torres Ruiz (dithi).
The problem is motion blur was being treated as a per scene operation, but all scenes were trying to use the same accumulation buffer. Now motion blur is done in EndFrame() instead of PostRenderScene().
2012-07-23 01:00:56 +00:00
Bastien Montagne
558721ab59 More spell checking. 2012-07-04 15:04:38 +00:00
Campbell Barton
f5f25b81e8 style cleanup:
also fix for building ghost test and fix double free in one of the tests
2012-06-17 09:58:26 +00:00
Mitchell Stokes
f76419d6de Fix for [#31367] render.drawLine not 2D filter aware:
The lines from render.drawLine() are now drawn before motion blur and 2D Filters.
2012-05-21 18:35:31 +00:00
Nathan Letwory
b23186b2a4 compile fixes:
* near and far var names confused mingw64, renamed
* mingw defines a macro named DrawText, confusing the DrawText function usage from KX_FontObject.
2012-04-29 00:44:49 +00:00
Mitchell Stokes
62b254e42a This fixes BGE bugs #30484 (Frame rate increases very high after game engine start with record animation enabled) and #29449 (Record Animation runs 1000+ fps on Mac OSX 10.6.8 64bit). The problem was, recording animation was forcing "fixed time", which always advances the engine one frame instead of advancing based on time passed. This means that "fixed time" runs at full speed. Now fixed time is disabled when recording animation. 2012-04-05 03:05:02 +00:00
Campbell Barton
07065b27b8 style cleanup 2012-03-28 05:03:24 +00:00
Campbell Barton
b8a71efeba style cleanup: follow style guide for/with/if spacing 2012-03-24 07:52:14 +00:00
Campbell Barton
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
Campbell Barton
f6ae27daef style cleanup - comment spelling + translate some dutch. 2012-03-04 04:35:12 +00:00
Campbell Barton
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
Dalai Felinto
32b23b9f74 Cucumber, first batch of merge - UI changes and custom exit key
---------------------------------------------------------------
This was a test drive to see how painful the merge will be.
Next batches are:
- use desktop option for fullscreen
- multisampling option
- bullet collision mask
- python
- storage (vbo, dl, ...)
- lighting

[lighting still needs review]
[python could use review, although it should be straightforward]
[storage should be tested more I think]


Merged /branches/soc-2011-cucumber:r
36991,37059,37157,37416,37497-37499,37501,37522,39036,40593

36991:
==UI==
* Made some options available in Blender Game that were only available in Blender Render (camera resolution, animation fps)
* Created a panel for the embedded player
* Renamed the FPS option for the standalone player to Refresh Rate
* Moved framing options to display
* Made a button to launch the blender player from within blender (only tested on windows for now)

37059:
==UI==
* Added the option to change the exit key for the BGE. The UI currently just sets a number, and this feature most likely does not work for blenderplayer yet. More work on this to come.
* Removed the physics settings from the scene panel for the BGE.
* Added an Add menu in the logic brick header.

37157:
Making the bake options available in Blender Game

37416:
Making the exit key UI element accept key presses instead of numbers. It still does not work for the Blenderplayer, and it does not limit the input to key presses (other events don't work for exiting)

37497:
Some more work on getting the exit key to work in the Blenderplayer.
Input is now restricted to keyboard events only for the exit key UI.
37498:
Some clean up from the last commit.
The exit key setting affects the Blenderplayer now.
37499:
Cleaning up some duplicate code. Now the reverseTranslateTable for converting blender key codes to ketsji key codes is only defined in BL_BlenderDataConverter.
37501:
Centralizing the exit key methods to the keyboard devices. This should make it easier to get exit key control to the python API.

[37517: committed previously]

37522:
Moved control of the exit key away from the keyboard devices, and moved it to ketsjiengine.
Added setExitKey and getExitKey to the python API

39036:
A couple of the doversions were in the wrong spot. This should fix some issues with the exit key not being set.
[not committed entirely, see below]]

40552: space_logic.py (* fixed an error in space_logic.py *)

40593:
launch blenderplayer from ui not working in OSX fix - by Daniel Stokes and me



########################################################
code left behind (to be included in next commit):
########################################################
		{
			/* Initialize default values for collision masks */
			Object *ob;
			for(ob=main->object.first; ob; ob=ob->id.next)
				ob->col_group = ob->col_mask = 1;
		}
2011-12-20 03:11:56 +00:00
Sergey Sharybin
4ea816837d Configurable sensor size:
- Added support of variable size sensor width and height.
- Added presets for most common cameras, also new presets can be defined by user.
- Added option to control which dimension (vertical or horizontal) of sensor
  size defines FOV. Old behavior of automatic FOV calculation is also kept.
- Renderer, viewport, game engine and collada importer/exporter should
  deal fine with this changes. Other exporters would be updated soon.
2011-11-04 14:36:06 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Dalai Felinto
415f35d1dc bge bugfix: patch #28893 "Fix for #28753 and some other changes for BGE projection code" by Juha Mäki-Kanto (kanttori) 2011-10-20 06:38:45 +00:00
Campbell Barton
274b9c8fb8 whitespace cleanup 2011-09-25 12:31:21 +00:00
Dalai Felinto
0241e12089 BGE fix: Font Objects not showing up in the dome mode
geez, who coded the font object? or even worse, who did the dome code?
Don't coders talk? tsc tsc ...

Now seriously, KX_KetsjiEngine::RenderFonts() could be moved to inside the KX_Scene class. It probably should (so I could call it from inside KX_Dome::RenderDomeFrame()). Not critical, so not changing it for now.
2011-09-16 18:23:57 +00:00
Dalai Felinto
5184476fe1 bugfix: [bf-blender-Game Engine][28167] Restart game actuator don't get changed material mode
http://projects.blender.org/tracker/?func=detail&aid=28167&group_id=9&atid=306
Game Actuator (restart or load a new file) will not keep some settings alive (as
we had in 2.49).

In 2.49 the solution used was to use Blender globals (G.fileflags) to get/set
those settings. That was causing the blender file to change if you change the
material mode from the game.

In 2.5 this never worked, and the implementation was buggy (it's relying in the
scene settings, which get reset ever time we restart/load a new file).

My idea for fixing this is to create a new struct (GlobalSettings) where we
store any setting to be preserver during the course of the game. This is
specially important for options that require the game to restart/load new file
(graphic ones). But it later can be expanded to support other things such as
audio settings (e.g. volume), ...
I'm also planning to expand it for stereo and dome settings, but I prefer to
first get this committed and then build a new patch on top of that.


I had some problems in finding a correct way for build/link the blenderplayer
changes, so although it's working I'm not sure this is the best code (e.g. I
couldn't make forward declaration to work in GPG_Application.h for the struct
GlobalSettings so I ended up including KX_KetsjiEngine.h)

[note: I talked with Brecht and he find this is an ok solution. He implemented
it originally so it's good to have his go. However I still think there must be a way to make forward declaration to work. I will see with other devs if there is a better solution]
[also I'm likely renaming glsl to flags later if there are more settings stored in the flags to be used. But for now we are only handling glsl flags]
2011-09-11 05:54:07 +00:00
Benoit Bolsee
dbd6658d73 svn merge -r 37306:39975 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-07 15:34:04 +00:00
Mitchell Stokes
0f2be67bbf BGE: Undoing r39729 and applying a simpler fix (ensuring that the viewport is correct for PostRenderScene()). This way both 2d filters and post_draw callbacks with with multiple viewports. 2011-09-01 19:53:14 +00:00
Campbell Barton
2365c64014 whitespace bge edits 2011-09-01 02:12:53 +00:00
Joerg Mueller
43ab8e8624 * Merge trunk up to r39790.
* Subversion bump (also for init_userdef_do_versions).
* Minor fix for compilation without ffmpeg.
2011-08-30 08:22:03 +00:00
Joerg Mueller
b4b046995b * Removing mocap GSoC (is an addon already).
* Fixing ffmpeg-0.8 errors.
* Fixing Ketsji paths.
* Removing DoSound from BGE.
* Fixing audio scene update to use only current scene objects.
2011-08-28 14:21:44 +00:00
Mitchell Stokes
555f6cbe08 BGE: Post drawing callbacks are now done per viewport instead of per scene. This is handy for things like having a different HUD for each player in a splitscreen game. To figure out what viewport you're drawing too, check the scene's active_camera. 2011-08-27 03:19:46 +00:00
Joerg Mueller
a71c215f22 3D Audio GSoC:
Final GSoC commit.

* Bugfix: Negative frames crashed
* Bugfix: JOS sample buffer size prediction error (wasted memory)
* Optimisation: for JOS upsampling (around 12 % difference measured here)
* Optimisation: Better filter for JOS resampling
* Bugfix: Error in relative 3D audio code.
* Removed Attenuation
* Bugfix: Multiple scenes in BGE lead to errors, BGE audio now all relative, to support multiple scenes.
2011-08-22 18:59:56 +00:00
Joerg Mueller
a458de88b6 3D Audio GSoC:
High quality resampling on mixdown, linear for playback.

* Lots of improvements and fixes for the JOS resampler, now it works fine!
* High quality filter coefficients for the JOS resampler (sorry for the 5 MB source file).
* Fix for GE orientation bug. Note: moto uses x,y,z,w quaternion storage, while rest of blender uses w,x,y,z.
* Minor changes/fixes.
2011-08-15 21:50:09 +00:00
Mitchell Stokes
c5ef9b62c1 BGE Animations: Adding an option to let users choose whether or not to lock animation updates to the framerate. If this option is enabled, animations are only updated at the same speed as the animation framerate. This can give a significant speed up in performance, but at the cost of smoothness in animations. I'm defaulting this behavior to off for now, which is the behavior seen in trunk. 2011-08-12 20:53:29 +00:00
Mitchell Stokes
78f89c3bbf BGE Animations: Animation updates are now handled separately from logic/physics updates. This allows the animations to be updated at the full fps specified by the user. Before, updates were not happening frequently enough. For example, a 30fps animation my only update at 20~30fps, which would cause some noticeable lag. This my not be the best solution since at this point we may be dropping frames (not being in the while(frames) loop), and we're not updating as often as the physics engine might want for bone parented physics objects. 2011-08-11 07:19:37 +00:00
Joerg Mueller
2d884fc035 3D Audio GSoC:
* Pepper depends on ffmpeg 0.7.1 or higher now, windows and mac build systems set to ffmpeg-0.8
* Fixed orientation retrieval in OpenAL device code.
* Added stopAll() method to AUD_IDevice (also for Python) and call it on BGE exit
* Changed BGE to use audaspace via native C++ instead over the C API.
* Made AUD_SequencerFactory and AUD_SequencerEntry thread safe.
* Changed sound caching into a flag which fixes problems on file loading, especially with undo.
* Removed unused parameter from sound_mute_scene_sound
* Fixed bug: changing FPS didn't update the sequencer sound positions.
* Fixed bug: Properties of sequencer strips weren't set correctly.
* Minor warning fixes.
2011-08-07 11:54:58 +00:00
Joerg Mueller
29f214f7f3 Merging up to trunk r38834. 2011-07-29 21:28:18 +00:00
Dalai Felinto
fee1594a65 BGE BugFix for: [#23874] Custom projection matrix doesn't work in custom viewport
This was never highly tested, that's why I never committed (my patch for this was from September 2010).

But once again I got a report that this bug was a deal-break and the patch seems to work for this artist.
I believe it's working, but I will keep my eyes open for this.
2011-07-25 15:37:55 +00:00