Commit graph

250 commits

Author SHA1 Message Date
Juan Linietsky 74808ac4d9 New particle system, mostly working, some small features missing. 2017-04-06 23:49:27 -03:00
Rémi Verschelde debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Hein-Pieter van Braam b696beea65 Correct hash behavior for floating point numbers
This fixes HashMap where a key or part of a key is a floating point
number. To fix this the following has been done:

* HashMap now takes an extra template argument Comparator. This class
gets used to compare keys. The default Comperator now works correctly
for common types and floating point numbets.

* Variant implements ::hash_compare() now. This function implements
nan-safe comparison for all types with components that contain floating
point numbers.

* Variant now has a VariantComparator which uses Variant::hash_compare()
safely compare floating point components of variant's types.

* The hash functions for floating point numbers will now normalize NaN
values so that all floating point numbers that are NaN hash to the same
value.

C++ module writers that want to use HashMap internally in their modules
can now also safeguard against this crash by defining their on
Comperator class that safely compares their types.

GDScript users, or writers of modules that don't use HashMap internally
in their modules don't need to do anything.

This fixes #7354 and fixes #6947.
2017-02-16 18:44:29 +01:00
Rémi Verschelde 2a0ddc1e89 Style: Various fixes to play nice with clang-format 2017-01-16 08:49:52 +01:00
Rémi Verschelde f44ee891be Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
Rémi Verschelde a540e15cd1 Merge pull request #7513 from djrm/compilation_fix
Matrix32 -> Transform2D
2017-01-15 00:27:05 +01:00
Rémi Verschelde 93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Daniel J. Ramirez aafaf2226f Matrix32 -> Transform2D 2017-01-13 01:34:32 -06:00
Juan Linietsky bc26f90581 Type renames:
Matrix32 -> Transform2D
	Matrix3 -> Basis
	AABB -> Rect3
	RawArray -> PoolByteArray
	IntArray -> PoolIntArray
	FloatArray -> PoolFloatArray
	Vector2Array -> PoolVector2Array
	Vector3Array -> PoolVector3Array
	ColorArray -> PoolColorArray
2017-01-11 00:52:51 -03:00
Juan Linietsky 2ab83e1abb Memory pool vectors (DVector) have been enormously simplified in code, and renamed to PoolVector 2017-01-07 18:26:38 -03:00
Juan Linietsky 0f7af4ea51 -Changed most project settings in the engine, so they have major and minor categories.
-Changed SectionedPropertyEditor to support this
-Renamed Globals singleton to GlobalConfig, makes more sense.
-Changed the logic behind persisten global settings, instead of the persist checkbox, a revert button is now available
2017-01-05 09:16:00 -03:00
Rémi Verschelde 3f3f5a5359 Merge remote-tracking branch 'origin/gles3' into gles3-on-master
Various merge conflicts have been fixed manually and some mistakes
might have been made - time will tell :)
2017-01-02 21:52:26 +01:00
Rémi Verschelde c7bc44d5ad Welcome in 2017, dear changelog reader!
That year should bring the long-awaited OpenGL ES 3.0 compatible renderer
with state-of-the-art rendering techniques tuned to work as low as middle
end handheld devices - without compromising with the possibilities given
for higher end desktop games of course. Great times ahead for the Godot
community and the gamers that will play our games!
2017-01-01 22:03:33 +01:00
Juan Linietsky a47c78aed1 Screen space reflection effect 2016-11-29 19:55:12 -03:00
Rémi Verschelde f34151ff0f style: Various other PEP8 fixes in Python files
Done with `autopep8 --select=E7`, fixes:

- E701 - Put colon-separated compound statement on separate lines.
- E702 - Put semicolon-separated compound statement on separate lines.
- E703 - Put semicolon-separated compound statement on separate lines.
- E711 - Fix comparison with None.
- E712 - Fix (trivial case of) comparison with boolean.
- E713 - Fix (trivial case of) non-membership check.
- E721 - Fix various deprecated code (via lib2to3).
2016-11-01 00:35:16 +01:00
Rémi Verschelde 97c8508f5e style: Start applying PEP8 to Python files, indentation issues
Done with `autopep8 --select=E1`, fixes:

