Commit Graph

110 Commits

Author SHA1 Message Date
Campbell Barton
553e35e36f * blenderplayer wasnt useing the scenes frame rate.
* GBE Python API's alignToVect wasnt clamping the align ammount from 0.0-1.0
* Generated images arnt animated - use for a test to see if the textures animated.
2008-08-06 04:09:10 +00:00
Campbell Barton
028d44c075 Made Mathutils its own module rather then GanmeLogic.Mathutils 2008-08-05 22:26:00 +00:00
Benoit Bolsee
bf168dc3c5 Small update to get the BlenderPlayer compiling (also needed for 2.47) 2008-08-02 22:11:22 +00:00
Hamed Zaghaghi
5350d5eb2c BGE Bug Fix:#17349, fixes some problems about 2d-filters 2008-07-20 23:03:01 +00:00
Campbell Barton
38cfe9c1a2 importing the GameLogic module was being done by adding the text "import GameLogic" to the start of all scripts used in the game engine, this meant every error line number was off by 1 (quite annoying). better to do this to the dictionary that the scripts run with. 2008-07-14 00:47:07 +00:00
Hamed Zaghaghi
a49c9c458a improvement of 2d-filter custom shader,
some bugfixes,
now you can use depth buffer and luminance buffer without any settings,
also you can use object's properties in a shader
2008-07-12 10:21:37 +00:00
Brecht Van Lommel
ab7794392e Fix for bug #7753: after game engine drawing with vertex arrays,
nurbs/curves/text dissappears.

This also removes the "vertex arrays" option and enables it always
for OpenGL version >= 1.1 - there's no need to have an option to
make things render faster disabled by default, also it should work
stable now.
2008-06-29 21:51:27 +00:00
Hamed Zaghaghi
b98e53b8ac BGE , fix an compile error 2008-06-28 14:19:25 +00:00
Brecht Van Lommel
272a91f754 Merge of apricot branch game engine changes into trunk, excluding GLSL.
GLEW
====

Added the GLEW opengl extension library into extern/, always compiled
into Blender now. This is much nicer than doing this kind of extension
management manually, and will be used in the game engine, for GLSL, and
other opengl extensions.

* According to the GLEW website it works on Windows, Linux, Mac OS X,
  FreeBSD, Irix, and Solaris. There might still be platform specific
  issues due to this commit, so let me know and I'll look into it.
* This means also that all extensions will now always be compiled in,
  regardless of the glext.h on the platform where compilation happens.

Game Engine
===========

Refactoring of the use of opengl extensions and other drawing code
in the game engine, and cleaning up some hacks related to GLSL
integration. These changes will be merged into trunk too after this.

The game engine graphics demos & apricot level survived my tests,
but this could use some good testing of course.

For users: please test with the options "Generate Display Lists" and
"Vertex Arrays" enabled, these should be the fastest and are supposed
to be "unreliable", but if that's the case that's probably due to bugs
that can be fixed.

* The game engine now also uses GLEW for extensions, replacing the
  custom opengl extensions code that was there. Removes a lot of
  #ifdef's, but the runtime checks stay of course.
