-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for visual effects ("shaders") on objects. (#2901)
* This allows to generate interesting visual effects, which can be controlled by events. For example, you can use an outline on an object to highlight, make the player glow when launching a spell, blur objects, etc... * A new "effects" tab is now present in the objects editor. From there, you can add visual effects, that were already available for layers, customize them from this editor. * Actions and conditions are available to manipulate effects and change their parameters during the game. * Learn more on the wiki: http://wiki.compilgames.net/doku.php/gdevelop5/objects/effects Co-authored-by: Florian Rival <[email protected]>
- Loading branch information
1 parent
b97f716
commit 599ccb6
Showing
108 changed files
with
1,882 additions
and
780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,17 @@ | |
* Copyright 2008-present Florian Rival ([email protected]). All rights | ||
* reserved. This project is released under the MIT License. | ||
*/ | ||
#include <iostream> | ||
#include "EffectsCodeGenerator.h" | ||
|
||
#include <iostream> | ||
|
||
#include "GDCore/Extensions/Metadata/EffectMetadata.h" | ||
#include "GDCore/Extensions/Metadata/MetadataProvider.h" | ||
#include "GDCore/Project/Effect.h" | ||
#include "GDCore/Project/Layer.h" | ||
#include "GDCore/Project/EffectsContainer.h" | ||
#include "GDCore/Project/Layer.h" | ||
#include "GDCore/Project/Layout.h" | ||
#include "GDCore/Project/Object.h" | ||
#include "GDCore/Project/Project.h" | ||
|
||
namespace gd { | ||
|
@@ -33,6 +36,24 @@ void ExposeProjectEffects( | |
worker(effect); | ||
} | ||
} | ||
|
||
for (std::size_t i; i < layout.GetObjectsCount(); i++) { | ||
auto& object = layout.GetObject(i); | ||
auto& effects = object.GetEffects(); | ||
for (std::size_t e = 0; e < effects.GetEffectsCount(); e++) { | ||
auto& effect = effects.GetEffect(e); | ||
worker(effect); | ||
} | ||
} | ||
} | ||
|
||
// Add global object effects | ||
for (std::size_t s = 0; s < project.GetObjectsCount(); s++) { | ||
auto& effects = project.GetObject(s).GetEffects(); | ||
for (std::size_t e = 0; e < effects.GetEffectsCount(); e++) { | ||
auto& effect = effects.GetEffect(e); | ||
worker(effect); | ||
} | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.