- E101 - Reindent all lines.
- E112 - Fix under-indented comments.
- E113 - Fix over-indented comments.
- E115 - Fix under-indented comments.
- E116 - Fix over-indented comments.
- E121 - Fix a badly indented line.
- E122 - Fix a badly indented line.
- E123 - Fix a badly indented line.
- E124 - Fix a badly indented line.
- E125 - Fix indentation undistinguish from the next logical line.
- E126 - Fix a badly indented line.
- E127 - Fix a badly indented line.
- E128 - Fix a badly indented line.
- E129 - Fix a badly indented line.
2016-11-01 00:33:51 +01:00
Rémi Verschelde fc8ccd5b8c SCsub: Add python shebang as a hint for syntax highlighting
Also switch existing shebangs to "better" /usr/bin/env python.
2016-10-17 20:10:46 +02:00
Rémi Verschelde 248bc9159c drivers: Refactor SCsub and drop redundant env_drivers clone
The reordering of the SConscript includes allows to ensure that
stuff like the builtin zlib headers will be available for libpng.

Also moved glew back into global env, otherwise windows seems
not to find it... Kind of shooting in the dark with this multi-env
setup.
2016-10-15 18:10:18 +02:00
Juan Linietsky cf5778e51a -Added ViewportContainer, this is the only way to make viewports show up in GUI now
-2D editing now seems to work
-Added some functions and refactoring to Viewport
2016-10-05 01:26:35 -03:00
Juan Linietsky 22d83bc9f6 Begining of GLES3 renderer:
-Most 2D drawing is implemented
-Missing shaders
-Missing all 3D
-Editor needs to be set on update always to be used, otherwise it does not refresh
-Large parts of editor not working
2016-10-03 21:35:16 +02:00
Rémi Verschelde 78d97b060a Merge pull request #6605 from zaps166/old-gl-ext-funcs
Add compatibility with old OpenGL 2.1 drivers
2016-10-03 14:21:37 +02:00
mookiexl 0b12ebba11 Limit directional shadow draw distance, fixes #559, optimization (#1991)
* Shadow fadeout exponent hardcoded for now, should be user configurable.
* optimization - skip shadows outside visible range
2016-10-03 12:28:32 +02:00
Rémi Verschelde 463a42c71e Merge pull request #6606 from zaps166/don-crash-on-unsupported-gl
Don't crach when OpenGL version is unsupported
2016-10-03 11:54:49 +02:00
Błażej Szczygieł 7b8fe97888 Don't crash in "_process_hdr()" if "framebuffer.luminance" is empty
If "glFramebufferTexture2D()" fails on old drivers the Vector is empty.
Don't allow to read from empty Vector (NULL pointer).
2016-09-25 13:09:23 +02:00
Błażej Szczygieł ca3b8deb78 Don't crach when OpenGL version is unsupported 2016-09-25 13:06:14 +02:00
Błażej Szczygieł a27fafb273 Add compatibility with old OpenGL 2.1 drivers
If ARB_framebuffer_object is not supported, try to fall-back to
EXT_framebuffer_object if present.

In current version of godot, the way framebuffers are used is backward
compatible with the older EXT_framebuffer_object extension.

Fixes #6591
Done with SuperUserNameMan
2016-09-25 12:58:22 +02:00
knd 708a028ce8 removed redundant assign operation in mesh_add_surface: elem_count is reassigned a value before the old one has been used. 2016-09-21 05:23:42 +03:00
Rémi Verschelde 80861b7d59 Merge pull request #6414 from RandomShaper/improve-shader-shadow
Expose additional light/shadow properties to canvas item shaders
2016-09-17 18:34:22 +02:00
Juan Linietsky e2aad59b59 Merge pull request #5962 from Alex-doc/Y_billboard
Implements Y billboard
2016-09-10 12:12:26 -03:00
Juan Linietsky 7a27d5d9e7 Merge pull request #6363 from vnen/winrt
Fix the support for WinRT/UWP
2016-09-10 11:47:42 -03:00
Pedro J. Estébanez 0960887625 Expose light shadow color to canvas item shaders 2016-09-07 01:52:54 +02:00
Pedro J. Estébanez b69e422af9 Rename misleading define
The macro USE_LIGHT_SHADOW_COLOR actually was being defined when the shader used SHADOW (the output shadow color), not the shadow color set for the light so it's better named USE_OUTPUT_SHADOW_COLOR. In 3D there's not that difference but renaming as well for consistency.
2016-09-07 00:51:03 +02:00
George Marques c9b82498b4
Fix drivers coding for WinRT
- Add a proper function to retrieve IP addresses.
- Solve issues with Windows FileAccess and DirAccess to use the same code
  for WinRT.
