diff options
author | 2016-03-28 20:19:01 +0200 | |
---|---|---|
committer | 2016-03-28 20:19:01 +0200 | |
commit | fe9dfdbf991ead01d9ff63042532cc82440de7a5 (patch) | |
tree | 89a842c4573bf96a17965100daf5537b8cc9d073 /src/osd/modules/render/d3d | |
parent | 839718373d2269d7f0e258d170595cd5c3740195 (diff) |
Refactored Bloom
- reduced raster bloom level to 8
- extended vector bloom level to 15
- changed vector bloom to be less blocky
- removed bloom_lvl9_weight and bloom_lvl10_weight options
Diffstat (limited to 'src/osd/modules/render/d3d')
-rw-r--r-- | src/osd/modules/render/d3d/d3dcomm.h | 12 | ||||
-rw-r--r-- | src/osd/modules/render/d3d/d3dhlsl.cpp | 61 | ||||
-rw-r--r-- | src/osd/modules/render/d3d/d3dhlsl.h | 2 |
3 files changed, 23 insertions, 52 deletions
diff --git a/src/osd/modules/render/d3d/d3dcomm.h b/src/osd/modules/render/d3d/d3dcomm.h index 51758bb70b6..3d84ea567a3 100644 --- a/src/osd/modules/render/d3d/d3dcomm.h +++ b/src/osd/modules/render/d3d/d3dcomm.h @@ -10,6 +10,12 @@ #define __WIN_D3DCOMM__ //============================================================ +// CONSTANTS +//============================================================ + +#define MAX_BLOOM_COUNT 15 // shader model 3.0 support up to 16 samplers, but we need the last for the original texture + +//============================================================ // FORWARD DECLARATIONS //============================================================ @@ -292,10 +298,10 @@ public: d3d_render_target *next; d3d_render_target *prev; - surface *bloom_surface[11]; - texture *bloom_texture[11]; + surface *bloom_surface[MAX_BLOOM_COUNT]; + texture *bloom_texture[MAX_BLOOM_COUNT]; - float bloom_dims[11][2]; + float bloom_dims[MAX_BLOOM_COUNT][2]; int bloom_count; }; diff --git a/src/osd/modules/render/d3d/d3dhlsl.cpp b/src/osd/modules/render/d3d/d3dhlsl.cpp index 9d22e045b91..ca2c29078da 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.cpp +++ b/src/osd/modules/render/d3d/d3dhlsl.cpp @@ -739,8 +739,6 @@ void shaders::init(d3d_base *d3dintf, running_machine *machine, renderer_d3d9 *r options->bloom_level6_weight = winoptions.screen_bloom_lvl6_weight(); options->bloom_level7_weight = winoptions.screen_bloom_lvl7_weight(); options->bloom_level8_weight = winoptions.screen_bloom_lvl8_weight(); - options->bloom_level9_weight = winoptions.screen_bloom_lvl9_weight(); - options->bloom_level10_weight = winoptions.screen_bloom_lvl10_weight(); options->params_init = true; } @@ -1460,59 +1458,34 @@ int shaders::bloom_pass(d3d_render_target *rt, int source_index, poly_info *poly return next_index; } - float weight12[2] = { - options->bloom_level1_weight, - options->bloom_level2_weight - }; - float weight34[2] = { - options->bloom_level3_weight, - options->bloom_level4_weight - }; - float weight56[2] = { - options->bloom_level5_weight, - options->bloom_level6_weight, - }; - float weight78[2] = { - options->bloom_level7_weight, - options->bloom_level8_weight - }; - float weight9A[2] = { - options->bloom_level9_weight, - options->bloom_level10_weight - }; - curr_effect = bloom_effect; curr_effect->update_uniforms(); - curr_effect->set_float ("Level0Weight", options->bloom_level0_weight); - curr_effect->set_vector("Level12Weight", 2, weight12); - curr_effect->set_vector("Level34Weight", 2, weight34); - curr_effect->set_vector("Level56Weight", 2, weight56); - curr_effect->set_vector("Level78Weight", 2, weight78); - curr_effect->set_vector("Level9AWeight", 2, weight9A); - - curr_effect->set_vector("Level0Size", 2, rt->bloom_dims[0]); - curr_effect->set_vector("Level12Size", 4, rt->bloom_dims[1]); - curr_effect->set_vector("Level34Size", 4, rt->bloom_dims[3]); - curr_effect->set_vector("Level56Size", 4, rt->bloom_dims[5]); - curr_effect->set_vector("Level78Size", 4, rt->bloom_dims[7]); - curr_effect->set_vector("Level9ASize", 4, rt->bloom_dims[9]); + curr_effect->set_float("Level0Weight", options->bloom_level0_weight); + curr_effect->set_float("Level1Weight", options->bloom_level1_weight); + curr_effect->set_float("Level2Weight", options->bloom_level2_weight); + curr_effect->set_float("Level3Weight", options->bloom_level3_weight); + curr_effect->set_float("Level4Weight", options->bloom_level4_weight); + curr_effect->set_float("Level5Weight", options->bloom_level5_weight); + curr_effect->set_float("Level6Weight", options->bloom_level6_weight); + curr_effect->set_float("Level7Weight", options->bloom_level7_weight); + curr_effect->set_float("Level8Weight", options->bloom_level8_weight); curr_effect->set_int("BloomBlendMode", options->bloom_blend_mode); curr_effect->set_float("BloomScale", options->bloom_scale); curr_effect->set_vector("BloomOverdrive", 3, options->bloom_overdrive); - curr_effect->set_texture("DiffuseA", rt->target_texture[next_index]); + curr_effect->set_texture("DiffuseTexture", rt->target_texture[next_index]); - char name[9] = "Diffuse*"; + char name[14] = "BloomTexture*"; for (int index = 1; index < rt->bloom_count; index++) { - name[7] = 'A' + index; + name[12] = 'A' + index - 1; curr_effect->set_texture(name, rt->bloom_texture[index - 1]); } - for (int index = rt->bloom_count; index < 11; index++) + for (int index = rt->bloom_count; index < MAX_BLOOM_COUNT; index++) { - name[7] = 'A' + index; + name[12] = 'A' + index - 1; curr_effect->set_texture(name, black_texture); } @@ -2315,8 +2288,6 @@ enum slider_option SLIDER_BLOOM_LVL6_SCALE, SLIDER_BLOOM_LVL7_SCALE, SLIDER_BLOOM_LVL8_SCALE, - SLIDER_BLOOM_LVL9_SCALE, - SLIDER_BLOOM_LVL10_SCALE, SLIDER_NTSC_ENABLE, SLIDER_NTSC_JITTER, SLIDER_NTSC_A_VALUE, @@ -2392,8 +2363,6 @@ slider_desc shaders::s_sliders[] = { "Bloom Level 6 Scale", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_ANY, SLIDER_BLOOM_LVL6_SCALE, 0.01f, "%1.2f", {} }, { "Bloom Level 7 Scale", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_ANY, SLIDER_BLOOM_LVL7_SCALE, 0.01f, "%1.2f", {} }, { "Bloom Level 8 Scale", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_ANY, SLIDER_BLOOM_LVL8_SCALE, 0.01f, "%1.2f", {} }, - { "Bloom Level 9 Scale", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_ANY, SLIDER_BLOOM_LVL9_SCALE, 0.01f, "%1.2f", {} }, - { "Bloom Level 10 Scale", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_ANY, SLIDER_BLOOM_LVL10_SCALE, 0.01f, "%1.2f", {} }, { "NTSC processing", 0, 0, 1, 1, SLIDER_INT_ENUM, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, SLIDER_NTSC_ENABLE, 0, "%s", { "Off", "On" } }, { "Signal Jitter", 0, 0, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, SLIDER_NTSC_JITTER, 0.01f, "%1.2f", {} }, { "A Value", -100, 50, 100, 1, SLIDER_FLOAT, SLIDER_SCREEN_TYPE_LCD_OR_RASTER, SLIDER_NTSC_A_VALUE, 0.01f, "%1.2f", {} }, @@ -2467,8 +2436,6 @@ void *shaders::get_slider_option(int id, int index) case SLIDER_BLOOM_LVL6_SCALE: return &(options->bloom_level6_weight); case SLIDER_BLOOM_LVL7_SCALE: return &(options->bloom_level7_weight); case SLIDER_BLOOM_LVL8_SCALE: return &(options->bloom_level8_weight); - case SLIDER_BLOOM_LVL9_SCALE: return &(options->bloom_level9_weight); - case SLIDER_BLOOM_LVL10_SCALE: return &(options->bloom_level10_weight); case SLIDER_NTSC_ENABLE: return &(options->yiq_enable); case SLIDER_NTSC_JITTER: return &(options->yiq_jitter); case SLIDER_NTSC_A_VALUE: return &(options->yiq_a); diff --git a/src/osd/modules/render/d3d/d3dhlsl.h b/src/osd/modules/render/d3d/d3dhlsl.h index a4c9f13b9ed..af5db351efe 100644 --- a/src/osd/modules/render/d3d/d3dhlsl.h +++ b/src/osd/modules/render/d3d/d3dhlsl.h @@ -260,8 +260,6 @@ struct hlsl_options float bloom_level6_weight; float bloom_level7_weight; float bloom_level8_weight; - float bloom_level9_weight; - float bloom_level10_weight; }; struct slider_desc |