Previous 199869 Revisions Next

r44508 Tuesday 26th January, 2016 at 21:14:41 UTC by Jezze
Cleanup (nw)
[hlsl]ntsc.fx
[src/osd/modules/render/d3d]d3dhlsl.cpp

trunk/hlsl/ntsc.fx
r253019r253020
108108
109109float4 GetCompositeYIQ(float2 TexCoord)
110110{
111   float2 SourceTexelDims = 1.0f / SourceDims;   
111   float2 SourceTexelDims = 1.0f / SourceDims;
112112   float2 SourceRes = SourceDims * SourceRect;
113113
114114   float2 PValueSourceTexel = float2(PValue, 0.0f) * SourceTexelDims;
r253019r253020
131131   float4 I = float4(dot(Texel0, IDot), dot(Texel1, IDot), dot(Texel2, IDot), dot(Texel3, IDot));
132132   float4 Q = float4(dot(Texel0, QDot), dot(Texel1, QDot), dot(Texel2, QDot), dot(Texel3, QDot));
133133
134   float4 W = PI2 * CCValue * ScanTime;
134   float W = PI2 * CCValue * ScanTime;
135   float WoPI = W / PI;
135136
136   float4 T = HPosition
137      + (AValue / 360.0f * SourceRes.y) * VPosition
138      + (BValue / 360.0f)
139      + (SignalOffset / 360.0f);
137   float HOffset = (BValue + SignalOffset) / WoPI;
138   float VScale = (AValue * SourceRes.y) / WoPI;
139
140   float4 T = HPosition + HOffset + VPosition * VScale;
140141   float4 TW = T * W;
141142
142143   float4 CompositeYIQ = Y + I * cos(TW) + Q * sin(TW);
r253019r253020
171172   float PI2Length = PI2 / SampleCount;
172173
173174   float W = PI2 * CCValue * ScanTime;
174   
175   float WoPI = W / PI;
176
177   float HOffset = (BValue + SignalOffset) / WoPI;
178   float VScale = (AValue * SourceRes.y) / WoPI;
179
175180   float4 YAccum = 0.0f;
176181   float4 IAccum = 0.0f;
177182   float4 QAccum = 0.0f;
r253019r253020
190195
191196      float4 C = GetCompositeYIQ(float2(Cx.r, Cy.r));
192197
193      float4 T = HPosition
194         + (AValue / 360.0f * SourceRes.y) * VPosition
195         + (BValue / 360.0f)
196         + (SignalOffset / 360.0f);
197      float4 WT = W * T
198         + OValue;
198      float4 T = HPosition + HOffset + VPosition * VScale;
199      float4 WT = W * T + OValue;
199200
200201      float4 SincKernel = 0.54f + 0.46f * cos(PI2Length * n4);
201202
trunk/src/osd/modules/render/d3d/d3dhlsl.cpp
r253019r253020
990990   deconverge_effect->add_uniform("RadialConvergeY", uniform::UT_VEC3, uniform::CU_CONVERGE_RADIAL_Y);
991991
992992   focus_effect->add_uniform("Defocus", uniform::UT_VEC2, uniform::CU_FOCUS_SIZE);
993   
993
994994   phosphor_effect->add_uniform("Phosphor", uniform::UT_VEC3, uniform::CU_PHOSPHOR_LIFE);
995995
996996   post_effect->add_uniform("VignettingAmount", uniform::UT_FLOAT, uniform::CU_POST_VIGNETTING); // backward compatibility
r253019r253020
12311231   {
12321232      return next_index;
12331233   }
1234   
1234
12351235   float signal_offset = curr_texture->get_cur_frame() == 0
12361236      ? 0.0f
12371237      : options->yiq_jitter;
r253019r253020
12411241   curr_effect = ntsc_effect;
12421242   curr_effect->update_uniforms();
12431243   curr_effect->set_float("SignalOffset", signal_offset);
1244   
1244
12451245   next_index = rt->next_index(next_index);
12461246   blit(rt->native_target[next_index], true, D3DPT_TRIANGLELIST, 0, 2);
12471247
r253019r253020
27782778}
27792779
27802780// static INT32 slider_ntsc_phase_count(running_machine &machine, void *arg, std::string *str, INT32 newval)
2781// {   
2781// {
27822782//    hlsl_options *options = (hlsl_options*)arg;
27832783//    if (newval != SLIDER_NOCHANGE)
27842784//    {
r253019r253020
30663066         break;
30673067      }
30683068      case CU_SOURCE_RECT:
3069      {         
3069      {
30703070         bool prepare_vector =
30713071            d3d->window().machine().first_screen()->screen_type() == SCREEN_TYPE_VECTOR;
30723072
r253019r253020
30763076            m_shader->set_vector("SourceRect", 2, delta);
30773077            break;
30783078         }
3079         
3079
30803080         if (shadersys->curr_texture != NULL)
30813081         {
30823082            vec2f delta = shadersys->curr_texture->get_uvstop() - shadersys->curr_texture->get_uvstart();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team