Mainly it's related on a bad practice in SDL to force-define __SSE__
and __SSE2__ flags which generates quite some warnings and causes too
much noise.
There are some other warnings fixed. Should be no functional changes.
NeXyon, please check the changes in audaspace :)
Did a full compile of debug build with C++11 enabled, it all passed compilation
apart from some deprecated type used in GE's Video Texture. Solved it inside of
ifdef block now.
In the future we should uncomment the MSVC part of it, it should all be safe and
correct (MSVC2013 does not define new C++ version but supports C++11). The reason
it is commented is to have absolutely no effect on the upcoming release.
This patch adds a python method to get openGL bind code of material's texture according to the texture slot.
Example:
import bge
cont = bge.logic.getCurrentController()
own = cont.owner
bindId = own.meshes[0].materials[0].getTextureBindcode(0)
Test file: http://www.pasteall.org/blend/40679
This can be used to play with texture in openGL, for example, remove mipmap on the texture or play with all wrapping or filtering options.
And this can be used to learn openGL with Blender.
Reviewers: TwisterGE, kupoman, moguri, panzergame
Reviewed By: TwisterGE, kupoman, moguri, panzergame
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1804
BKE_main_id_tag_/BKE_main_id_flag_ were horrible naming now that we split those
into flags (for presistent one) and tags (for runtime ones).
Got rid of previous 'tag_' functions behavior (those who were dedicated shortcuts
to set/clear LIB_TAG_DOIT), so now '_tag_' functions affect tags, and '_flag_'
functions affect flags.
This patch supports "Image or Movie" and "Environment map" types of world texture for the viewport.
It supports:
- "View", "AngMap" and "Equirectangular" types of mapping.
- Different types of texture blending (according to BI world render).
- Same color blending as when it lacked textures (but render via glsl).
{F207734}
{F207735}
Example: {F275180}
Original author: @valentin_b4w
Regards,
Alexander (Blend4Web Team).
Reviewers: sergey, valentin_b4w, brecht, merwin
Reviewed By: merwin
Subscribers: campbellbarton, merwin, blueprintrandom, youle, a.romanov, yurikovelenov, AlexKowel, Evgeny_Rodygin
Projects: #rendering, #opengl_gfx, #bf_blender:_next
Differential Revision: https://developer.blender.org/D1414
This reverts commit 3dbc123061aa063efd1fca358f5e295b0ce7b302, "BGE:
allow setting velocity to zero in a motion actuator" as it caused more
issues than it solved. Zeroing linear or angular velocity with logic
bricks is discussed further in https://developer.blender.org/D1545
The Vector Transform node is a useful node which is present in the Cycles renderer.
{F144283}
This patch implements the Vector Transform node for GLSL mode and the internal renderer.
Example: {F273060}
Alexander (Blend4Web Team)
Reviewers: brecht, campbellbarton, sergey
Reviewed By: campbellbarton, sergey
Subscribers: psy-fi, duarteframos, RobM, lightbwk, sergey, AlexKowel, valentin_b4w, Evgeny_Rodygin, yurikovelenov
Projects: #bf_blender:_next
Differential Revision: https://developer.blender.org/D909
This patch adds a new API which allow us to access light shadow settings from python. The new API can be used to write custom GLSL materials with shadows.
Reviewers: brecht, kupoman, agoose77, panzergame, campbellbarton, moguri, hg1
Reviewed By: agoose77, panzergame, campbellbarton, moguri, hg1
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1690
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
It would be good to get rid of this entirely, ideally decision
about mcols can be taken at material level and not done per face. More
work needs to be done for that to work though.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all.
This change was also needed because we were getting short on ID flags, and
future enhancement of 'user_one' ID behavior requires two new ones.
id->flag remains for persistent data (fakeuser only, so far!), this also allows us
100% backward & forward compatibility.
New id->tag is used for most flags. Though written in .blend files, its content
is cleared at read time.
Note that .blend file version was bumped, so that we can clear runtimeflags from
old .blends, important in case we add new persistent flags in future.
Also, behavior of tags (either status ones, or whether they need to be cleared before/after use)
has been added as comments to their declaration.
Reviewers: sergey, campbellbarton
Differential Revision: https://developer.blender.org/D1683
The is intended to replace the deprecated glPolygonStipple() calls with a shader
based alternative, once we switch over to GLSL shaders.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D1688
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
This patch improves clock management in BGE, to be able to accelerate /
slow the time, and also to finely synchronize clock with external
engines. Several new python functions have been added and existence ones
have been improved for that purpose. Now we have:
- getClockTime(): Get the current BGE render time, in seconds. The BGE
render time is the simulation time corresponding to the next scene that
will be rendered.
- getFrameTime(): Get the current BGE frame time, in seconds. The BGE
frame time is the simulation time corresponding to the current call of
the logic system. Generally speaking, it is what the user is interested
in.
- getRealTime(): Get the number of real (system-clock) seconds elapsed
since the beginning of the simulation.
- getTimeScale(): Get the time multiplier between real-time and
simulation time. The default value is 1.0. A value greater than 1.0
means that the simulation is going faster than real-time, a value lower
than 1.0 means that the simulation is going slower than real-time.
- setTimeScale(time_scale): Set the time multiplier between real-time
and simulation time. A value greater than 1.0 means that the simulation
is going faster than real-time, a value lower than 1.0 means that the
simulation is going slower than real-time. Note that a too large value
may lead to some physics instabilities.
- getUseExternalClock(): Get if the BGE use the inner BGE clock, or rely
or on an external clock. The default is to use the inner BGE clock.
- setUseExternalClock(use_external_clock): Set if the BGE use the inner
BGE clock, or rely or on an external clock. If the user selects the use
of an external clock, he should call regularly the setClockTime method.
- setClockTime(new_time): Set the next value of the simulation clock. It
is preferable to use this method from a custom main function in python,
as calling it in the logic block can easily lead to a blocked system (if
the time does not advance enough to run at least the next logic step).
Rationale are described more precisely in the thread
http://lists.blender.org/pipermail/bf-gamedev/2013-November/000165.html.
See also T37640
Reviewers: sybren, panzergame, #game_engine, lordloki, moguri
Reviewed By: sybren, panzergame, #game_engine, lordloki, moguri
Subscribers: moguri, hg1, sybren, panzergame, dfelinto, lordloki
Projects: #game_engine
Maniphest Tasks: T37640
Differential Revision: https://developer.blender.org/D728
This class did nothing but print out extensions if they were found.
Instead, the code from bge.logic.PrintGLInfo() is now printed as the
Rasterizer is initialized. This gives better information, and it removes
some GL code from KX_PythonInit.cpp (the PrintGLInfo method now calls
the Rasterizer to print the information).
Differential Revision: https://developer.blender.org/D438
The only use we had for RAS_StorageIM was to render derived meshes using
Blender's mesh drawing. This is now handled as a special case in
RAS_OpenGLRasterizer instead of in RAS_StorageIM.
We are now left with RAS_StorageVA and RAS_StorageVBO. At the moment
vertex arrays are still the default since our vertex array with display
lists implementation is still much faster than our VBO code in a lot of
cases. As we improve our VBO code, we can drop vertex arrays since
Blender's minimum OpenGL version is being bumped up to 2.1, which
supports VBOs.
This patch allows the game engine to keep running while performing things like PNG compression and disk I/O.
As an example, my crowd simulation rasterizer saves a screenshot for every frame. This now takes up 13 msec per frame, which was 31 msec before this patch. Effectively, it allows the simulation to save every frame and still run at 60 FPS.
Reviewers: lordloki, moguri, panzergame
Reviewed By: moguri, panzergame
Projects: #game_engine
Differential Revision: https://developer.blender.org/D1507
GPUBuffer rendering is now done using vertex buffers.
Vertex arrays are completely removed from GL 3.2 core profile, so we'll
have to do this change at some point anyway.
This commit, though big, is not modifying blender in any way. Use should
be exactly as if the vetex buffer option is constantly on.
The motion actuator goes out of its way to prevent setting zero velocities,
which should actually be supported. This patch just works around it as a
first test. We should investigate whether the flags
`m_bitLocalFlag.ZeroLinearVelocity` and `m_bitLocalFlag.ZeroAngularVelocity`
are actually needed/desired at all.
One of the issues that's already visible with this simple change, is
that objects aren't actually frozen but still move a little bit; see
test with {F241908}.
Reviewers: lordloki, hg1, moguri, panzergame
Reviewed By: lordloki, panzergame
Differential Revision: https://developer.blender.org/D1545
We have callbacks for that, they also do some checks and help ensure things are done
correctly. Only place where this is assumed not true is blenloader (since here we
may affect refcount of library IDs as well...).
KX_IPOActuator is not used since 2.4.
This patch removes:
- KX_IPOActuator.h/cpp;
- Python doc;
- Write of IPO actuator in write.c;
- Allocation of IPOactuator in sca.c;
- Conversion in KX_ConvertActuators.cpp;
- Initialization of the python proxy in KX_PythonInitTypes.cpp;
- Other minor remove in logic_windows.c and in KX_PythonInit.cpp.
Reviewers: sybren, campbellbarton
Reviewed By: campbellbarton
Subscribers: moguri
Differential Revision: https://developer.blender.org/D1603
Each time we setted the mass the own object gravity was divided by its
old mass (i.e you could convert you car in a flying DeLorean with a
simple mass car modification).
A note will be included in release notes due to retro compability
issues.
The start position must be initialized at the first call of KX_IpoSGController::Update when m_ipo_start_initialized is to false, not when also the frame time is not 0.
- Add spaces around operators.
- Replace !(a == b) by a != b
- Add "f" at end of float value.
- Remove extras lines in fonctions declaration.
- Remove indentation to align attributes definition.
To make consistent with KX_GameObject.replaceMesh, we don't allow this behavior but print an error message for the replace mesh actuator.
e.g : Warning: object "Cube" from ReplaceMesh actuator "Edit Object" uses a mesh not owned by an object in scene "scene1"
Reviewers: youle.
This behavior caused a double free.
Before when we duplicated an instance of a group the new instance keep the pointer of the group but was not added in the group instance list (normal).
And during the object deletion we tried to remove the object in the instance list but anyways if it failed decrement the reference count.
Set the group and the instance list to NULL in ProcessReplica avoid these kind of problems.
Bug introduced in 583fa7d1e, KX_GameObject.setActionFrame can make BL_Action::m_starttime negative. But in BL_Action::Update m_starttime is set to the current time if it's negative.
To fix it we use a boolean BL_Action::m_initializedTime to know if we should initialize the time in BL_Action::Update, it's more stable than comparing times.
Tested with bug task T45945 and T32054, with an extra patch about to fix suspend resume scene issues with actions : D1569
This patch makes independant the override camera zoom and the default camera object zoom. The override zoom is 2.0f and the camera object zoom is computed with the RegionView3D camera zoom.
These features are only used for the embedded BGE, so there's no compatibility issues with the blenderplayer.
I let the override zoom with a setter to allow later to create an override camera in blenderplayer easily.
Tested with the 3 framing modes in embedded and standalone.