Commit Graph

267 Commits

Author SHA1 Message Date
Brecht Van Lommel
b56ffd2cdb Cycles: svn merge -r39669:39870 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-02 12:33:29 +00:00
Mitchell Stokes
f63d049adc BGE: Adding two new functions to bge.render to allow users to change the anisotropic filtering level used by textures:
* setAnisotropicFiltering(level)
  * getAnisotropicFiltering()
2011-08-31 05:51:51 +00:00
Mitchell Stokes
7fc26e0123 Committing patch #25675 "Make "Cast Buffer Shadows" option work in viewport and BGE" by me.
Description from the tracker:
"It's really handy to be able to prevent an object/material from casting a shadow. So, I made use of the Cast Buffer Shadows option in the material settings, and made it work in the viewport and the BGE."
2011-08-24 20:28:54 +00:00
Brecht Van Lommel
ec26abd2db Cycles: svn merge -r37957:39132 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-08-07 13:21:04 +00:00
Campbell Barton
5792bd7cc7 cmake: cleanup include paths, some duplicates and going up some unneeded dirs. 2011-07-17 09:11:13 +00:00
Brecht Van Lommel
f79dcb2af7 Cycles: fix build with game engine enabled. 2011-06-28 12:21:58 +00:00
Brecht Van Lommel
1cf0af703d Cycles: working towards texture workflow design
http://wiki.blender.org/index.php/Dev:2.5/Source/Render/TextureWorkflow

* Added "active texture node" in shading node trees.
* Texture draw mode draw active texture node now, and new Material draw
  mode shows GLSL material.
* GLSL materials now match solid draw mode lighting better.
* Texture properties can now texture nodes from material/world/lamp.
2011-06-27 17:10:50 +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
Brecht Van Lommel
cb12337363 Code cleanup: remove source/kernel module, this wasn't really the kernel of
anything, only contained a hash map and functions to pass command line args
to the game engine. Moved those to container and BlenderRoutines modules.
2011-05-06 20:18:42 +00:00
Dalai Felinto
c56fe3efe6 Patch [#26799] 2.5x blenderplayer (BGE) anti-aliasing & embedding by Sebastian Korczak (with some small tweaks) + adding GHOST_PRINTF
The patch can also be found in http://codereview.appspot.com/4431072/

##############
This patch fix anti-aliasing (multisampling) implementation for win32 platform. It also gives opportunity to embed blenderplayer inside parent window.

Usage:
blenderplayer.exe -i 123456 -m 16 file.blend

where:
123456 - parent window handler (integer, default: 0)
16 - multisample level (integer, default: 0, max: 16. Put there maximum level you want. If not supported, player will automatically try 15,14,13,...,3,2,1)
##############

This patch was originally created as part of the Burster (aka webplugin) project but benefit any one embedding the bge in a custom OpenGL context. By the way, to embed the BGE in a .Net application is really straightforward now =)
The Multisampling work for blenderplayer as a whole.

Missing functionalities:
- to expose the multisampling to the ui (so far it only works in console)
- window focus and keyboard messages for embedded blenderplayer (supported in their previous patch for 2.49, yet to be ported over)
- handle resizing (to be investigated, indeed the changes in getState() in GHOST_WindowWin32.cpp are going to get in the way of that if I'm not mistaken. To be addressed together.

Doxygen documentation to be added whenever I sort out how to do so. Sorry Nathan too many stuff to deal with at the same time. The sooner this patch gets in, the sooner the missing functionalities can be patched on top of that.
2011-05-04 01:50:17 +00:00
Campbell Barton
ca254dd37b add option WITH_BUILTIN_GLEW, so linux packagers can disable to use their own glew library. 2011-04-05 23:31:01 +00:00
Campbell Barton
737ca9ad5f BGE player was using un-initialized variables for initializing the canvas color. 2011-03-25 00:23:02 +00:00
Dalai Felinto
c39a109dae BGE internal cosmetic changes - Replacing hardcoded values with new defines
---------------------------------------------------------------------------
The Rasterizer code was relying in the values defined on TF_ DNA files. I'm working in the recode of TexFace, bringing the options to the material panel and ran into those cases. They are hard to spot and add a lot of the "magic" effect to the code. Hardcoded values are at least easy to spot. We (still) have a few defines duplicated, relying on each other (a flag previously defined in the code is checked later on but using a different define (although with same value. (e.g. TF_BMFONT and RAS_RENDER_3DPOLYGON_TEXT). It's hell =)
I'm adding some comments to help on that.

