summaryrefslogtreecommitdiffstats
path: root/scene/resources/shader.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-01-02 21:38:20 +0100
committerRémi Verschelde <rverschelde@gmail.com>2017-01-02 21:52:26 +0100
commit3f3f5a5359973e95e94148676a9793d6f52468f3 (patch)
tree65adf17c3d3f8d3a83bec29f51142fe884e942d8 /scene/resources/shader.h
parentdb46a344180d4eae1455e97e22bf84c9c304be7c (diff)
parent2820b2d82b2ed747011e37c543aefc6d4d4edee9 (diff)
downloadredot-engine-3f3f5a5359973e95e94148676a9793d6f52468f3.tar.gz
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 :)
Diffstat (limited to 'scene/resources/shader.h')
-rw-r--r--scene/resources/shader.h31
1 files changed, 13 insertions, 18 deletions
diff --git a/scene/resources/shader.h b/scene/resources/shader.h
index 94ee04812a..279cf5b7c9 100644
--- a/scene/resources/shader.h
+++ b/scene/resources/shader.h
@@ -32,6 +32,7 @@
#include "resource.h"
#include "io/resource_loader.h"
#include "scene/resources/texture.h"
+
class Shader : public Resource {
OBJ_TYPE(Shader,Resource);
@@ -41,17 +42,14 @@ class Shader : public Resource {
public:
enum Mode {
- MODE_MATERIAL,
+ MODE_SPATIAL,
MODE_CANVAS_ITEM,
- MODE_POST_PROCESS,
+ MODE_PARTICLES,
MODE_MAX
};
private:
RID shader;
Mode mode;
- Dictionary _get_code();
- void _set_code(const Dictionary& p_string);
-
// hack the name of performance
// shaders keep a list of ShaderMaterial -> VisualServer name translations, to make
@@ -73,10 +71,8 @@ public:
//void set_mode(Mode p_mode);
Mode get_mode() const;
- void set_code( const String& p_vertex, const String& p_fragment, const String& p_light,int p_fragment_ofs=0,int p_light_ofs=0);
- String get_vertex_code() const;
- String get_fragment_code() const;
- String get_light_code() const;
+ void set_code( const String& p_code);
+ String get_code() const;
void get_param_list(List<PropertyInfo> *p_params) const;
bool has_param(const StringName& p_param) const;
@@ -104,13 +100,13 @@ public:
VARIANT_ENUM_CAST( Shader::Mode );
-class MaterialShader : public Shader {
+class SpatialShader : public Shader {
- OBJ_TYPE(MaterialShader,Shader);
+ OBJ_TYPE(SpatialShader,Shader);
public:
- MaterialShader() : Shader(MODE_MATERIAL) {};
+ SpatialShader() : Shader(MODE_SPATIAL) {};
};
class CanvasItemShader : public Shader {
@@ -123,15 +119,14 @@ public:
};
+class ParticlesShader : public Shader {
+
+ OBJ_TYPE(ParticlesShader,Shader);
-class ResourceFormatLoaderShader : public ResourceFormatLoader {
public:
- virtual RES load(const String &p_path,const String& p_original_path="",Error *r_error=NULL);
- virtual void get_recognized_extensions(List<String> *p_extensions) const;
- virtual bool handles_type(const String& p_type) const;
- virtual String get_resource_type(const String &p_path) const;
-};
+ ParticlesShader() : Shader(MODE_PARTICLES) {};
+};
#endif // SHADER_H