Cam::setDofMaxNearInFocusDistanceBlendLevel: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with " {{ClientsideJsFunction}} {{JSContainer| ===Required Params=== *'''camera:''' {{RageType|number}} *'''p1:''' {{RageType|number}} ===Return value=== *''' {{RageType|void}} ''' ==Syntax== <syntaxhighlight lang="javascript"> mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera, p1) </syntaxhighlight> ==Example== <syntaxhighlight lang="javascript"> //todo </syntaxhighlight> }} ==See also== {{Cam_functions_c}} Category:Clientside API Category:TODO: Example")
 
No edit summary
 
Line 1: Line 1:
{{ClientsideJsFunction}}
{{ClientsideJsFunction}}
{{JSContainer|
{{JSContainer|


===Required Params===
This function sets the blend level for the maximum near focus distance in the camera's depth of field (DOF) settings, providing smoother transitions for objects near the camera. Adjusting this parameter allows you to refine the near-focus blur effect, useful in creating a cinematic depth of field look.
*'''camera:''' {{RageType|number}}
 
*'''p1:''' {{RageType|number}}
== Required Params ==
*'''camera:''' {{RageType|number}} — The camera handle.
*'''p1:''' {{RageType|number}} — Blend level for near focus; typical range is from 0 to 1.


===Return value===
== Return value ==
*''' {{RageType|void}} '''
*{{RageType|void}}


==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera, p1)
mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera, p1);
</syntaxhighlight>
</syntaxhighlight>


==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
//todo
// Create a new camera and set DOF blend level for near focus
const camera = mp.cameras.new("default", new mp.Vector3(0, 0, 10), new mp.Vector3(0, 0, 0), 40);
camera.setActive(true);
mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera.handle, 0.5); // Set blend level to 0.5 for smooth near-focus transition
mp.game.cam.renderScriptCams(true, false, 0, true, false);
</syntaxhighlight>
</syntaxhighlight>
}}
}}
==See also==
==See also==
{{Cam_functions_c}}
{{Cam_functions_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:Camera]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 22:12, 2 November 2024

Client-Side
Function

 JavaScript



JavaScript Syntax


This function sets the blend level for the maximum near focus distance in the camera's depth of field (DOF) settings, providing smoother transitions for objects near the camera. Adjusting this parameter allows you to refine the near-focus blur effect, useful in creating a cinematic depth of field look.

Required Params

  • camera: number — The camera handle.
  • p1: number — Blend level for near focus; typical range is from 0 to 1.

Return value

  • void

Syntax

mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera, p1);

Example

// Create a new camera and set DOF blend level for near focus
const camera = mp.cameras.new("default", new mp.Vector3(0, 0, 10), new mp.Vector3(0, 0, 0), 40);
camera.setActive(true);
mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel(camera.handle, 0.5); // Set blend level to 0.5 for smooth near-focus transition
mp.game.cam.renderScriptCams(true, false, 0, true, false);



See also