Esempio n. 1
0
def playerFader():
    """This method creates and returns a post-process effect that fades
    out the player when they get too close to the camera.
    This effect only works in the client, as there is no player in the tools."""
    backBufferCopy = rt('PostProcessing/backBufferCopy')
    e = Effect()
    e.name = 'Player Fader'
    try:
        from _PostProcessing import PlayerFader
        p = PlayerFader()
    except:
        p = None

    if p is not None:
        c = buildBackBufferCopyPhase(backBufferCopy)
        p.renderTarget = backBufferCopy
        p.clearRenderTarget = False
        p.name = 'Player Fader'
        t = buildTransferPhase(backBufferCopy.texture, BW_BLEND_SRCALPHA, BW_BLEND_INVSRCALPHA)
        t.material.alphaOverdrive = 255.0
        t.material.alpha = p.opacity
        t.material.alphaTestEnable = True
        t.material.alphaReference = 1
        e.bypass = p.opacity
        e.phases = [c, p, t]
    else:
        e.phases = []
    return e
Esempio n. 2
0
def playerFader():
    """This method creates and returns a post-process effect that fades
    out the player when they get too close to the camera.
    This effect only works in the client, as there is no player in the tools."""
    backBufferCopy = rt('PostProcessing/backBufferCopy')
    e = Effect()
    e.name = 'Player Fader'
    try:
        from _PostProcessing import PlayerFader
        p = PlayerFader()
    except:
        p = None

    if p is not None:
        c = buildBackBufferCopyPhase(backBufferCopy)
        p.renderTarget = backBufferCopy
        p.clearRenderTarget = False
        p.name = 'Player Fader'
        t = buildTransferPhase(backBufferCopy.texture, BW_BLEND_SRCALPHA,
                               BW_BLEND_INVSRCALPHA)
        t.material.alphaOverdrive = 255.0
        t.material.alpha = p.opacity
        t.material.alphaTestEnable = True
        t.material.alphaReference = 1
        e.bypass = p.opacity
        e.phases = [c, p, t]
    else:
        e.phases = []
    return e
Esempio n. 3
0
def shimmer():
    """This method creates and returns a post-process effect that emulates
    heat shimmer.  It uses the mask created by shimmer objects (those that
    use the shimmer channel, and output alpha)."""
    backBufferCopy = rt('PostProcessing/backBufferCopy')
    e = Effect()
    c = pre = buildBackBufferCopyPhase(backBufferCopy)
    p = buildPhase(backBufferCopy.texture, None, 'shaders/post_processing/heat_shimmer.fx')
    p.name = 'heat shimmer'
    p.filterQuad = VisualTransferMesh('system/models/fx_shimmer_transfer.visual')
    e.phases = [c, p]
    e.name = 'Heat Shimmer'
    e.bypass = Math.Vector4Combiner()
    e.bypass.a = Math.Vector4(0, 0, 0, 0)
    e.bypass.b = BigWorld.PyShimmerCountProvider()
    return e
Esempio n. 4
0
def shimmer():
    """This method creates and returns a post-process effect that emulates
    heat shimmer.  It uses the mask created by shimmer objects (those that
    use the shimmer channel, and output alpha)."""
    backBufferCopy = rt('PostProcessing/backBufferCopy')
    e = Effect()
    c = pre = buildBackBufferCopyPhase(backBufferCopy)
    p = buildPhase(backBufferCopy.texture, None,
                   'shaders/post_processing/heat_shimmer.fx')
    p.name = 'heat shimmer'
    p.filterQuad = VisualTransferMesh(
        'system/models/fx_shimmer_transfer.visual')
    e.phases = [c, p]
    e.name = 'Heat Shimmer'
    e.bypass = Math.Vector4Combiner()
    e.bypass.a = Math.Vector4(0, 0, 0, 0)
    e.bypass.b = BigWorld.PyShimmerCountProvider()
    return e
Esempio n. 5
0
def registrationTest():
    """This method creates and returns an effect that tests
    whether or not the transfer registration is correct.  It
    copies the back buffer and transfers it back over itself
    a few times in order to see if any pixels are shifted. In
    theory this should produce no visual effect at all"""
    c = buildBackBufferCopyPhase(backBufferCopy)
    t = buildTransferPhase(backBufferCopy.texture)
    e = Effect()
    e.name = 'Test Registration'
    phases = [c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t,
     c,
     t]
    e.phases = phases
    import Math
    e.bypass = Math.Vector4LFO()
    e.bypass.period = 2.0
    e.bypass.waveform = 'SQUARE'
    return e