Camera Depth of field settings

19 May 2016 23:29 #9643
someone know how to change the settings of dof with the Api? I want to change the distance or the rear with a js call, but the Api doc doesnt explain how to change those settings.
20 May 2016 10:44 #9652

This can be changed via set_dof_params method:

var m_scenes = require("scenes")
m_scenes.set_dof_params({"dof_rear": 1})

This function takes a single argument - the "DOFParams" object. It can contain the following fields:

    dof_on: true,
    dof_distance: 4,
    dof_front: 4,
    dof_rear: 10,
    dof_power: 2 

Now, I see that the detailed description of the parameter is missing in our api documentation. Thanks for pointing this out, we'll fix it in the near future.

Blend4Web Team
Please register or log in to leave a reply.