Cam::setDofMaxNearInFocusDistanceBlendLevel: Difference between revisions
(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| | ||
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 == | |||
* | *{{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"> | ||
// | // 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 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
- mp.game.cam.renderScriptS
- mp.game.cam.renderScriptCams
- mp.game.cam.stopRenderingScriptCamsUsingCatchUp
- mp.game.cam.create
- mp.game.cam.createCam
- mp.game.cam.createWithParams
- mp.game.cam.createCamWithParams
- mp.game.cam.createEra
- mp.game.cam.createCamera
- mp.game.cam.createEraWithParams
- mp.game.cam.createCameraWithParams
- mp.game.cam.destroy
- mp.game.cam.destroyAllS
- mp.game.cam.destroyAllCams
- mp.game.cam.doesExist
- mp.game.cam.setActive
- mp.game.cam.isActive
- mp.game.cam.isRendering
- mp.game.cam.getRendering
- mp.game.cam.getCoord
- mp.game.cam.getRot
- mp.game.cam.getFov
- mp.game.cam.getNearClip
- mp.game.cam.getFarClip
- mp.game.cam.getFarDof
- mp.game.cam.setParams
- mp.game.cam.setCoord
- mp.game.cam.setRot
- mp.game.cam.setFov
- mp.game.cam.setNearClip
- mp.game.cam.setFarClip
- mp.game.cam.setMotionBlurStrength
- mp.game.cam.setNearDof
- mp.game.cam.setFarDof
- mp.game.cam.setDofStrength
- mp.game.cam.setDofPlanes
- mp.game.cam.setUseShallowDofMode
- mp.game.cam.setUseHiDof
- mp.game.cam.setDofFnumberOfLens
- mp.game.cam.setDofFocalLengthMultiplier
- mp.game.cam.setDofFocusDistanceBias
- mp.game.cam.setDofMaxNearInFocusDistance
- mp.game.cam.setDofMaxNearInFocusDistanceBlendLevel
- mp.game.cam.attachToEntity
- mp.game.cam.attachToPedBone
- mp.game.cam.attachToPedBone2
- mp.game.cam.attachToVehicleBone
- mp.game.cam.detach
- mp.game.cam.setInheritRollVehicle
- mp.game.cam.pointAtCoord
- mp.game.cam.pointAtEntity
- mp.game.cam.pointAtPedBone
- mp.game.cam.stopPointing
- mp.game.cam.setAffectsAiming
- mp.game.cam.setDebugName
- mp.game.cam.addSplineNode
- mp.game.cam.addCamSplineNode
- mp.game.cam.addSplineNodeUsingCameraFrame
- mp.game.cam.addSplineNodeUsingCamera
- mp.game.cam.addSplineNodeUsingGameplayFrame
- mp.game.cam.setSplinePhase
- mp.game.cam.setCamSplinePhase
- mp.game.cam.getSplinePhase
- mp.game.cam.getSplineNodePhase
- mp.game.cam.getCamSplineNodePhase
- mp.game.cam.setSplineDuration
- mp.game.cam.setCamSplineDuration
- mp.game.cam.setSplineSmoothingStyle
- mp.game.cam.getSplineNodeIndex
- mp.game.cam.getCamSplineNodeIndex
- mp.game.cam.setSplineNodeEase
- mp.game.cam.setSplineNodeVelocityScale
- mp.game.cam.overrideSplineVelocity
- mp.game.cam.overrideCamSplineVelocity
- mp.game.cam.overrideSplineMotionBlur
- mp.game.cam.overrideCamSplineMotionBlur
- mp.game.cam.setSplineNodeExtraFlags
- mp.game.cam.isSplinePaused
- mp.game.cam.isCamSplinePaused
- mp.game.cam.setActiveWithInterp
- mp.game.cam.isInterpolating
- mp.game.cam.shake
- mp.game.cam.animatedShake
- mp.game.cam.isShaking
- mp.game.cam.setShakeAmplitude
- mp.game.cam.stopShaking
- mp.game.cam.shakeScriptGlobal
- mp.game.cam.animatedShakeScriptGlobal
- mp.game.cam.isScriptGlobalShaking
- mp.game.cam.stopScriptGlobalShaking
- mp.game.cam.playAnim
- mp.game.cam.isPlayingAnim
- mp.game.cam.setAnimCurrentPhase
- mp.game.cam.getAnimCurrentPhase
- mp.game.cam.playSynchronizedAnim
- mp.game.cam.playSynchronizedCamAnim
- mp.game.cam.setFlyHorizontalResponse
- mp.game.cam.setFlyVerticalSpeedMultiplier
- mp.game.cam.setFlyMaxHeight
- mp.game.cam.setFlyCoordAndConstrain
- mp.game.cam.isScreenFadedOut
- mp.game.cam.isScreenFadedIn
- mp.game.cam.isScreenFadingOut
- mp.game.cam.isScreenFadingIn
- mp.game.cam.doScreenFadeIn
- mp.game.cam.doScreenFadeOut
- mp.game.cam.setWidescreenBorders
- mp.game.cam.getGameplayCoord
- mp.game.cam.getGameplayRot
- mp.game.cam.getGameplayCamRot
- mp.game.cam.getGameplayFov
- mp.game.cam.getGameplayRelativeHeading
- mp.game.cam.getGameplayCamRelativeHeading
- mp.game.cam.setGameplayRelativeHeading
- mp.game.cam.setGameplayCamRelativeHeading
- mp.game.cam.getGameplayRelativePitch
- mp.game.cam.setGameplayRelativePitch
- mp.game.cam.setGameplayCamRelativePitch
- mp.game.cam.setGameplayRelativeRotation
- mp.game.cam.setGameplayRawYaw
- mp.game.cam.setGameplayCamRawYaw
- mp.game.cam.setGameplayRawPitch
- mp.game.cam.setGameplayCamRawPitch
- mp.game.cam.shakeGameplay
- mp.game.cam.shakeGameplayCam
- mp.game.cam.isGameplayShaking
- mp.game.cam.setGameplayShakeAmplitude
- mp.game.cam.setGameplayCamShakeAmplitude
- mp.game.cam.stopGameplayShaking
- mp.game.cam.stopGameplayCamShaking
- mp.game.cam.setGameplayFollowPedThisUpdate
- mp.game.cam.isGameplayRendering
- mp.game.cam.enableCrosshairThisFrame
- mp.game.cam.isGameplayLookingBehind
- mp.game.cam.disableCollisionForEntity
- mp.game.cam.disableCollisionForObject
- mp.game.cam.isSphereVisible
- mp.game.cam.isFollowPedActive
- mp.game.cam.setFollowPedThisUpdate
- mp.game.cam.setFollowPedCamCutsceneChat
- mp.game.cam.clampGameplayYaw
- mp.game.cam.clampGameplayCamYaw
- mp.game.cam.clampGameplayPitch
- mp.game.cam.clampGameplayCamPitch
- mp.game.cam.animateGameplayZoom
- mp.game.cam.animateGameplayCamZoom
- mp.game.cam.setInVehicleStateThisUpdate
- mp.game.cam.disableFirstPersonThisFrame
- mp.game.cam.getFollowPedZoomLevel
- mp.game.cam.getFollowPedViewMode
- mp.game.cam.setFollowPedViewMode
- mp.game.cam.setFollowPedCamViewMode
- mp.game.cam.isFollowVehicleActive
- mp.game.cam.getFollowVehicleZoomLevel
- mp.game.cam.setFollowVehicleZoomLevel
- mp.game.cam.setFollowVehicleCamZoomLevel
- mp.game.cam.getFollowVehicleViewMode
- mp.game.cam.setFollowVehicleViewMode
- mp.game.cam.setFollowVehicleCamViewMode
- mp.game.cam.useStuntEraThisFrame
- mp.game.cam.setGameplayHash
- mp.game.cam.setFollowTurretSeat
- mp.game.cam.isAimActive
- mp.game.cam.isAimThirdPersonActive
- mp.game.cam.isFirstPersonAimActive
- mp.game.cam.disableAimThisUpdate
- mp.game.cam.getFirstPersonAimZoomFactor
- mp.game.cam.setFirstPersonAimZoomFactor
- mp.game.cam.setFirstPersonPitchRange
- mp.game.cam.setFirstPersonAimNearClipThisUpdate
- mp.game.cam.setThirdPersonAimNearClipThisUpdate
- mp.game.cam.getFinalRenderedCoord
- mp.game.cam.getFinalRenderedRot
- mp.game.cam.getFinalRenderedInWhenFriendlyRot
- mp.game.cam.getFinalRenderedFov
- mp.game.cam.getFinalRenderedInWhenFriendlyFov
- mp.game.cam.getFinalRenderedNearClip
- mp.game.cam.getFinalRenderedFarClip
- mp.game.cam.getFinalRenderedNearDof
- mp.game.cam.getFinalRenderedFarDof
- mp.game.cam.getFinalRenderedMotionBlurStrength
- mp.game.cam.setGameplayCoordHint
- mp.game.cam.setGameplayPedHint
- mp.game.cam.setGameplayVehicleHint
- mp.game.cam.setGameplayObjectHint
- mp.game.cam.setGameplayEntityHint
- mp.game.cam.isGameplayHintActive
- mp.game.cam.stopGameplayHint
- mp.game.cam.setGameplayHintFov
- mp.game.cam.setGameplayHintFollowDistanceScalar
- mp.game.cam.setGameplayHintBaseOrbitPitchOffset
- mp.game.cam.setGameplayHintAnimOffsetx
- mp.game.cam.setGameplayHintAnimOffsety
- mp.game.cam.setGameplayHintAnimCloseup
- mp.game.cam.getIsMultiplayerBrief
- mp.game.cam.setCinematicButtonActive
- mp.game.cam.isCinematicRendering
- mp.game.cam.shakeCinematic
- mp.game.cam.shakeCinematicCam
- mp.game.cam.isCinematicShaking
- mp.game.cam.setCinematicShakeAmplitude
- mp.game.cam.setCinematicCamShakeAmplitude
- mp.game.cam.stopCinematicShaking
- mp.game.cam.stopCinematicCamShaking
- mp.game.cam.disableVehicleFirstPersonThisFrame
- mp.game.cam.invalidateVehicleIdle
- mp.game.cam.invalidateIdle
- mp.game.cam.isCinematicIdleRendering
- mp.game.cam.isInVehicleDisabled
- mp.game.cam.createCinematicShot
- mp.game.cam.isCinematicShotActive
- mp.game.cam.stopCinematicShot
- mp.game.cam.forceCinematicRenderingThisUpdate
- mp.game.cam.setCinematicModeActive
- mp.game.cam.isCinematicActive
- mp.game.cam.stopCutsceneShaking
- mp.game.cam.getFocusPedOnScreen
- mp.game.cam.setEffect
- mp.game.cam.setCamEffect
- mp.game.cam.setGameplayVehicleCamera
- mp.game.cam.setGameplayVehicleCameraName
- mp.game.cam.replayFreeGetMaxRange
- mp.game.cam.setDofParam
- mp.game.cam.getDofParam