* Removed the WITHOUT_GLEXT environment variable. This was added to
  work around a specific bug and only disabled multitexturing anyway.
  It might also have caused a slowdown since it was retrieving the
  environment variable for every vertex in immediate mode (bug #13680).

* Refactored the code to allow drawing skinned meshes with vertex
  arrays too, removing some specific immediate mode drawing functions
  for this that only did extra normal calculation. Now it always splits
  vertices of flat faces instead.
* Refactored normal recalculation with some minor optimizations,
  required for the above change.
* Removed some outdated code behind the __NLA_OLDDEFORM #ifdef.
* Fixed various bugs in setting of multitexture coordinates and vertex
  attributes for vertex arrays. These were not being enabled/disabled
  correct according to the opengl spec, leading to crashes. Also tangent
  attributes used an immediate mode call for vertex arrays, which can't
  work.
* Fixed use of uninitialized variable in RAS_TexVert.
* Exporting skinned meshes was doing O(n^2) lookups for vertices and
  deform weights, now uses same trick as regular meshes.
2008-06-17 10:27:34 +00:00
Campbell Barton
192037960d error in variable name, not sure how this even compiled 2008-06-09 22:54:56 +00:00
Campbell Barton
f39758cddc adding clip alpha (binary alpha) to the 3D view and game engine. 2008-06-09 15:45:46 +00:00
Benoit Bolsee
da1f38f99d Apply BGE patch 11137: Render objects with negative scaling correctly (as in Blender) 2008-05-25 14:37:39 +00:00
Benoit Bolsee
96486b356f fix BGE bug #8668: Behavior of os.getcwd() is not consistent between operating systems
Add a function GameLogic.expandPath() that works like Blender.sys.expandpath() and is also available in the BlenderPlayer.
Fix the game actuator in the BlenderPlayer to work like in Blender: 
- try first to load the .blend from the current working directory
- if not found, try to load from the startup .blend or runtime base directory
2008-05-11 18:45:30 +00:00
Kent Mein
106974a9d2 Fixing up the webplugin defines for the Makefiles.
Now you can do one of the following to disable it:
export NAN_NO_PLUGIN=true
export WITH_BF_WEBPLUGIN=false

or
export WITH_BF_WEBPLUGIN=true to enable building it.
(Its set to false by default)

Kent
2008-05-08 18:38:21 +00:00
Kent Mein
3ba9069c04 Fixes Makefiles for mac_compat_glext.h by updating some include paths.
Kent
2008-05-06 09:43:28 +00:00
Campbell Barton
6c05a92fe1 missed out on some BLI_convertstringcode's, also found that playing relative quicktime paths from the python api never worked, was using the 'Scene' type cast to a char. 2008-05-04 15:02:48 +00:00
Benoit Bolsee
3a430c33d2 fix BGE bug #8869: Added objects are not lit correctly
The current layer information is now stored in KX_GameObject and inherited from the parent object when dynamically added. This information is used during the rendering the select the lamps. As the selected lamps are always coming from active layers, their position and orientation are correct.
2008-04-30 19:58:44 +00:00
Jean-Luc Peurière
b6a6507ddf getting ARB shaders working again in GE.
This is is a kludge, and only to get a release
working. later solution is to use glew
2008-04-29 16:22:13 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Kent Mein
867e12836b This patch spawns from this game engine issue:
[#7113] GE crash pressing as soon as P on 64 bit


Note:         glext.h has been removed from the source
        If you get errors compiling with it you have 2 options
                download/install 	glext.h        (preferred method)
                or set WITH_BF_GLEXT=false
        If your a user and having problems with game engine try
                setting the env var: WITHOUT_GLEXT 1

Kent
2008-04-16 17:40:59 +00:00
Benoit Bolsee
dfd7387641 fix BGE bug #8880: blenderplayer closing when esc is pressed
ESC now quits the game by default in all modes unless a keyboard sensor is set on ESC. 
In this case, the game designer must arrange for an alternative way to quit the game.
2008-04-12 21:18:58 +00:00
Andrea Weikert
d9de141077 == bugfix ==
fix for [#6950] Blender crashes when .blog file top line is 160 characters or more
- made sure BLI_convertstringcode doesn't return more than 240 chars 
- went through all callers and fixed places where string passed to BLI_convertstringcode was too short
- TODO: look into increasing sample->name and sound->name too, I prevented crashes, but filename might get shortened.
2008-03-30 16:18:01 +00:00
Campbell Barton
bc9848f7e6 Added a global string to be used for the tempdir. since the user preference is not loaded in background mode and the user preference is not validated and has no fallback.
'btempdir' is set with BLI_where_is_temp() - This tries to use U.tempdir but falls back to $TEMP or /tmp/
2008-02-13 13:55:22 +00:00
Kent Mein
fd7c729bd1 This is patch: [#8216] Make blender compile with gcc 4.3
minus one small include file that was commented out, I'm not
sure why it was commented out but I'm pretty sure its needed.
If there are still problems later we can sort it out, everything
else is pretty simple.

Kent
2008-02-04 21:52:03 +00:00
Hamed Zaghaghi
47b53510a5 merging game_engine branch changes into trunk, 2d-filters and opengl speedup 2008-02-04 02:33:27 +00:00
Kent Mein
7b2e348d4f This is a modified version of this patch:
[#7660] Solaris 10 x86 support (Makefiles)

Hopefully it will not mess up anything for anyone else.  I removed
some hardcoded static libs and made NAN_*_LIB definitions so they could be 
overridden, to allow greater flexability.

Let me know if there are any problems/questions.

Kent
2007-12-05 16:58:52 +00:00
Hamed Zaghaghi
bf4d79c47b Patch [#7743] Enable display lists when vertex arrays are enabled, by Ovidiu Sabou.
this patch enable GE two use both vertex array and display lists. and speed up the engine a little, by the way thanks ovidiu.
2007-11-06 18:39:16 +00:00
Hamed Zaghaghi
af169b41fd 2d Filters updated, now you can use custom filter and write your own GLSL shader program to filter rendering result. 2007-11-06 12:16:12 +00:00
Hamed Zaghaghi
21eb3e11e0 2d-Filters feature and actuators. 2007-10-22 20:24:26 +00:00
Mal Duffin
51b56a4d3f GE Patch by Hamed Zaghaghi - Adding Motion Blur to the Game Engine.
I reviewed the code, suggested an update ( initialising accumulation buffer ), and tested the resulting update successfully.

It's great to see more GE developers!GE Patch by Hamed Zaghaghi to add motion blur to the GE ( using the accumulation buffer ).

I reviewed code and tested, gave some feedback ( initialising accumulation buffer ) which was implemented straight away, and re-reviewed.

It's great to have another GE coder on the team!
2007-09-29 18:51:01 +00:00
Kent Mein
38ec778cb7 This should fix up saving a blender runtime.
If you look at the log, the last change to this file I was trying to fix
game engine bug #6667.  In so doing I added a print usage if you do not
pass any arguments to the gameplayer.

Things should work better now.

Kent
2007-08-07 16:34:45 +00:00
Kent Mein
470dda4a21 This is a fix for game engine bug #6667
http://projects.blender.org/tracker/index.php?func=detail&aid=6667&group_id=9&atid=306

I moved some of the X11 initation code down a little bit so that
if you run gameplayer with no args or gameplayer -h 
it will not crash even if you do not have X11 present.
(All it does is print usage)

Kent
2007-06-27 15:08:31 +00:00
Tom Musgrove
4a1a766a16 = game engine fixes=
two fixes to the GE by Charlie
2007-01-08 04:22:23 +00:00
Erwin Coumans
14d60ca000 -fixes in player: draw physics debugging, only render frames when actually updated, fix with hierarchies not properly build (causing crashes) 2006-12-26 22:02:31 +00:00
Ton Roosendaal
496410a255 GamePlayer: now uses new Image API calls too, so it compiles. 2006-12-20 19:29:37 +00:00
Erwin Coumans
2572b9f72c Reserved some Bullet 2.x constraint data.
Although we will delay the main Rigid Body user interface after 2.43 release early 2007, I need some constraint data/UI to make progress with COLLADA Physics.
Added RigidBody constraint UI
LR_ALTKEY+LR_CTRLKEY+LR_SHIFTKEY+ P will bake rigidbody
Contribution by RCRuiz, Ramon Carlos.
2006-11-30 00:19:27 +00:00
Brecht Van Lommel
e435fbc3c5 Added custom vertex/edge/face data for meshes:
All data layers, including MVert/MEdge/MFace, are now managed as custom
data layers. The pointers like Mesh.mvert, Mesh.dvert or Mesh.mcol are
still used of course, but allocating, copying or freeing these arrays
should be done through the CustomData API.

Work in progress documentation on this is here:
http://mediawiki.blender.org/index.php/BlenderDev/BlenderArchitecture/CustomData


Replaced TFace by MTFace:

This is the same struct, except that it does not contain color, that now
always stays separated in MCol. This was not a good design decision to
begin with, and it is needed for adding multiple color layers later. Note
that this does mean older Blender versions will not be able to read UV
coordinates from the next release, due to an SDNA limitation.


Removed DispListMesh:

This now fully replaced by DerivedMesh. To provide access to arrays of
vertices, edges and faces, like DispListMesh does. The semantics of the
DerivedMesh.getVertArray() and similar functions were changed to return
a pointer to an array if one exists, or otherwise allocate a temporary
one. On releasing the DerivedMesh, this temporary array will be removed
automatically.


Removed ssDM and meshDM DerivedMesh backends:

The ssDM backend was for DispListMesh, so that became obsolete automatically.
The meshDM backend was replaced by the custom data backend, that now figures
out which layers need to be modified, and only duplicates those.


This changes code in many places, and overall removes 2514 lines of code.
So, there's a good chance this might break some stuff, although I've been
testing it for a few days now. The good news is, adding multiple color and
uv layers should now become easy.
2006-11-20 04:28:02 +00:00
Jacques Beuarain
24f4440d05 CMake lists initial submission. Documentationand further verification for different platforms will follow soon. This was just tested against current CVS on MSVC 2005 with Verse, QuickTime, OpenEXR, Player all on. 2006-11-17 02:27:12 +00:00
Nathan Letwory
232bfbbf8d * compiler command-line fix for scons/win32-mingw 2006-11-06 08:21:53 +00:00
Erwin Coumans
fe43c5e6f0 use 'fixedtime/enable all frames' from the blend file 2006-07-19 06:39:11 +00:00
Erwin Coumans
e61189b3c8 accidently replaced initGamePlayerPythonScripting with initGamePythonScripting, causing the gameplayer to crash on all platforms (lack of PyInitialize()... 2006-07-19 05:12:59 +00:00
Erwin Coumans
6b90f20e87 some minor webplugin changes, new loading .blend, upgraded version to 2.42, enabled PhysicsConstraints module within sandbox. 2006-07-06 07:58:07 +00:00
Stephen Swaney
f747fa3a7f patch from Ralf Hölzemer (cheleb) for
#4499 Fix for build of blenderplayer on windows/mingw/scons

fixes some invalid cflags for gcc on windows/mingw/scons
-if sys.platform=='win32':
+if (sys.platform=='win32') & ( Environment().subst('$CC') != 'gcc'):
     cflags = ['/GR']

Patch looks ok but no mingw evironment here to test.
So mingw/sconsers to your testing stations.
We can always roll back!
2006-06-27 15:54:37 +00:00
Erwin Coumans
6d3afda093 added fixed_framerate command line option 2006-05-19 22:55:12 +00:00
Erwin Coumans
50a1d9fc8b Text patch for game player, from Charlie: TFace from KX_PolygonMaterial, as opposed to KX_BlenderMaterial 2006-05-13 00:08:14 +00:00
Erwin Coumans
36f498aae0 made some gfx debug code win32 specific 2006-04-03 01:28:43 +00:00
Erwin Coumans
6839ec6640 applied Charlies patch for game engine graphics. display list support, and bumpmapping shader improvements. 2006-04-02 21:04:20 +00:00
Erwin Coumans
6c325d74f5 gameplayer will use blender materials automatically 2006-02-13 03:37:00 +00:00
Nathan Letwory
ef1b7a5735 ==SCons==
+ 'scons blenderplayer' builds blender AND blenderplayer now (tested on Linux
  only, but was only linking issue, so should work on other platforms too).

  NOTE: I noticed some compileflags for GE specific libs that were left out -
  I re-enabled them in the SConscripts, but I'm going to do a test build my-
  self now, so if there are problems with them on win32, I probably already
  know about them :)
2006-02-07 21:24:36 +00:00
Nathan Letwory
3bb82a27fc == SCons ==
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan
2006-02-04 14:15:10 +00:00