Things will be revamped anyways, but it's nice to keep the code a bit more coherent before the real feature commit. That's all, thanks for listening.
2011-03-07 19:14:17 +00:00
Nathan Letwory
2d3209c4b3 doxygen: gameengine/Rasterizer tagged. 2011-02-25 13:38:24 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
Nathan Letwory
5e41760a15 doxygen: add bullet to extern libs, some small changes in page names, and fixes around license blocks 2011-02-22 16:12:12 +00:00
Nathan Letwory
79f79e0cac doxygen: BGE Network, Physics, Rasterizer 2011-02-22 12:42:55 +00:00
Campbell Barton
0d8416acc7 minor edits, no functional changes.
- BGE was getting MCol array and not using it.
- use list lookup functions for getting constraint from pose bone.
- use const char * in more places.
2011-02-07 22:48:23 +00:00
Campbell Barton
89c617a116 remove nan-makefiles 2011-01-30 15:29:22 +00:00
Campbell Barton
1bd0db59f4 use cmake defined names for jpeg, png, zlib and python libs, building on *nix with non-standard libjpeg/png/zlib locations was broken.
in the case of python this makes it easier to move to find_package(PythonLibs) when 3.x is supported.
2011-01-25 14:43:13 +00:00
Benoit Bolsee
fc66b3f2ef BGE: support modifiers without mapping to original mesh both graphically and physically, fixes bug #24942 and #25286.
Support for physics is done by skiping the modifiers that
don't support mapping to original mesh. This mapping is
required to report the hit polygon to the application
by the rayCast() function.

Support for graphics is done by using the same render
function that blender uses for the 3D view. This guantees
equal result.

Limitation: there is still a known bug if all these conditions are met:
- Display list enabled
- Old tex face with a several textures mapped to the same material
- no armature or shape keys
- active modifiers

In this case, only a part of the mesh will be rendered
with the wrong texture. To avoid this bug, use the GLSL
materials or make sure to have 1 material=1 texture in
your old tex face objects.
2011-01-23 17:17:21 +00:00
Mitchell Stokes
f71ff8639c Fix to make two-side texface option work with modifiers in the BGE. However, there appear to be some issues when a mesh has mixed two-side and non two-side faces. I think it's a problem in the converter and possibly related to this bug: https://projects.blender.org/tracker/index.php?func=detail&aid=24948&group_id=9&atid=306 2011-01-04 07:43:32 +00:00
Campbell Barton
5e382eb8e5 rename blenderlib to blender_add_lib 2010-12-22 23:09:30 +00:00
Dalai Felinto
0890b80ed9 Patch:[#25163] BGE support for Blender Font objects - unicode support
Problem/Bug:
------------
There were no way to have proper unicode characters (e.g. Japanese) in Blender Game Engine. Now we can :)
You can see a sample here: http://blog.mikepan.com/multi-language-support-in-blender/

Functionality Explanation:
--------------------------
This patch converts the Blender Font Objects to a new BGE type: KX_FontObject
This object inherits KX_GameObject.cpp and has the following properties:
- text (the text of the object)
- size (taken from the Blender object, usually is 1.0)
- resolution (1.0 by default, maybe not really needed, but at least for debugging/the time being it's nice to have) 

The way we deal with linked objects is different than Blender. In Blender the text and size are a property of the Text databock. Therefore linked objects necessarily share the same text (and size, although the size of the object datablock affects that too). In BGE they are stored and accessed per object. Without that it would be problematic to have addObject adding texts that don't share the same data.

Known problems/limitations/ToDo:
--------------------------------
1) support for packed font and the <builtin>
2) figure why some fonts are displayed in a different size in 3DView/BGE (BLF)
3) investigate some glitches I see some times
4) support for multiline
5) support for more Blender Font Object options (text aligment, text boxes, ...)

[1] Diego (bdiego) evantually will help on that. For the time being we are using the "default" (ui) font to replace the <builtin>.
[2] but not all of them. I need to cross check who is calculating the size/dpi in/correctly - Blender or BLF. (e.g. fonts that work well - MS Gothic)
[3] I think this may be related to the resolution we are drawing the font
[4] It can't/will not be handled inside BFL. So the way I see it is to implement a mini text library/api that works as a middlelayer between the drawing step and BLF. 
    So instead of:
      BLF_draw(fontid, (char *)text, strlen(text));
    We would do:
      MAGIC_ROUTINE_IM_NOT_BLF_draw(fontir, (char *)text, styleflag, width, height);
