Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- [configuration]
- [OptionBool]
- GUIName = Smoothing
- OptionName = SmoothToggle
- DefaultValue = true
- [OptionRangeFloat]
- GUIName = Smoothness
- OptionName = Smoothness
- MinValue = 0.0
- MaxValue = 3.0
- StepAmount = 0.05
- DefaultValue = 1.0
- DependantOption = SmoothToggle
- [OptionBool]
- GUIName = Lines
- OptionName = LineToggle
- DefaultValue = true
- [OptionRangeFloat]
- GUIName = Line Thickness
- OptionName = Thick
- MinValue = 2.0
- MaxValue = 3.0
- StepAmount = 0.01
- DefaultValue = 2.0
- DependentOption = LineToggle
- [OptionRangeFloat]
- GUIName = Line Brightness
- OptionName = Bright
- MinValue = 25
- MaxValue = 100
- StepAmount = 1
- DefaultValue = 50
- DependentOption = LineToggle
- [/configuration]
- */
- void main()
- {
- //variables
- float4 c0 = Sample();
- //Smooth
- if (OptionEnabled(SmoothToggle))
- {
- float4 smoothing_total = float4(0.0, 0.0, 0.0, 0.0);
- float smoothing_size = GetOption(Smoothness);
- smoothing_total += SampleLocation(GetCoordinates() + float2(-smoothing_size, -smoothing_size) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2(-smoothing_size, smoothing_size) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2( smoothing_size, -smoothing_size) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2( smoothing_size, smoothing_size) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2(-smoothing_size, 0.0) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2( smoothing_size, 0.0) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2( 0.0, -smoothing_size) * GetInvResolution());
- smoothing_total += SampleLocation(GetCoordinates() + float2( 0.0, smoothing_size) * GetInvResolution());
- smoothing_total *= 0.125;
- c0 = smoothing_total;
- }
- // Horizontal Scanlines
- if (OptionEnabled(LineToggle))
- {
- float vPos = GetCoordinates().y*GetResolution().y / GetOption(Thick);
- float line_intensity = (((vPos - floor(vPos)) * 9) - 4) / GetOption(Bright);
- c0.rgb += line_intensity;
- }
- SetOutput(c0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement