Commit Graph

384 Commits

Author SHA1 Message Date
Mitchell Stokes
82c845425f BGE: Adding partial support for LibLoaded lights with GLSL materials.
Any GLSL materials loaded after lights are LibLoaded will now use the lights in
heir shaders. This includes materials loaded from the same scene as the LibLoaded
lights. We could later add a new flag to LibLoad to recompile all existing shaders,
but this commit should offer a lot more flexibility as is.
2013-08-17 04:37:25 +00:00
Campbell Barton
c3b9ec82d0 fix for strange error with BGE 2d filter code,
RAS_2DFilterManager::RenderFilters was casting an int to an unsigned int, then doing a subtraction which would give a negative number.
2013-08-03 23:40:15 +00:00
Mitchell Stokes
e131447582 BGE: Making sure m_drawingmode is initialized in the various RAS_Storage constructors. 2013-08-03 05:02:03 +00:00
Mitchell Stokes
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
Mitchell Stokes
eb21bdd249 Merging changes from trunk r58091-58323. 2013-07-17 01:40:26 +00:00
Mitchell Stokes
5ba2f4367d BGE: adding a fix so 2D filters work properly with side-by-side stereoscopic rendering. 2013-07-15 22:44:48 +00:00
Campbell Barton
02ba328ca8 clang/cmake - quiet warnings for external libs and reference moto as a system include. 2013-07-15 08:26:16 +00:00
Campbell Barton
1f091fd234 add missing gpl headers 2013-07-02 09:47:22 +00:00
Campbell Barton
fad1da062d correct typos in comments. 2013-06-25 22:58:23 +00:00
Dalai Felinto
c72653cca0 BGE bugfix/patch "[#26075] game anaglyph colors are inverted" by Juha Maki-Kanto (kanttori)
Later I will try to find when this bug was introduced. But it's definitively broken in trunk.
2013-06-22 08:04:02 +00:00
Campbell Barton
9fb3d3e032 remove redundant includes from cmake and scons. 2013-05-30 02:16:22 +00:00
Campbell Barton
9cf6e305a9 split bge includes for scons onto their own lines (for easier merging) 2013-05-29 21:56:55 +00:00
Campbell Barton
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
Campbell Barton
6de829cb7a code cleanup: split scons includes onto multiple lines, reduce chance of include conflicts later on. 2013-05-20 18:42:28 +00:00
Mitchell Stokes
073d3ba5f7 BGE: Fix for [#34382] "Vertex position doesn't update when set through Python and "Cast Buffer Shadows" is disabled" reported by V.R. (rolle).
The BucketManager was assuming that all modified meshes were rendered when a render pass completed. However, materials that did not cast buffer shadows did not render during the shadow rendering step, and thus were never updated.
2013-05-10 05:13:16 +00:00
Campbell Barton
dee33e8097 fix [#34609] mesh.getVertex doesn't work as spected with poly.getMaterialIndex() and poly vertex indexes
revert r22906 (own old commit, was incorrectly trying to make vertex indices absolute)
2013-05-01 22:41:55 +00:00
Dalai Felinto
43998d6a38 BGE: Extend Framing Mode + Camera sensor
If the "Framing" mode is set to extend,
the camera frustrum changes when you
resizes the blenderplayer window.

Before this patch, there were no way to
control which part of the framing you want
to extend (vertical, horizontal or arbritary).

Now:
If the camera sensor fit is set to HORIZONTAL,
the horizontal field of view doesn't change.
If set to VERTICAL, the vertical fov doesn't change.

If set to AUTO the old behaviour takes place, arbitrarly
showing more of the horizontal or vertical field of view
depending on the aspect ratio of the window.

Test file:
https://svn.blender.org/svnroot/bf-blender/trunk/lib/tests/gameengine/framing_extend.blend

Bugfix supported by NF-UBC Nereus Program as part of the development
of OceanViz/NereusViz
2013-04-18 23:34:32 +00:00
Campbell Barton
3f7f07faf5 style cleanup 2013-04-18 01:52:38 +00:00
Mitchell Stokes
d2b14ed4f0 BGE: Adding mipmapping control to bge.render via bge.render.setMipmapping() and bge.render.getMipmapping(). 2013-04-14 00:40:24 +00:00
Mitchell Stokes
dbf4328f3f BGE: Adding a render.setFullScreen() and a render.getFullScreen() to allow fulscreening games via Python. 2013-04-13 21:09:02 +00:00
Mitchell Stokes
6297eb7da7 BGE: Cleaning up the VBO code to use RAS_TexVert more directly instead of copying out pieces. This also gets rid of MapBuffers, which isn't available in OpenGL ES. Scenes that require constant VBO updates (like my skeletal mesh stress test) are now 10~13% faster. 2013-04-05 01:28:38 +00:00
Campbell Barton
0874237358 code cleanup: bge warnings 2013-04-04 23:16:23 +00:00
Campbell Barton
ab41583bc2 style cleanup 2013-03-29 06:21:28 +00:00
Mitchell Stokes
1356e3b490 BGE: getting rid of a few maybe-uninitialized warnings. 2013-03-23 03:04:02 +00:00
Campbell Barton
655ed9cc7f style cleanup 2013-03-18 11:44:56 +00:00
Dalai Felinto
8ea7b742f6 bge bugfix: [#34517] 2D Filter causes mouselook script drifting effect (patch by Daniel Stokes - Kupoman)
Fix for 2.66a

""We can't pass the results of canvas->GetViewPort() directly because canvas->SetViewPort() does some extra math""
Bug introduced during 2.65 series in the refactor to use canvas->SetViewPort instead of direct opengl calls for viewport
(53305, 53392, 53393)
2013-03-04 08:45:42 +00:00
Dalai Felinto
a3b47ede17 BGE bug-fix[#34523] 2dfilter produces render error (objects disappear) - likely an alpha problem
Fix for 2.66a

With help from Daniel Stokes and Mitchell Stokes.

This bug always existed in OSX, but started showing up in Windows and Linux on review (54745 + 54747)
[the patch to enable alpha buffer for all OSs]

A better fix would be to use RAS_IRasterizer::SetAlphaBlend(GPU_BLEND_SOLID);
but I think gpu_verify_alpha_blend() is not switching to SOLID because
GTS.alphablend is GPU_BLEND_SOLID (even though GL_ALPHA_TEST is enabled).

Anyways, this is not something worth tackling now, since in terms of functionality it shouldn't matter.
2013-03-04 08:22:20 +00:00
Brecht Van Lommel
2822a14e5d Fix #34483: game engine multi UV glsl materials not working correct after changes
to support more than 2 UV maps. This code indirectly depended on the order of
OpenGL attribute ID's assigned by the OpenGL driver being the same as the
attributes being declared in the GLSL shader code, which is not always the case.
2013-03-01 20:45:42 +00:00
Nathan Letwory
04c1a7f1bc Check if the variable is a string and split nicely, so compile command stays intact with proper include options. 2013-02-25 12:03:55 +00:00
Campbell Barton
f924750463 fix for error using uninitialized draw mode with 'm_failsafe_storage' in the BGE. 2013-02-23 02:45:12 +00:00
Campbell Barton
6c0b8ec064 add include for scons. 2013-02-23 02:03:53 +00:00
Campbell Barton
a528cb9905 code cleanup: bge - was converting float[] to MT_Vector's just to compare. use BLI_math instead. 2013-02-23 01:57:56 +00:00
Campbell Barton
2005f7c6c0 style cleanup: also some typos 2013-02-11 00:49:00 +00:00
Mitchell Stokes
f75ca60a1c BGE: Make sure we are writting to the depth buffer when rendering alpha polygons for shadows. Otherwise alpha shadows won't work\! 2013-02-10 08:28:47 +00:00
Campbell Barton
9da4cab9fd style cleanup: comment format 2013-02-02 04:48:21 +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
Mitchell Stokes
4bd3477e29 BGE: Adding preliminary alpha shadow support for Simple shadow maps. They do not work in the viewport nor do they work for Variance shadow maps. 2013-01-12 20:01:58 +00:00
Campbell Barton
c7b7cba238 code cleanup: warnings 2013-01-04 02:13:29 +00:00
Mitchell Stokes
0cb07bcabc BGE: An off-by-one error when setting up the viewport for 2D filters caused a blurring effect when using 2D filters. This is now fixed. 2012-12-29 08:36:41 +00:00
Mitchell Stokes
7d68b37032 BGE: Fix for [#33685] "2D Filters Partially Offset" reported by Josiah Lane (solarlune). This bug was caused by me in a recent change to clean up the 2D filters a bit. I forgot that canvas->SetViewPort already handles some viewport calculations, and thus I ended up doubling up on calculations, which caused the offset. 2012-12-29 04:03:25 +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
119665d5b7 BGE: Use canvas->SetViewPort() instead of glViewport() in the 2D filter. 2012-12-24 02:59:16 +00:00
Campbell Barton
3bc3e178b3 style cleanup 2012-12-20 00:29:31 +00:00
Campbell Barton
0ddc77f913 code cleanup: warnings 2012-12-19 01:48:54 +00:00
Campbell Barton
2349370a51 fix for typo in r53145 2012-12-19 01:42:28 +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
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
050f09aa6c buildsystem cleanup: remove duplicate source & includes for scons,
add a check for duplicates in BlenderLib()m, if 0'd now.
2012-11-14 01:41:24 +00:00
Campbell Barton
250109f5ac add argument so recent bge function mesh.transform_uv() so you can optionally transform between UV1 / UV2 2012-11-10 10:26:39 +00:00
Campbell Barton
fecc3b9d68 add 2 new utility functions to the BGE mesh py api.
mesh.transform(matid, matrix)
  mesh.transform_uv(matid, matrix, uv_index=-1))


much more efficient then looping over verts in python to transform them.
2012-11-10 09:45:43 +00:00