- Add patches to the GLES2 rasterizer to workaround ANGLE issues.
2016-09-03 19:36:44 -03:00
Juan Linietsky fb4d6d1db0 More visual script improvements
-Added anti-aliasing on lines
-Improved draw performance enormously
-Removed sequence ports for most nodes, current visual scripts will likely be broken now. Sorry!
2016-08-30 23:46:41 -03:00
Alex Piola c3b9ef8229 Implements Y billboard
Y billboard wasn't hooked up. This commit implements it.
2016-08-01 14:00:30 +02:00
Rémi Verschelde a155342eca GLES2: Check for GPU capabilities to display an error
The engine will still segfault, but the error message should be displayed by the
OS in a blocking manner, so that it will only crash once users have acknowledged
the error dialog.

Closes #1162.
2016-07-25 23:08:46 +02:00
Rémi Verschelde b6ac91c0e6 Removed unused variables (first pass)
Fixes various gcc 5.4.0 warnings for -Wunused-variable and -Wunused-but-set-variable
2016-07-07 23:15:03 +02:00
Geequlim fdf914e53e Add texture region support for stylebox render 2016-06-05 00:45:53 +08:00
Juan Linietsky 8be2fabbe5 Changed import workflow
-Rearrange favorites in fs dock with drag and drop
-Removed import -> sub-scene, moved to scenetree contextual menu
-Removed import -> re-import , moved and integrated to FS dock
-Added ability in FS dock to re-import more than one resource
simultaneously
-Added ability to drag from native filesystem explorer to Godot, only
works on Windows though
-Removed scene reimport merge options, never worked well. Eventually
merging materials should be re-added
-Added ability to set custom root node type when importing scenes
-Re-Import is now automatic, can be configured back to manual in editor
settings
-Added resource previews in property list for many resource types
2016-05-27 14:19:11 -03:00
Juan Linietsky 8043135e0d missing default value 2016-05-04 12:46:37 -03:00
Juan Linietsky fd6667a7dc fix to avoid video texture scaling 2016-05-04 12:44:50 -03:00
Juan Linietsky 89d87294db ability to shrink all images x2 on load
this is for extreme cases when running on devices with very low video
memory, so you can still retain compatibility.
2016-05-04 12:37:07 -03:00
MSC 7a9998370f free Material 'shadow_material_double_sided' on ::finish() 2016-04-03 19:24:14 +02:00
Rémi Verschelde c9a401e541 Merge pull request #3694 from techtonik/patch-1
Show driver information in verbose mode
2016-03-15 10:30:47 +01:00
Rémi Verschelde aec4f57f95 Merge pull request #3528 from SaracenOne/baked_light_realtime_colourize
Ability to colourize baked lighting in real time.
2016-03-15 10:22:09 +01:00
Saracen 24bc7d8db7 Fix 'FLAG_RECEIVE_SHADOWS' flag for GeometryInstances so that turning it off now correctly disables shadows from affecting the instance. 2016-03-12 16:51:17 +00:00
Juan Linietsky a3d6768199 Merge pull request #3958 from SaracenOne/cpu_skinning_path_fix
Fix to CPU skinning path when using GPU skinning (meshes with morphs)
2016-03-08 15:34:36 -03:00
Saracen 7fecebd8a8 Added extra controls to GeometryInstances to control how they should cast shadows: double-sided and shadows only.
Conflicts:
	servers/visual/visual_server_raster.h
