Skip to content

Commit

Permalink
Update SetCamUseShallowDofMode.md
Browse files Browse the repository at this point in the history
  • Loading branch information
4mmonium authored Nov 16, 2023
1 parent 2f450e2 commit a5d9a6f
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions CAM/SetCamUseShallowDofMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,10 @@ void SET_CAM_USE_SHALLOW_DOF_MODE(Cam cam, BOOL toggle);
Enables or disables the usage of a shallow DOF. Needs to be set to true to use [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), etc. Doesn't need to be called every tick.
### Usage Example
A usage example for this native can be found in the following native documentation: [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897).
## Parameters
* **cam**: The camera handle
* **toggle**: Boolean if the camera should use a shallow depth of field or not
## Examples
```lua
-- Use a shallow depth of field
SetCamUseShallowDofMode(camera, true)
-- Set at what distance your camera should start to focus (Example: 0.7 meters)
SetCamNearDof(camera, 0.7)
-- Set at what distance your camera should stop focusing (Example: 1.3 meters)
SetCamFarDof(camera, 1.3)
-- Apply 100% of the DoF effect
SetCamDofStrength(camera, 1.0)
while DoesCamExist(camera) do
-- Use DoF effect (needs to be called every tick)
SetUseHiDof()
Citizen.Wait(0)
end
```

0 comments on commit a5d9a6f

Please sign in to comment.