[5] don't hold your breath ... but if someone wants to have fun in the holidays the (4) and (5) are part of the same problem.

Code Explanation:
-----------------
The patch should be simple to read. They are three may parts:
1) BL_BlenderDataConversion.cpp:: converts the OB_FONT object into a KX_FontObject.cpp and store it in the KX_Scene->m_fonts
2) KetsjiEngine.cpp::RenderFonts:: loop through the texts and call their internal drawing routine.
3) KX_FontObject.cpp::
  a) constructor: load the font of the object, and store other values.
  b) DrawText: calculate the aspect for the given size (sounds hacky but this is how blf works) and call the render routine in RenderTools
4) KX_BlenderGL.cpp (called from rendertools) ::BL_print_game_line:: Draws the text. Using the BLF API

*) In order to handle visibility of the object added with AddObject I'm adding to the m_scene.m_fonts list only the Fonts in a visible layer - unlike Cameras and Lamps where all the objects are added.

Acknowledgements:
----------------
Thanks Benoit for the review and adjustment suggestions.
Thanks Diego for the BFL expertise, patches and support (Latin community ftw)
Thanks my boss for letting me do part of this patch during work time. Good thing we are starting a project in a partnership with a Japanese Foundation and eventual will need unicode in BGE :) for more details on that - www.nereusprogram.org - let's call it the main sponsor of this "bug feature" ;)
2010-12-16 10:25:41 +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
1dd1cea06e fix for error when changing DISBALE_PYTHON -> WITH_PYTHON,
This define wasn't set in some parts of the BGE causing problems with the view matrix.
in CMake define for the entire BGE fixes this.
2010-11-29 07:56:45 +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
da1f288f50 rename libs internal libs for CMake + SCons (used in MSVC project files)
for game engine use "ge_" prefix & make names generally more descriptive.
2010-11-18 11:42:05 +00:00
Mitchell Stokes
a6007d1a5c A couple of changes to 2D filters to make adding new built-in ones nicer:
* Built-in filters were not being analyzed, which means no depth or luminance textures for them
  * Removed an unnecessary if that becomes really hairy when new built-in filters are added (ie, when filters are defined beyond the value used for custom filters)
