Cars – Rendering Cameras and Preprocessing - CheesyManiac/acc-extension-config GitHub Wiki
Rendering Camera
Allows the creation of additional cameras to create video. Originally used for reversing cameras like on some modern cars.
Don't expect high-quality images, the system is intended to run as cheaply as possible. However, keep the number of cameras fairly low to prevent heavy impact to game performance.
Output texture is in HDR, use TEXTURE_PREPROCESSING to bring into LDR.
Syntax
Given values are default values
[RENDERING_CAMERA_...]
DYNAMIC_TEXTURE_ID = txname ; Required, the name of the newly created dynamic texture
RESOLUTION = 256, 256 ; Required, resolution in pixels of the texture, 256 is minimum size
RELATIVE_TO = node ; Optional, attach camera to a node on the car. Useful if camera is attached to an animation
POSITION = 0,0,0 ; Required, position of camera in car co-ordinates
DIRECTION = 0, 0, -1 ; Required, direction camera faces. Default is pointing rearwards
UP = 0, 0, 1 ; Optional, the "up" axis, useful to manage rotation
REFRESH_RATE = 20 ; Optional, the update rate of the camera. Keep it low, maximum value is game FPS
ASPECT_RATIO = 1 ; Optional, alter the aspect ratio, default is resolution X/Y
INTERIOR_ONLY = 1 ; Optional, render only when camera is within the interior of the vehicle
INCLUDE_CAR = 0 ; Optional, include the car in the render
INCLUDE_DRIVER = 1 ; Optional, include the driver in the render
INCLUDE_SKY = 1 ; Optional, include the sky in the render
INCLUDE_TRANSPARENT = 1 ; Optional, include transparent meshes in render (windscreens, windows, etc)
WITH_LIGHTING = 1 ; Optional, include lighting and shadows in render (expensive if CSP dynamic lights are enabled)
WITH_DEPTH_BUFFER = 0 ; Optional, creates an additional texture with name "dynamic::txname/depth"
GENERATE_MIPS = 0 ; Optional, creates MIPs for the texture (expensive, recommended on if used on a large display)
FOV = 50 ; Optional, override the FOV of the camera
CLIP_NEAR = 0.05 ; Optional, near clipping point before meshes are included in render. Value in metres
CLIP_FAR = 1000 ; Optional, far clipping point where meshes are no longer included in render. Value in metres
ACTIVE_BY_DEFAULT = 1 ; Optional, is camera active by default. Useful if cameras are controlled via a Lua script
Lua Intergration
Since CSP 0.1.80preview346, car visual lua scripts can control the RENDERING_CAMERAS.
ALways refer to the Lua SDK for updated functions
---Activates or deactivates additional rendering camera. Don’t forget to use this method to pause those cameras when unused, it should really
---help with performance.
---@param name string @Name of camera section (i.e. \`'RENDERING_CAMERA_0'\`).
---@param active boolean|`true`|`false` @Set to \`true\` to activate camera.
function ac.setRenderingCameraActive(name, active) end
---Access rendering camera data (for both reading and writing). For faster access cache the result.
---@param name string @Name of a car section.
---@return ac.StateCarRenderingCamera?
function ac.accessCarRenderingCamera(name) end
Texture Preprocessing
Used to alter a source texture before it is used later on.
Expected to be used with the above RENDERING_CAMERA to bring the render into LDR space.
Syntax
Given values are default values
[TEXTURE_PREPROCESSING_...]
DYNAMIC_TEXTURE_ID = txname ; Required, the name of the newly created dynamic texture
RESOLUTION = 256, 256 ; Required, resolution in pixels of the texture, 256 is minimum size
TEXTURE_SOURCE = dynamic:: ; Required, source of the texture to be processed. Intended for "dynamic::" textures
EXPOSURE = 0 ; Optional, offset the exposure of the input
BRIGHTNESS = 1 ; Optional, multiply the brightness of the input
SATURATION = 1 ; Optional, multiply the saturation of the input
GAMMA = 1 ; Optional, adjust the gamma of the input
GENERATE_MIPS = 0 ; Optional, creates MIPs for the texture (expensive, recommended on if used on a large display)
EFFECT = BASIC ; Optional, available options: BASIC, FISHEYE
INTENSITY = 1 ; Optional, applicable only if FISHEYE is used, 0 to 1
Lua Intergration
Since CSP 0.1.80preview346, car visual lua scripts can control the TEXTURE_PREPROCESSING.
ALways refer to the Lua SDK for updated functions
---Access rendering camera data (for both reading and writing). For faster access cache the result.
---@param name string @Name of a car section.
---@return ac.StateCarTexturePreprocessing?
function ac.accessCarTexturePreprocessing(name) end