Skip to content

Commit

Permalink
include example
Browse files Browse the repository at this point in the history
  • Loading branch information
coalaura committed Oct 10, 2023
1 parent 6a4d349 commit ca3f0fc
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 8 deletions.
25 changes: 23 additions & 2 deletions CAM/SetCamDofStrength.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,30 @@ ns: CAM
void SET_CAM_DOF_STRENGTH(Cam cam, float dofStrength);
```
Specifies how much the DoF effect should be applied (Set using [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), etc.). Example: https://forum.cfx.re/t/camera-depth-of-field-settings/2433316/3)
Specifies how much the DoF effect should be applied (Set using [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), etc.)
## Parameters
* **cam**: The camera
* **cam**: The camera handle
* **dofStrength**: Depth of Field strength (between 0.0 and 1.0)
## 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
```
25 changes: 23 additions & 2 deletions CAM/SetCamFarDof.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,30 @@ ns: CAM
void SET_CAM_FAR_DOF(Cam cam, float farDOF);
```
Specifies when the camera should stop being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives. (Example: https://forum.cfx.re/t/camera-depth-of-field-settings/2433316/3)
Specifies when the camera should stop being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_NEAR_DOF`](#_0x3FA4BF0A7AB7DE2C), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives.
## Parameters
* **cam**: The camera
* **cam**: The camera handle
* **farDOF**: Distance in in standard units
## 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
```
26 changes: 24 additions & 2 deletions CAM/SetCamNearDof.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,30 @@ ns: CAM
void SET_CAM_NEAR_DOF(Cam cam, float nearDOF);
```
Specifies when the camera should start being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives. (Example: https://forum.cfx.re/t/camera-depth-of-field-settings/2433316/3)
Specifies when the camera should start being in focus. Can be used together with [`SET_USE_HI_DOF`](#_0xA13B0222F3D94A94), [`SET_CAM_FAR_DOF`](#_0xEDD91296CD01AEE0), [`SET_CAM_USE_SHALLOW_DOF_MODE`](#_0x16A96863A17552BB), [`SET_CAM_DOF_STRENGTH`](#_0x5EE29B4D7D5DF897) and other DoF related natives.
## Parameters
* **cam**: The camera
* **cam**: The camera handle
* **nearDOF**: Distance in in standard units
## 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
```
25 changes: 23 additions & 2 deletions CAM/SetCamUseShallowDofMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,30 @@ ns: CAM
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. (Example: https://forum.cfx.re/t/camera-depth-of-field-settings/2433316/3)
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.
## Parameters
* **cam**: The camera
* **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 ca3f0fc

Please sign in to comment.