2016-03-07 23:14:14 +00:00
Saracen 23a4683879 Fix to CPU skinning path when using GPU skinning (meshes with morphs) causing modifications to root bone to have doubled offset and wasted performance. 2016-03-06 18:47:52 +00:00
anatoly techtonik ba6858dd41 Show which video driver is used in verbose mode 2016-02-24 23:36:40 +03:00
Saracen fe49ac19df Fixed hardware-accelerated skinning support. 2016-02-24 02:16:20 +00:00
Saracen de5281c398 Ability to colourize baked lighting in real time. 2016-02-06 18:03:20 +00:00
Juan Linietsky f6a8a0f513 -Correctly flip BG texture if viewport is flipped, fixes #3507 2016-02-02 07:40:38 -03:00
Juan Linietsky 2fce78ad10 Correct viewport scaling with stretch mode viewport, fixes #1571 2016-01-24 00:46:26 -03:00
Rémi Verschelde d67df42cc8 Merge pull request #2180 from sketchyfun/SketchyFun
Billboards were displayed upside down when drawn to a render texture
2016-01-19 22:25:40 +01:00
Saracen 1cc5ccba1b Allows vec4 shader uniforms to be set by quaternion variant type. 2016-01-13 22:09:07 +00:00
Juan Linietsky 6eb742d49f -Make a rare corner case where disabling/reenabling mipmaps causes invalid texture state. Fixes #3102 2016-01-10 21:45:58 -03:00
Juan Linietsky f6798d9d73 -Made tile parameter work, fixes #3167 2016-01-10 17:45:41 -03:00
Juan Linietsky eca92bb7ac make it impossible to shrink framebuffer < 0, fixes #2066 2016-01-02 21:08:57 -03:00
Juan Linietsky 8fb70142e4 Ability to use opacity on distance field textures, fixes #2148 2016-01-02 15:57:19 -03:00
George Marques 5be9ff7b67 Update copyright to 2016 in headers 2016-01-01 11:50:53 -02:00
reduz 77b5b4f4df removed some prints 2015-12-29 12:56:58 -03:00
Juan Linietsky 428984ec0c -New mask mode for lights, makes using masks MUCH easier. 2015-12-08 20:25:08 -03:00
Juan Linietsky e176bb6a7c Merge pull request #2719 from SaracenOne/clipping_fix
Canvas Clipping fix
2015-12-08 17:18:19 -03:00
Saracen 157b97b087 Extended clipping fix to missing clipping-related features. 2015-12-07 13:59:42 +00:00
Juan Linietsky 4b1f0afb01 -several fixes to Android to work better on Tegra 3/4 devices, uses 16 bits FBOs so all 2D shader effects should now work in every single Android device. 2015-12-02 11:15:48 -03:00
Saracen 2cc52bc3ff Modification to GUI in 3D demo to show resolved viewport clipping bug and small fix to bug causing viewport clipping to be inverted. 2015-11-19 23:47:25 +00:00
Saracen dd00452997 Merge branch 'master' of https://github.com/okamstudio/godot into shadow_color
Conflicts:
	drivers/gles2/shader_compiler_gles2.cpp
2015-11-18 23:18:10 +00:00
Juan Linietsky 0c3386b2ed Merge pull request #2707 from akien-mga/master
Cosmetic fixes to SCons buildsystem
2015-11-18 19:43:28 -03:00
Juan Linietsky f0aeb036d1 Merge pull request #2715 from SaracenOne/shader_fix_and_enhancement
Write to 4-dimensional position access and shader graph code generation fix.
2015-11-18 19:36:47 -03:00
Juan Linietsky 0fd3e18818 Merge pull request #2724 from SaracenOne/disable_baked_light_sampling_on_shadeless
Disable baked lighting sampling on shadeless materials.
2015-11-18 19:31:18 -03:00
Juan Linietsky 1ceefd4759 Merge pull request #2661 from romulox-x/lowMem2D
Added low_memory_2d_mode
2015-11-18 19:12:34 -03:00
Aren Villanueva 402c24ec8b iOS compile fixes. 2015-11-16 11:10:07 +11:00
Saracen c1d19ad258 New shader feature: change the colour of shadows on a per-material basis.
Conflicts:
	drivers/gles2/shader_compiler_gles2.cpp
