diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-01-01 22:16:52 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-01 22:16:52 -0300 |
commit | c2a217c3501b8006a3d2cdf2c678e33def15f275 (patch) | |
tree | 9f0b2d128ef5c97d4632e387041079e59c193fd7 /servers/visual | |
parent | a62c99c4e4325ca0c015d731f2bcb9b07410bb65 (diff) |
WIP particle system
Ability to enable and change MSAA settings
Ability to change VCT quality
Ability to enable/disable HDR rendering
Diffstat (limited to 'servers/visual')
-rw-r--r-- | servers/visual/rasterizer.h | 2 | ||||
-rw-r--r-- | servers/visual/shader_types.cpp | 20 | ||||
-rw-r--r-- | servers/visual/visual_server_raster.h | 3 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.cpp | 16 | ||||
-rw-r--r-- | servers/visual/visual_server_viewport.h | 3 |
5 files changed, 43 insertions, 1 deletions
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h index 7452985522..7c6f6111c2 100644 --- a/servers/visual/rasterizer.h +++ b/servers/visual/rasterizer.h @@ -484,6 +484,7 @@ public: RENDER_TARGET_TRANSPARENT, RENDER_TARGET_NO_3D, RENDER_TARGET_NO_SAMPLING, + RENDER_TARGET_HDR, RENDER_TARGET_FLAG_MAX }; @@ -492,6 +493,7 @@ public: virtual RID render_target_get_texture(RID p_render_target) const=0; virtual void render_target_set_flag(RID p_render_target,RenderTargetFlags p_flag,bool p_value)=0; virtual bool render_target_renedered_in_frame(RID p_render_target)=0; + virtual void render_target_set_msaa(RID p_render_target,VS::ViewportMSAA p_msaa)=0; /* CANVAS SHADOW */ diff --git a/servers/visual/shader_types.cpp b/servers/visual/shader_types.cpp index 4872135e2a..0eb3e0fc5a 100644 --- a/servers/visual/shader_types.cpp +++ b/servers/visual/shader_types.cpp @@ -156,7 +156,25 @@ ShaderTypes::ShaderTypes() shader_modes[VS::SHADER_CANVAS_ITEM].modes.insert("light_only"); - + /************ PARTICLES **************************/ + + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["COLOR"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["VELOCITY"]=ShaderLanguage::TYPE_VEC3; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["MASS"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["ACTIVE"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["RESTART"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["CUSTOM"]=ShaderLanguage::TYPE_VEC4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TRANSFORM"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["TIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["LIFETIME"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["DELTA"]=ShaderLanguage::TYPE_FLOAT; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["SEED"]=ShaderLanguage::TYPE_BOOL; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["ORIGIN"]=ShaderLanguage::TYPE_MAT4; + shader_modes[VS::SHADER_PARTICLES].functions["vertex"]["INDEX"]=ShaderLanguage::TYPE_INT; + + shader_modes[VS::SHADER_PARTICLES].modes.insert("billboard"); + shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_force"); + shader_modes[VS::SHADER_PARTICLES].modes.insert("disable_velocity"); diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h index e67c140b2d..300924e3b2 100644 --- a/servers/visual/visual_server_raster.h +++ b/servers/visual/visual_server_raster.h @@ -919,6 +919,9 @@ public: BIND3(viewport_set_canvas_layer,RID ,RID ,int ) BIND2(viewport_set_shadow_atlas_size,RID ,int ) BIND3(viewport_set_shadow_atlas_quadrant_subdivision,RID ,int, int ) + BIND2(viewport_set_msaa,RID ,ViewportMSAA ) + BIND2(viewport_set_hdr,RID ,bool ) + /* ENVIRONMENT API */ diff --git a/servers/visual/visual_server_viewport.cpp b/servers/visual/visual_server_viewport.cpp index fa2c461f36..558a3e4c23 100644 --- a/servers/visual/visual_server_viewport.cpp +++ b/servers/visual/visual_server_viewport.cpp @@ -517,6 +517,22 @@ void VisualServerViewport::viewport_set_shadow_atlas_quadrant_subdivision(RID p_ } +void VisualServerViewport::viewport_set_msaa(RID p_viewport,VS::ViewportMSAA p_msaa) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_msaa(viewport->render_target,p_msaa); +} + +void VisualServerViewport::viewport_set_hdr(RID p_viewport,bool p_enabled) { + + Viewport * viewport = viewport_owner.getornull(p_viewport); + ERR_FAIL_COND(!viewport); + + VSG::storage->render_target_set_flag(viewport->render_target,RasterizerStorage::RENDER_TARGET_HDR,p_enabled); + +} bool VisualServerViewport::free(RID p_rid) { diff --git a/servers/visual/visual_server_viewport.h b/servers/visual/visual_server_viewport.h index 2eb0ea4679..3b14ee2b1c 100644 --- a/servers/visual/visual_server_viewport.h +++ b/servers/visual/visual_server_viewport.h @@ -137,6 +137,9 @@ public: void viewport_set_shadow_atlas_size(RID p_viewport,int p_size); void viewport_set_shadow_atlas_quadrant_subdivision(RID p_viewport,int p_quadrant,int p_subdiv); + void viewport_set_msaa(RID p_viewport,VS::ViewportMSAA p_msaa); + void viewport_set_hdr(RID p_viewport,bool p_enabled); + void draw_viewports(); bool free(RID p_rid); |