Commit Graph

360 Commits

Author SHA1 Message Date
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
Campbell Barton
d25b13d13f code cleanup: double promotion warnings, also allow cmake to build SDL without audaspace. 2012-11-09 16:15:00 +00:00
Campbell Barton
617a73c573 code cleanup: unused defines & some formatting. 2012-11-08 06:46:10 +00:00
Campbell Barton
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
Campbell Barton
00acdb6292 remove CD_POLYINDEX customdata layer:
reported as [#29376] BMESH_TODO: remove tessface CD_ORIGINDEX layer

for a single mesh there could be 3 origindex mappings stored, one on the polygons and 2 on the tessfaces.
(CD_POLYINDEX and CD_ORIGINDEX).

as Andrew suggests, now tessfaces (which are really a cache of polygons), using origindex to point to polygons on
the same derived mesh, and polygons only store the original index values.
2012-10-30 19:20:17 +00:00
Campbell Barton
ddc2dbc2a4 style cleanup 2012-10-22 08:15:51 +00:00
Campbell Barton
226a5ee834 remove LOD_Decimator (c++ decimator), now replaced by bmesh decimator. also remove CTR c++ classes that are no longer used. 2012-10-22 02:39:26 +00:00
Campbell Barton
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
Campbell Barton
4d4664d98f code cleanup: check for msvc directly when using warning pragma's. 2012-10-15 02:15:07 +00:00
Campbell Barton
8e01b8959e style cleanup 2012-10-14 13:08:19 +00:00
Campbell Barton
3a947cf537 code cleanup: remove redundant casts 2012-10-14 08:49:01 +00:00
Campbell Barton
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
Mitchell Stokes
244ce92dbd BGE: Setting up the RAS_ICanvas interface as the primary way to alter the OpenGL
viewport. This helps to eliminate OpenGL calls in weird places like the physics
code and to reduce glGet calls, which are expensive.

There should be no functional changes (except maybe a very slight speed improvement).
2012-10-08 03:28:11 +00:00
Campbell Barton
aedf450746 code cleanup: use checks for empty rather then size in the BGE 2012-10-07 12:28:19 +00:00
Campbell Barton
5d56a901a8 code cleanup: c++ - use empty() rather than size(), use prefix operators for non-primitive types - recommended for non primitive types. 2012-09-20 00:55:32 +00:00
Campbell Barton
2fb8292005 style cleanup 2012-09-16 04:58:18 +00:00
Dalai Felinto
622ac250f9 bge cleanup caught by accident while going over the code, it seems someone forgot to use rect_height everywhere (no functional change) 2012-09-13 23:39:09 +00:00
Campbell Barton
a0ae47f06c add some missing NULL checks, a few parts of the code used a pointer then checked it for NULL after.
also made it more clear that some areas assume the pointer isnt null (remove redundant NULL checks).
2012-09-11 02:18:27 +00:00
Campbell Barton
6972e19fd5 code cleanup:
- replace (strcmp(vfont->name, FO_BUILTIN_NAME) == 0)  with  (BKE_vfont_is_builtin(vfont)).
- reduce some double promotions.
2012-08-03 22:12:57 +00:00
Campbell Barton
a199ae5368 style cleanup: whitespace, also add '?' to save over popup since it wasnt totally clear it was a question (user pointed this out, they thought it was just notification and lost their work). 2012-07-31 23:06:12 +00:00
Mitchell Stokes
f405d8fa53 BGE: Fixing a performance regression with 2D filters. My changes caused a check to fail every frame resulting in constant recreation of textures. 2012-07-28 09:45:39 +00:00
Campbell Barton
4c2de5e0c7 fix some types and incorrect info 2012-07-26 17:41:09 +00:00
Campbell Barton
9b51503307 style cleanup 2012-07-21 22:58:08 +00:00
Mitchell Stokes
52d2bae2bf Fix for [#32129] "2D filter texture width off by one?" reported by Alex Fraser (z0r).
The GetWidth() and GetHeight() functions of the canvas' display area seem to give values that are both off by one for what OpenGL wants. Adding 1 to both values seems to fix the problem.
2012-07-18 05:51:44 +00:00
Mitchell Stokes
b41561a406 Fix for [#31978] "Horizon colour drawn on two edges of screen when a 2D filter is active" reported by Alex Fraser.
The glViewport used for 2D Filters wasn't quite matching the 3d view. It seems the height and width were both off by one. There may be a deeper bug with the canvas rectangle having slightly wrong dimensions, but this at least fixes the 2D Filters.
2012-07-05 21:03:29 +00:00