2015-11-08 03:54:55 +00:00
Saracen 539bbd6654 Disable baked lighting sampling on shadeless materials. 2015-11-02 17:30:18 +00:00
Saracen ff363c94db Another clipping fix: default back to using window size to calculate clipping on viewports which don't have a rendertarget which fixes clipping on the editor viewport. 2015-11-02 16:48:11 +00:00
Saracen 5072134f41 Fixed canvas clipping on offscreen viewports. 2015-11-02 16:48:09 +00:00
Saracen b54d96ceba Added ability to write directly to 4-dimensional position vector from within custom vertex shader code. Bugfixes to shader graph code generation concerning xforms. 2015-11-02 16:03:31 +00:00
Rémi Verschelde 399b1b0474 Cosmetic fixes to SCons buildsystem
- Removed trailing spaces
- Made sure all indentation is done using tabs (fixes #39)
- Potentially fixed an identation issue for openssl check
2015-11-01 20:53:26 +01:00
romulox_x b86e3c3402 added low_memory_2d_mode, to indicate when 3D post processing buffers and viewport depth buffers should not be allocated 2015-10-21 19:23:34 -07:00
Juan Linietsky b59c86f6f9 -Ability to debug video memory usage
-Small fix to xml saver (swapping > and <)
2015-10-21 09:50:44 -03:00
Juan Linietsky 5d86a25f4d -some fixes to where screen is read from rasterizer
-fixed bug in ogg vorbis looping
-properly flushing audiostream rb when stopping
2015-10-19 18:47:49 -03:00
Juan Linietsky 79e5ced7e6 -A little More control about pixel snapping in 2D 2015-10-13 15:53:34 -03:00
romulox_x 187c000ab5 removed unnecessary clear, which prevented root viewport from working right when told not to clear 2015-10-01 13:30:10 -07:00
Juan Linietsky 83d9a692be Ability to visually debug geometry visually:
-Visible 2D and 3D Shapes, Polygons, Tile collisions, etc.
-Visible Navmesh and Navpoly
-Visible collision contacts for 2D and 3D as a red point
-Customizable colors in project settings
2015-09-20 13:03:46 -03:00
steve b0e5031f1f ios now displays splash screen between launch image and main scene, instead of a black screen 2015-09-10 15:01:02 -07:00
Juan Linietsky b0aa49accb merged some stuff for okam 2015-09-03 23:24:55 -03:00
romulox_x 85e49d4e75 added support for mirrored repeat texture wrapping 2015-06-25 14:51:21 -07:00
Juan Linietsky 52308aba68 ability to change shadow color in light2d 2015-06-24 18:15:43 -03:00
BenH d807a22981 Billboards were being displayed upside down when drawn to a render texture
Render texture's view transforms seem to be inverted, so when drawing
billboards, the 'up' vector given to set_look_at() is also inverted and
so the billboard gets drawn upside down.
2015-06-24 21:06:31 +01:00
Juan Linietsky 4b35654a02 Update rasterizer_gles2.cpp
fixed camera plane
2015-06-12 09:54:19 -03:00
Juan Linietsky 9e479065f5 new space shooter demo
ortho camera sort fix, closes #2063
2015-06-11 10:00:48 -03:00
Juan Linietsky 9acab32daa new file dialog!
-ItemList control for easier lists/thumbnails
-New file dialog, with support for thumbnails, favorites, recent places,
etc
-Moved .fscache out of the project, no more bugs due to committed/pulled
.fscache!
-Dir dialog now sorts directories
2015-06-06 09:44:38 -03:00
Juan Linietsky f4caddbc23 -corrected frac() and hyperbolic sin,cos,tan when running on PC (GLSL120), fixes #1775 2015-05-04 10:53:54 -03:00
Juan Linietsky c45ffc2ca9 -fixed old condition in TextureFrame that caused bugs in materials, closes #1742 2015-05-01 12:16:51 -03:00
Juan Linietsky 5c6b31c024 -fixed broken lighting in release version of godot for isometric light demo, fixes #1697 2015-04-30 11:34:24 -03:00
Juan Linietsky 0adca0a7c9 -made normalmaps easier in 2D, fixes #1467 2015-04-27 08:11:54 -03:00
Juan Linietsky 52e2f4606f -Objects with BlendMode!=MIX do not get affected by CanvasModulate, fixes #1724 2015-04-24 23:46:42 -03:00