Commit Graph

90 Commits

Author SHA1 Message Date
Benoit Bolsee
40f1c4f343 BGE: Various render improvements.
bge.logic.setRender(flag) to enable/disable render.
    The render pass is enabled by default but it can be disabled with
    bge.logic.setRender(False).
    Once disabled, the render pass is skipped and a new logic frame starts
    immediately. Note that VSync no longer limits the fps when render is off
    but the 'Use Frame Rate' option in the Render Properties still does.
    To run as many frames as possible, untick the option
    This function is useful when you don't need the default render, e.g.
    when doing offscreen render to an alternate device than the monitor.
    Note that without VSync, you must limit the frame rate by other means.

fbo = bge.render.offScreenCreate(width,height,[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER])
    Use this method to create an offscreen buffer of given size, with given MSAA
    samples and targetting either a render buffer (bge.render.RAS_OFS_RENDER_BUFFER)
    or a texture (bge.render.RAS_OFS_RENDER_TEXTURE). Use the former if you want to
    retrieve the frame buffer on the host and the latter if you want to pass the render
    to another context (texture are proper OGL object, render buffers aren't)
    The object created by this function can only be used as a parameter of the
    bge.texture.ImageRender() constructor to send the the render to the FBO rather
    than to the frame buffer. This is best suited when you want to create a render
    of specific size, or if you need an image with an alpha channel.

bge.texture.<imagetype>.refresh(buffer=None, format="RGBA", ts=-1.0)
    Without arg, the refresh method of the image objects is pretty much a no-op, it
    simply invalidates the image so that on next texture refresh, the image will
    be recalculated.
    It is now possible to pass an optional buffer object to transfer the image (and
    recalculate it if it was invalid) to an external object. The object must implement
    the 'buffer protocol'. The image will be transfered as "RGBA" or "BGRA" pixels
    depending on format argument (only those 2 formats are supported) and ts is an
    optional timestamp in the image depends on it (e.g. VideoFFmpeg playing a video file).
    With this function you don't need anymore to link the image object to a Texture
    object to use: the image object is self-sufficient.

bge.texture.ImageRender(scene, camera, fbo=None)
    Render to buffer is possible by passing a FBO object (see offScreenCreate).

bge.texture.ImageRender.render()
    Allows asynchronous render: call this method to render the scene but without
    extracting the pixels yet. The function returns as soon as the render commands
    have been send to the GPU. The render will proceed asynchronously in the GPU
    while the host can perform other tasks.
    To complete the render, you can either call refresh() directly of refresh the texture
    to which this object is the source. Asynchronous render is useful to achieve optimal
    performance: call render() on frame N and refresh() on frame N+1 to give as much as
    time as possible to the GPU to render the frame while the game engine can perform other tasks.

Support negative scale on camera.
    Camera scale was previously ignored in the BGE.
    It is now injected in the modelview matrix as a vertical or horizontal flip
    of the scene (respectively if scaleY<0 and scaleX<0).
    Note that the actual value of the scale is not used, only the sign.
    This allows to flip the image produced by ImageRender() without any performance
    degradation: the flip is integrated in the render itself.

Optimized image transfer from ImageRender to buffer.
    Previously, images that were transferred to the host were always going through
    buffers in VideoTexture. It is now possible to transfer ImageRender
    images to external buffer without intermediate copy (i.e. directly from OGL to buffer)
    if the attributes of the ImageRender objects are set as follow:
       flip=False, alpha=True, scale=False, depth=False, zbuff=False.
       (if you need to flip the image, use camera negative scale)
2016-06-11 22:05:20 +02:00
1dfbcd88d5 Fix a few compiler warnings with OS X / clang. 2016-04-17 01:05:50 +02:00
Sergey Sharybin
5d99cde822 Remove SCons building system
While SCons building system was serving us really good for ages it's no longer
having much attention by the developers and started to become quite a difficult
task to maintain.

What's even worse -- there started to be quite serious divergence between SCons
and CMake which was only accumulating over the releases now. The fact that none
of the active developers are really using SCons and that our main studio is also
using CMake spotting bugs in the SCons builds became quite a difficult task and
we aren't always spotting them in time.

Meanwhile CMake became really mature building system which is available on every
platform we support and arguably it's also easier and more robust to use.

This commit includes:

- Removal of actual SCons building system
- Removal of SCons git submodule
- Removal of documentation which is stored in the sources and covers SCons
- Tweaks to the buildbot master to stop using SCons submodule
  (this change requires deploying to the server)
- Tweaks to the install dependencies script to skip installing or mentioning
  SCons building system
- Tweaks to various helper scripts to avoid mention of SCons folders/files
  as well

Reviewers: mont29, dingto, dfelinto, lukastoenne, lukasstockner97, brecht, Severin, merwin, aligorith, psy-fi, campbellbarton, juicyfruit

Reviewed By: campbellbarton, juicyfruit

Differential Revision: https://developer.blender.org/D1680
2016-01-04 14:20:48 +05:00
Thomas Szepe
2583cc88de Fix Moto overflow warnings
This fault (level 2, C4056) was introduced by changing Moto from double to float.
2015-12-30 12:45:36 +01:00
Jorge Bernal
ee59df521f BGE clean up: use float version of trigonometric functions 2015-12-16 01:53:48 +01:00
Jorge Bernal
0dcca69589 Moto Clean-up: double-promotion warnings 2015-12-13 02:56:30 +01:00
Porteries Tristan
6329e20cbb BGE: Use float as default instead of double in Moto library.
Use float in moto instead of double for MT_Scalar.
This switch allow future optimization like SSE.
Additionally, it changes the OpenGL calls to float versions as they are
very bad with doubles.

Reviewers: campbellbarton, moguri, lordloki

Reviewed By: lordloki

Subscribers: brecht, lordloki

Differential Revision: https://developer.blender.org/D1610
2015-12-13 02:09:05 +01:00
8a66d4966a Moto: remove some unused code. 2015-12-11 01:40:56 +01:00
Jorge Bernal
1bf87fa26c BGE: TrackTo actuator: increasing up & track axis options
This is related to Task T34861 to increase up & track axis options for TrackTo actuator. I've just added it to differential to facilitate an easier review.

With the patch applied you can select X, Y and Z axis for the Up axis, and X, Y, Z, -X, -Y and -Z for the track axis.

Related to the implementation I have used the algorithm from Trackto constrain placed in constrain.c but adapted to be used with MOTO library.

The wiki docs are here (http://wiki.blender.org/index.php/User:Lordloki/Doc:2.6/Manual/Game_Engine/Logic/Actuators/Edit_Object#Trackto_Actuator).

Test file is here: {F97623}

I have also uploaded 2 screenshots showing the UI modifications to the TrackTo actuator:

{F91992} {F91990}

Reviewers: moguri, dfelinto

Reviewed By: moguri

CC: Genome36

Differential Revision: https://developer.blender.org/D565
2014-07-14 18:30:27 -07:00
Bastien Montagne
ab2c273b12 Added GPL header to sconscripts!
Also changed shebang to '#!/usr/bin/env python', this is more portable across unixes...
2012-12-17 08:01:43 +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
Campbell Barton
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Nathan Letwory
b07988274e doxygen: intern/moto tagged. 2011-02-25 11:49:19 +00:00
Campbell Barton
89c617a116 remove nan-makefiles 2011-01-30 15:29:22 +00:00
Campbell Barton
5e382eb8e5 rename blenderlib to blender_add_lib 2010-12-22 23:09:30 +00:00
Campbell Barton
afacd18498 use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed. 2010-12-08 08:43:06 +00:00
Campbell Barton
e8397e6193 include headers in cmake source, added a script to check for consistency, reporting missing headers & C files.
this is important so IDE's using CMake integration always get blender headers. - QtCreator & MSVC for eg, probably others too.
2010-11-29 04:35:56 +00:00
Campbell Barton
f383e2e0e6 Remove msvc build files which are not needed anymore. 2010-10-23 15:14:54 +00:00
Campbell Barton
c6976e7351 use explicit file paths for CMake rather then globing, This is recommended by cmake devs.
globbing vs explicit is discussed here.
http://www.cmake.org/pipermail/cmake/2008-December/025694.html

Practical implications are:
- developers need to keep CMakeLists.txt files up to date.
- Users wont get strange linking errors if they build after a file is added, since CMake detects CMakeLists.txt is modified and automatically reconfigure.
2010-10-23 04:05:55 +00:00
Nathan Letwory
a293f76cdf Use DEBUG instead of NDEBUG 2010-10-18 06:52:10 +00:00
Campbell Barton
dea59cc5eb warning fixes and minor cmake changes. 2010-09-18 03:55:56 +00:00
Campbell Barton
4b40d73bfb rename most scons build targets to match cmake 2010-08-25 04:30:47 +00:00
Campbell Barton
6464718083 rename some cmake build targets 2010-08-24 04:29:23 +00:00
Campbell Barton
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Nathan Letwory
46487ad59e == COLLADA ==
* fix win64 build and add proper library usage for COLLADA 64bit. Update also lib/win64 (r24263).
2009-11-02 23:55:04 +00:00
Benoit Bolsee
1483fafd13 Merge of itasc branch. Project files, scons and cmake should be working. Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library. 2009-09-24 21:22:24 +00:00
Nathan Letwory
9216efcba2 == SCons ==
* bring back 'player' libtype, after investigation with ideasman.
  scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
2009-09-05 01:58:02 +00:00
Campbell Barton
eb22a7b210 PyRNA API support for matrix types as Mathutils matrix (with callbacks) rather then a generic rna sequence of floats.
Any 3x3 or 4x4 rna matrix will automatically be returned as a Mathutils matrix.
This makes useful stuff like multiplying a vector location by an object matrix possible.
 ob = bpy.data.scenes[0].objects[0]
 print (ob.data.verts[0].co * ob.matrix)

Also added mathutils matrix types to the BGE GameObject.localOrientation, worldOrientation

* MT_Matrix3x3 added getValue3x3 and setValue3x3, assumed a 4x3 float array.
* KX_GameObject.cpp convenience functions NodeSetGlobalOrientation, NodeGetLocalOrientation, NodeGetLocalScaling, NodeGetLocalPosition.
* 2.5 python api now initializes modules BGL, Mathutils and Geometry
* modules py3 PyModuleDef's use PyModuleDef_HEAD_INIT, rather then {}, was making msvc fail to build.
* added macros for Vector_ReadCallback, Vector_WriteCallback etc. to check if the callback pointer is set before calling the function.
2009-06-23 13:34:45 +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
Chris Want
77e0199dc3 Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
Nathan Letwory
eb186d18dc 2.5 / SCons
Blender builds and links on Linux. For now without BGE and its player, 
but that will come. Priorities are still a mess, so expect more commits 
soon.
2008-12-23 20:13:31 +00:00
Nathan Letwory
93d9e7749d 2.5 / SCons
I did a very drastic cleanup for the different libgroups, there's now only a few left. It compiled with scons/msvc, will be testing in a bit on linux, too.
If you get any problems, please reply to this commit message on the taskforce ML.
2008-12-23 16:07:24 +00:00
Brecht Van Lommel
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +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
Benoit Bolsee
8eec6cecc0 Add MSVC90 project files - part 1. 2008-11-10 15:36:58 +00:00
Brecht Van Lommel
cb89decfdc Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:

* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.

* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.

* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.

* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
2008-09-04 20:51:28 +00:00
Brecht Van Lommel
99fdf27af9 Sync with Apricot Game Engine
=============================

* Clean up and optimizations in skinned/deformed mesh code.
* Compatibility fixes and clean up in the rasterizer.
* Changes related to GLSL shadow buffers which should have no
  effect, to keep the code in sync with apricot.
2008-07-10 12:47:20 +00:00
Brecht Van Lommel
d5f4b3620f Fix for bug #8680: GameLogic.getRandomFloat() returns very small
values on 64 bit, instead of range 0..1. Also a warning fix.
2008-06-29 20:53:17 +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
Benoit Bolsee
3444d6612a Delta Loc/Rot/Scale Ipo curve are now supporting in the BGE with the following limitations:
1. All Ipo channels are now independent. 
In Blender 2.45, all 3 Loc Ipo channels were automatically set
together. For example, having just a LocX Ipo channel was sufficient
to fix the X, Y and Z coordinates, with the Y and Z value taken
from the object original Y and Z location in Blender. The same
was true for the 3 Rot and the 3 Scale Ipo channels: the missing
channels were assumed to have constant value taken from the object
original orientation/scale in Blender.
With this patch, all Ipo channels are now independent. 
THIS WILL CREATE BACKWARD COMPATIBILITY PROBLEM if you omit to
define the 3 channels of a same type together in your Blend file:
the undefined Loc, Rot, Scale coordinates of the object will
be influenced by the parent/spawner Loc/Rot/Scale in case the
object is a child or dynamically created.

2. Delta Loc, Rot, Scale are now supported with the following
limitations:
- The delta Loc/Rot Ipo modify the object global (NOT local)
location/orientation
- The delta Scale change the object local scale
- The delta Ipo curves are relative to the object starting
Loc/Rot/Scale when the Ipo was first activated; after that, the
delta Ipo becomes global. This means that the object will return
to this initial Loc/Rot/Scale when you later restart the Ipo
curve, even if you had changed the object Loc/Rot/Scale in the
meantime. Of course this applies only to the specific Loc/Rot/Scale
coordinate that are defined in the Ipo channels as the channels
are now independent.

3. When the objects are converted from Blender to the BGE, the
delta Loc/Rot/Scale that might result from initial non-zero values
in delta Ipo Curves will be ignored. However, as soon as the
delta Ipo curve is activated, the non-zero values will be taken
into account and the object will jump to the same Loc/Rot/Scale
situation as in Blender. Note that delta Ipo curves with initial
non-zero values is bad practice; logically, a delta Ipo curver
should always start from 0.

4. If you define both a global and delta channel of the same
type (LocX and DLocX), the result will be a global channel equivalent
to the sum of the two channels (LocX+DLocX).
2008-03-12 21:33:24 +00:00
Nathan Letwory
15da2232f7 * tweak linking priorities - should help for GCC users
* some lib renaming
2008-01-08 09:47:44 +00:00
Chris Want
5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
Stephen Swaney
59fe967476 more gcc 4.1.x warning cleanup:
applied MT_QueryAssert_patch.diff part of
patch [#6994] Fixing warnings: conversion from string constant to char *

Submitted by Renato Perini (mjordan).
Thanks, Renato!
2007-09-12 01:56:50 +00:00
Kent Mein
4ddec269c2 This does nothing to fix the irix stuff but gets rid of a couple of simple
warnings that showup on irix.

Kent
2007-09-11 04:05:44 +00:00
Kent Mein
4e2143f639 This commit fixes up a bunch of svn properties to hopefully make things a little nicer for everyone.
Patch provied by gsrb3d

bug tracker #7061

Kent
2007-08-28 10:07:08 +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
Joseph Gilbert
f54a113cde Update to the VC7 projectfiles.
This should bring the projectfiles upto date for msvc7.

Moving these to version 7.1 so that the version 8 people don't have such a hard time importing into 2005.

Build intern.sln, extern.sln and then blender.sln. Enjoy. :p
2006-04-17 20:05:39 +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