GE Lua Documentation

Press F to search!

onAdd

Definition


-- @/lua/ge/client/postFx/dof.lua:426

dOFPostEffectCallbacks.onAdd = function()
  -- The weighted distribution of CoC value to the three blur textures
  -- in the order small, medium, large. Most likely you will not need to
  -- change this value.
  local dofPostEffect = scenetree.findObject("DOFPostEffect")
  if not dofPostEffect then
    return
  end
  -- log('I','dof','DOF onadd called....')
  -- log('I','dof','dof = '..dumps(dof))
  -- log('I','dof','dofPostEffect = '..dumps(dofPostEffect))
  setLerpDist(dofPostEffect, 0.2, 0.3, 0.5)

  -- Fill out some default values but DOF really should not be turned on
  -- without actually specifying your own parameters!
  dofPostEffect.autoFocusEnabled = false
  dofPostEffect.debugModeEnabled = false
  dofPostEffect.focalDist = 0.0
  dofPostEffect.nearBlurMax = 0.5
  dofPostEffect.farBlurMax = 0.5
  dofPostEffect.minRange = 50
  dofPostEffect.maxRange = 500
  dofPostEffect.nearSlope = -5.0
  dofPostEffect.farSlope = 5.0
end

Callers