getShadowRenderObjectFunction = ( renderer, shadow, shadowType, useVelocity ) => {

	_shadowRenderObjectKeys[ 0 ] = renderer;
	_shadowRenderObjectKeys[ 1 ] = shadow;

	let renderObjectFunction = _shadowRenderObjectLibrary.get( _shadowRenderObjectKeys );

	if ( renderObjectFunction === undefined || ( renderObjectFunction.shadowType !== shadowType || renderObjectFunction.useVelocity !== useVelocity ) ) {

		renderObjectFunction = ( object, scene, _camera, geometry, material, group, ...params ) => {

			if ( object.castShadow === true || ( object.receiveShadow && shadowType === VSMShadowMap ) ) {

				if ( useVelocity ) {

					getDataFromObject( object ).useVelocity = true;

				}

				object.onBeforeShadow( renderer, object, _camera, shadow.camera, geometry, scene.overrideMaterial, group );

				renderer.renderObject( object, scene, _camera, geometry, material, group, ...params );

				object.onAfterShadow( renderer, object, _camera, shadow.camera, geometry, scene.overrideMaterial, group );

			}

		};

		renderObjectFunction.shadowType = shadowType;
		renderObjectFunction.useVelocity = useVelocity;

		_shadowRenderObjectLibrary.set( _shadowRenderObjectKeys, renderObjectFunction );

	}

	_shadowRenderObjectKeys[ 0 ] = null;
	_shadowRenderObjectKeys[ 1 ] = null;

	return renderObjectFunction;

}
Creates a function to render shadow objects in a scene.

@param {Renderer} renderer - The renderer.
@param {LightShadow} shadow - The light shadow object containing shadow properties.
@param {number} shadowType - The type of shadow map (e.g., BasicShadowMap).
@param {boolean} useVelocity - Whether to use velocity data for rendering.
@return {Function} A function that renders shadow objects.

The returned function has the following parameters:
@param {Object3D} object - The 3D object to render.
@param {Scene} scene - The scene containing the object.
@param {Camera} _camera - The camera used for rendering.
@param {BufferGeometry} geometry - The geometry of the object.
@param {Material} material - The material of the object.
@param {Group} group - The group the object belongs to.
@param {...any} params - Additional parameters for rendering.