pass_template:
    samplerstates:
        SamplerLinear:
            filter: MIN_MAG_MIP_LINEAR
            addressU: CLAMP
            addressV: CLAMP
        SamplerPoint:
            filter: MIN_MAG_MIP_POINT
            addressU: CLAMP
            addressV: CLAMP
    type: RGBA8_uint
    constant-buffers:
        globalParams: {screenSize: SCREEN_SIZE, captureState: CAPTURE_STATE, tileUV: TILE_UV_RANGE, isDepthAvailable: BUFREADY_DEPTH}
        controlBuf: {ui_fFocusDepth: focusSlider, ui_fFarBlurCurve : farblurcurveSlider, ui_fFarBlurMult : farbluramountSlider, ui_fNearBlurCurve : nearblurcurveSlider, ui_fNearBlurMult : nearbluramountSlider, ui_fShapeRadius : blurradiusSlider, ui_iShapeVertices : verticesSlider, ui_fShapeRoundness : shaperoundnessSlider, ui_fBokehIntensity : bokehintensitySlider}

normalrange_slider:
      type: float
      ui-control: slider
      minimum-value: 0.0
      maximum-value: 1.0
      default-value: 0.5
      step: 0.01

shape_slider:
      type: float
      ui-control: slider
      minimum-value: 5.0
      maximum-value: 25.0
      default-value: 8.0
      ui-value-min: 1.0
      ui-value-max: 25.0
      step: 1.0