2010-11-01 00:15:12 +00:00
Campbell Barton
0876fce009 rename and negate DISABLE_PYTHON --> WITH_PYTHON 2010-10-31 04:11:39 +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
Dalai Felinto
3a369128b4 BGE Bugfix for [#22371] Alpha Planes affecting 2DFilters
disabling GL_Blend at the 2dfilter drawing routine makes the trick here. there is not a clear function invoked before the 2dfilter drawing routine. Therefore I found better to disable alpha blending while we are setting the other OpenGl attributes/matrixes.

We are not re-enabling GL_BLEND after we disable it. We could and it wouldn't hurt but I can't see why to. open to suggestions here of course.
2010-10-11 20:55:05 +00:00
Nathan Letwory
663ce490e0 Enable CXX_GUARDEDALLOC support through SCons. 2010-10-08 20:39:56 +00:00
Campbell Barton
9b518710c6 update for MingW/CMake
- ignore MSVC warnings when FREE_WINDOWS is defined to quiet warnings.
- the CMake flags were not being set correctly making blender have weirdo colors (no -funsigned-char).
2010-09-15 16:13:32 +00:00
Nathan Letwory
6c113b54b3 Finally change SConscript tabs to spaces. 2010-08-29 20:52:05 +00:00
Guillermo S. Romero
95aa8cfa4a Update address in license block. 2010-08-10 21:22:26 +00:00
Campbell Barton
940d1dcd0a remove commented scons lines from cmake files, fixed use of pointer poll function for ID drobdowns (currently unused) 2010-08-03 08:12:55 +00:00
Brecht Van Lommel
5e5b0cbb26 Game engine was not updated yet to disable vertex/normal state on exit as
other parts of Blender expect, might have caused issues with VBO's in some
cases.
2010-07-27 11:07:34 +00:00
Brecht Van Lommel
f65c15cd5a Fix #22772: remove unnecessary -fpascal-strings flag on OS X, only
some debug code in webplugin needed it.
2010-07-07 15:26:02 +00:00
Mitchell Stokes
08a94f9bbd BGE: When dynamically loading scenes (bge.logic.LibLoad()) in GLSL mode, the lights in the loaded scene would not affect the current scene and vice versa. To fix this, I've updated to merge code to update the scenes that the shaders are using to the scene being merged into. 2010-06-16 19:07:20 +00:00
Campbell Barton
ed338da8c9 - WITH_CXX_GUARDEDALLOC working again
- CMake building without python or fluidsim working again (broke in recent commit)
- remove BLI_short_filename(), it wasnt used anywhere.
2010-06-06 01:15:44 +00:00
Dalai Felinto
c6bec43330 reverting previous commit from Mitchell. His commit went to the trunk instead of the branch :)
svn merge -r 29067:29066 https://svn.blender.org/svnroot/bf-blender/trunk/blender
2010-05-29 21:31:57 +00:00
Mitchell Stokes
9d3157eed0 Reversing the last merge because I botched it. 2010-05-29 21:22:24 +00:00
Dalai Felinto
edc56fae18 BGE Fix: [#19951] mouse over sensor is broken with letterboxing framing
Tested with GameLogic.mouse.position and mouse over sensor.
It should be working with other mouse sensor as well. If not, please help to test and report a bug.
(couldn't test blenderplayer but it should be working there as well).

(Benoit, this is the same patch that I sent you. I hope it's OOP enough. Looking forward to hear from you on that)

I believe that this was the last "mouse" related bug we had reported. MouseLoook scripts should be working 100% in Blender/BGE 2.50 now \o/
2010-04-23 22:48:26 +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
Dalai Felinto
795b438bf5 Patch #21789 - BGE Keyboard and Mouse Python types - by Mitchell Stokes(Moguri)
The patch exposes mouse and keyboard read-only properties in the GameLogic module
Also renames bge.keys to bge.events (* Note: name of bge submodules (logic, render, ...) may change before 2.5 final release [right Campbell?]).

"""
This patch adds two new types to the BGE:
SCA_PythonKeyboard
SCA_PythonMouse

These two types allow users to make use of the keyboard and mouse without the need for a keyboard or mouse sensor.

SCA_PythonKeyboard has an events property that acts just like SCA_KeyboardSensor.events.

SCA_PythonMouse also has an events property to check for mouse events. Further more it supports getting and setting normalized cursor position (from 0.0 to 1.0) with SCA_PythonMouse.position. The cursor can be shown/hidden using SCA_PythonMouse.visible.
"""

Its use is similar with current mouse and keyboard controllers. With the exception of mouse position being normalized and writable as well (replacing Rasterizer.setMousePosition).

Code Sample:
######
from bge import logic, events

mouse = logic.mouse
keyboard = logic.keyboard

for key,status in keyboard.events:
    if status == logic.KX_INPUT_JUST_ACTIVATED:
        if key == events.WKEY:
            print(mouse.position)
            # move_forward()

mouse.visible = True # turn cursor visible
mouse.position = 0.5,0.5  # centralize mouse - use tuple
######

* Important Note: mouse.position still will not work properly for Letterbox mode.
In order to fix letterboxing I may need to move the set x,y mouse function to inside the canvas code (to avoid duplicated code between mouse sensor and bge.logic.mouse). I'll leave this for another commit though.
Thanks Mitchell for the work on that.
2010-04-17 06:52:14 +00:00
Benoit Bolsee
2ae418e0a8 Fix compilation error in MinGW with my last commit. 2010-03-25 08:48:31 +00:00
Benoit Bolsee
f1cfb5f13c BGE: bug #21684 fixed: multiple material with static modifier now supported with display list. 2010-03-24 22:55:45 +00:00
Dalai Felinto
0cad3ae24c BGE 2D Filters: filters run per scene now (fix for [#18152]) - it (slightly) breaks backward compatibility !!!
Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use.

(1) Performance - To run the filters 2X == 2X slower
(2) flexibility of use - Very often we want the filter in the scene but not in the UI for example.

For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now.
To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes.

* * * * *

Imagine that we have:
(a) Main Scene
(b) Overlay Scene

in Main Scene the Z Buffer and RGB will be from the main scene.
in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b].

So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
2010-03-03 06:38:47 +00:00