user-constants:
    - name: focusSlider
      ui-hint: "Use this to set the focus plane distance of the DoF effect."
      ui-label: "Focus depth"
      ui-label-localized:
        ru-RU: "Глубина фокуса"
        fr-FR: "Profondeur de champ"
        it-IT: "Profondità focus"
        de-DE: "Schärfentiefe"
        es-ES: "Profundidad de foco"
        es-MX: "Profundidad de campo"
        zh-CHT: "焦深"
        zh-CHS: "焦点深度"
        ja-JP: "焦点深度"
        cs-CZ: "Hloubka ostrosti"
        da-DK: "Fokusdybde"
        el-GR: "Εστίαση βάθους"
        en-UK: "Focus depth"
        fi-FI: "Tarkennuksen syyvys"
        hu: "Mélységélesség"
        nl-NL: "Scherpte-diepte"
        nb-NO: "Fokusdybde"
        pl: "Głębia ostrości"
        pt-PT: "Profundidade de focagem"
        pt-BR: "Profundidade de foco"
        sl-SI: "Globinska ostrina"
        sk-SK: "Hĺbka zaostrenia"
        sv-SE: "Fokusdjup"
        th-TH: "ความลึกของโฟกัส"
        tr-TR: "Odak derinliği"
        ko-KR: "초점 심도"
      type: float
      ui-control: slider
      minimum-value: 0.01
      maximum-value: 1.0
      default-value: 0.33
      ui-sticky-region: 0.01
      ui-value-unit: "%"
      ui-value-min: 0
      ui-value-max: 100
      step: 0.01
    - name: farblurcurveSlider
      ui-hint: "Curve of blur behind focus plane."
      ui-label: "Far blur curve"
      ui-label-localized:
        ru-RU: "Кривая вдали"
        fr-FR: "Courbe de flou distant"
        it-IT: "Curva sfocatura lontano"
        de-DE: "Hintergrundunschärfe – Kurve"
        es-ES: "Curva de desenfoque de fondo"
        es-MX: "Curva de desenfoque lejano"
        zh-CHT: "遠景模糊曲線"
        zh-CHS: "远模糊曲线"
        ja-JP: "後景のブレのカーブ"
        cs-CZ: "Křivka rozostření vzdálených objektů"
        da-DK: "Sløringskurve på lang afstand"
        el-GR: "Καμπύλη θαμπώματος μακρινού πεδίου"
        en-UK: "Far blur curve"
        fi-FI: "Taustasumennuksen käyrä"
        hu: "Távoli életlenségi görbe"
        nl-NL: "Curve vervagen veraf"
        nb-NO: "Uskarphetskurve på lang avstand"
        pl: "Krzywa rozmycia w polu dalekim"
        pt-PT: "Curvatura de desfocagem distante"
        pt-BR: "Curva de desfoque distante"
        sl-SI: "Krivulja zameglitve oddaljenih predmetov"
        sk-SK: "Krivka rozmazania pozadia"
        sv-SE: "Kurva för oskärpa på långt håll"
        th-TH: "เส้นโค้งความเบลอที่ระยะไกล"
        tr-TR: "Uzak bulanıklık eğrisi"
        ko-KR: "원경 블러 곡선"
      type: float
      ui-control: slider
      minimum-value: 0.5
      maximum-value: 5.0
      default-value: 1.5
    - name: farbluramountSlider
      ui-hint: "Amount of blur behind focus plane."
      ui-label: "Far blur amount"
      ui-label-localized:
        ru-RU: "Размытие вдали"
        fr-FR: "Niveau de flou distant"
        it-IT: "Quantità sfocatura lontano"
        de-DE: "Hintergrundunschärfe – Menge"
        es-ES: "Cantidad de desenfoque de fondo"
        es-MX: "Cantidad de desenfoque lejano"
        zh-CHT: "遠景模糊程度"
        zh-CHS: "远模糊量"
        ja-JP: "後景のブレ量"
        cs-CZ: "Míra rozostření vzdálených objektů"
        da-DK: "Sløringsmængde på lang afstand"
        el-GR: "Ποσότητα θαμπώματος μακρινού πεδίου"
        en-UK: "Far blur amount"
        fi-FI: "Taustasumennuksen määrä"
        hu: "Távoli életlenség mértéke"
        nl-NL: "Hoeveelheid vervagen veraf"
        nb-NO: "Uskarphetsmengde på lang avstand"
        pl: "Siła rozmycia w polu dalekim"
        pt-PT: "Valor de desfocagem distante"
        pt-BR: "Quantidade de desfoque distante"
        sl-SI: "Količina zameglitve oddaljenih predmetov"
        sk-SK: "Intenzita rozmazania pozadia"
        sv-SE: "Mängd oskärpa på långt håll"
        th-TH: "จำนวนความเบลอที่ระยะไกล"
        tr-TR: "Uzak bulanıklık miktarı"
        ko-KR: "원경 블러 양"
      type: float
      ui-control: slider
      minimum-value: 0.0
      maximum-value: 1.0
      default-value: 1.0
      ui-sticky-region: 0.01
      ui-value-unit: "%"
      ui-value-min: 0
      ui-value-max: 100
      step: 0.01
    - name: nearblurcurveSlider
      ui-hint: "Curve of blur closer than focus plane."
      ui-label: "Near blur curve"
      ui-label-localized:
        ru-RU: "Кривая вблизи"
        fr-FR: "Courbe de flou rapproché"
        it-IT: "Curva sfocatura vicino"
        de-DE: "Vordergrundunschärfe – Kurve"
        es-ES: "Curva de desenfoque de primer plano"
        es-MX: "Curva de desenfoque cercano"
        zh-CHT: "近景模糊曲線"
        zh-CHS: "近模糊曲线"
        ja-JP: "前景のブレのカーブ"
        cs-CZ: "Křivka rozostření blízkých objektů"
        da-DK: "Sløringskurve på kort afstand"
        el-GR: "Καμπύλη θαμπώματος κοντινού πεδίου"
        en-UK: "Near blur curve"
        fi-FI: "Lähisumennuksen käyrä"
        hu: "Közeli életlenség görbéje"
        nl-NL: "Curve vervagen dichtbij"
        nb-NO: "Uskarphetskurve på kort avstand"
        pl: "Krzywa rozmycia w polu bliskim"
        pt-PT: "Curvatura de desfocagem próxima"
        pt-BR: "Curva de desfoque próximo"
        sl-SI: "Krivulja zameglitve bližnjih predmetov"
        sk-SK: "Krivka rozmazania popredia"
        sv-SE: "Kurva för oskärpa på nära håll"
        th-TH: "เส้นโค้งความเบลอที่ระยะใกล้"
        tr-TR: "Yakın bulanıklık eğrisi"
        ko-KR: "근경 블러 곡선"        
      type: float
      ui-control: slider
      minimum-value: 0.5
      maximum-value: 5.0
      default-value: 1.5
      ui-sticky-region: 0.01
      step: 0.01
    - name: nearbluramountSlider
      ui-hint: "Amount of blur closer than focus plane."
      ui-label: "Near blur amount"
      ui-label-localized:
        ru-RU: "Размытие вблизи"
        fr-FR: "Niveau de flou rapproché"
        it-IT: "Quantità sfocatura vicino"
        de-DE: "Vordergrundunschärfe – Menge"
        es-ES: "Cantidad de desenfoque de primer plano"
        es-MX: "Cantidad de desenfoque cercano"
        zh-CHT: "近景模糊程度"
        zh-CHS: "近模糊量"
        ja-JP: "前景のブレ量"
        cs-CZ: "Míra rozostření blízkých objektů"
        da-DK: "Sløringsmængde på kort afstand"
        el-GR: "Ποσότητα θαμπώματος κοντινού πεδίου"
        en-UK: "Near blur amount"
        fi-FI: "Lähisumennuksen määrä"
        hu: "Közeli életlenség mértéke"
        nl-NL: "Hoeveelheid vervagen dichtbij"
        nb-NO: "Uskarphetsmengde på kort avstand"
        pl: "Siła rozmycia w polu bliskim"
        pt-PT: "Valor de desfocagem próxima"
        pt-BR: "Quantidade de desfoque próximo"
        sl-SI: "Količina zameglitve bližnjih predmetov"
        sk-SK: "Intenzita rozmazania popredia"
        sv-SE: "Mängd oskärpa på nära håll"
        th-TH: "จำนวนความเบลอที่ระยะใกล้"
        tr-TR: "Yakın bulanıklık miktarı"
        ko-KR: "근경 블러 양"
      type: float
      ui-control: slider
      minimum-value: 0.0
      maximum-value: 1.0
      default-value: 0.0
      ui-sticky-region: 0.01
      ui-value-unit: "%"
      ui-value-min: 0
      ui-value-max: 100
      step: 0.01
    - name: blurradiusSlider
      ui-hint: "Maximal blur radius."
      ui-label: "Blur radius"
      ui-label-localized:
        ru-RU: "Радиус размытия"
        fr-FR: "Rayon de flou"
        it-IT: "Raggio sfocatura"
        de-DE: "Unschärfe – Radius"
        es-ES: "Radio de desenfoque"
        es-MX: "Radio de desenfoque"
        zh-CHT: "模糊半徑"
        zh-CHS: "模糊半径"
        ja-JP: "ブレの範囲"
        cs-CZ: "Poloměr rozostření"
        da-DK: "Sløringsradius"
        el-GR: "Ακτίνα θαμπώματος"
        en-UK: "Blur radius"
        fi-FI: "Sumennussäde"
        hu: "Életlenség sugara"
        nl-NL: "Vervagingsstatus"
        nb-NO: "Uskarphetsradius"
        pl: "Promień rozmycia"
        pt-PT: "Raio de desfocagem"
        pt-BR: "Raio de desfoque"
        sl-SI: "Polmer zameglitve"
        sk-SK: "Polomer rozmazania"
        sv-SE: "Oskärpans radie"
        th-TH: "รัศมีความเบลอ"
        tr-TR: "Bulanıklık yarıçapı"
        ko-KR: "블러 반경"
      type: float
      ui-control: slider
      minimum-value: 0.0
      maximum-value: 25.0
      default-value: 10.0
      ui-sticky-region: 0.01
      step: 0.1
    - name: verticesSlider
      ui-hint: "Vertices of bokeh blur, 5 = pentagonal bokeh, 6 = hexagonal etc."
      ui-label: "Bokeh vertices"
      ui-label-localized:
        ru-RU: "Вершины боке"
        fr-FR: "Sommet de bokeh"
        it-IT: "Vertici Bokeh"
        de-DE: "Bokeh – Scheitelpunkte"
        es-ES: "Vértices de bokeh"
        es-MX: "Vértices de bokeh"
        zh-CHT: "散景頂點"
        zh-CHS: "散景顶点"
        ja-JP: "ボケの頂点"
        cs-CZ: "Vrcholy bokehu"
        da-DK: "Bokeh-punkter"
        el-GR: "Κορυφές μποκέ"
        en-UK: "Bokeh vertices"
        fi-FI: "Bokeh-verteksit"
        hu: "Bokeh csúcspontok"
        nl-NL: "Bokeh-hoekpunten"
        nb-NO: "Bokeh-punkter"
        pl: "Wierzchołki Bokeh"
        pt-PT: "Vértices do bokeh"
        pt-BR: "Vértices do Bokeh"
        sl-SI: "Vrtinci bokeja"
        sk-SK: "Vrcholy rozostrenia"
        sv-SE: "Bokeh-punkter"
        th-TH: "จุดยอดของการเบลอแสงแบบโบเก้"
        tr-TR: "Bokeh tepe noktaları"
        ko-KR: "보케 정점"
      type: float
      ui-control: slider
      minimum-value: 3.0
      maximum-value: 9.0
      default-value: 5.0
    - name: shaperoundnessSlider
      ui-hint: "Roundness of bokeh shape. 1.0 = circle, 0.0 = polygon. Hint: Raise vertices if you want good circular bokeh."
      ui-label: "Bokeh roundness"
      ui-label-localized:
        ru-RU: "Округлость боке"
        fr-FR: "Rondeur de bokeh"
        it-IT: "Rotondità Bokeh"
        de-DE: "Bokeh – Rundung"
        es-ES: "Redondez de bokeh"
        es-MX: "Redondez de bokeh"
        zh-CHT: "散景圓度"
        zh-CHS: "散景圆度"
        ja-JP: "ボケの丸み"
        cs-CZ: "Kulatost bokehu"
        da-DK: "Bokeh-rundhed"
        el-GR: "Στρογγυλότητα μποκέ"
        en-UK: "Bokeh roundness"
        fi-FI: "Bokeh-pyöreys"
        hu: "Bokeh kerekség"
        nl-NL: "Bokeh-afronding"
        nb-NO: "Bokeh-rundhet"
        pl: "Zaokrąglenie Bokeh"
        pt-PT: "Circularidade do bokeh"
        pt-BR: "Circularidade do Bokeh"
        sl-SI: "Zaobljenost bokeja"
        sk-SK: "Okrúhlosť rozostrenia"
        sv-SE: "Bokeh-rundhet"
        th-TH: "ความกลมของการเบลอแสงแบบโบเก้"
        tr-TR: "Bokeh yuvarlaklığı"
        ko-KR: "보케 둥긂"
      type: float
      ui-control: slider
      minimum-value: 0.0
      maximum-value: 1.0
      default-value: 0.0
      ui-sticky-region: 0.01
      ui-value-unit: "%"
      ui-value-min: 0
      ui-value-max: 100
      step: 0.01
    - name: bokehintensitySlider
      ui-hint: "Intensity of bokeh effect."
      ui-label: "Bokeh intensity"
      ui-label-localized:
        ru-RU: "Интенсивность размытия"
        fr-FR: "Intensité de bokeh"
        it-IT: "Intensità Bokeh"
        de-DE: "Bokeh – Intensität"
        es-ES: "Intensidad de bokeh"
        es-MX: "Intensidad de bokeh"
        zh-CHT: "散景強度"
        zh-CHS: "散景强度"
        ja-JP: "ボケの度合い"
        cs-CZ: "Intenzita bokehu"
        da-DK: "Bokeh-intensitet"
        el-GR: "Ένταση μποκέ"
        en-UK: "Bokeh intensity"
        fi-FI: "Bokeh-intensiteetti"
        hu: "Bokeh intenzitás"
        nl-NL: "Bokeh-intensiteit"
        nb-NO: "Bokeh-intensitet"
        pl: "Intensywność Bokeh"
        pt-PT: "Intensidade do bokeh"
        pt-BR: "Intensidade do Bokeh"
        sl-SI: "Intenzivnost bokeja"
        sk-SK: "Intenzita rozostrenia"
        sv-SE: "Bokeh-intensitet"
        th-TH: "ความเข้มของการเบลอแสงแบบโบเก้"
        tr-TR: "Bokeh yoğunluğu"
        ko-KR: "보케 강도"        
      type: float
      ui-control: slider
      minimum-value: 1.0
      maximum-value: 8.0
      default-value: 4.0
      ui-sticky-region: 0.01
      step: 0.01

coc2alpha:
    import: [pass_template]
    shader: PS_CoC2Alpha@DOF.yfx
    textures:
        texOriginalColor:
            channel: PIPE_INPUTS_COLOR
        texOriginalDepth:
            channel: PIPE_INPUTS_DEPTH

bokeh:
    import: [pass_template]
    shader: PS_Bokeh@DOF.yfx
    textures:
        texColorCoC:
            import: [coc2alpha]

main:
    import: [pass_template]
    shader: PS_Gauss@DOF.yfx
    textures:
        texOriginalColor:
            channel: PIPE_INPUTS_COLOR
        texColorCoC:
            import: [bokeh]
