You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
2.0 KiB
42 lines
2.0 KiB
using UnityEngine.VFX;
|
|
|
|
namespace UnityEditor.VFX.Operator
|
|
{
|
|
[VFXHelpURL("Operator-MainCamera")]
|
|
[VFXInfo(category = "Camera")]
|
|
class MainCamera : VFXOperator
|
|
{
|
|
public class OutputProperties
|
|
{
|
|
public CameraType o = new CameraType();
|
|
}
|
|
|
|
override public string name { get { return "Main Camera"; } }
|
|
|
|
public sealed override VFXSpace GetOutputSpaceFromSlot(VFXSlot slot)
|
|
{
|
|
if (slot.spaceable && slot.property.type == typeof(CameraType))
|
|
return VFXSpace.World;
|
|
|
|
return VFXSpace.None;
|
|
}
|
|
|
|
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
|
|
{
|
|
VFXExpression matrix = new VFXExpressionExtractMatrixFromMainCamera();
|
|
VFXExpression orthographic = new VFXExpressionIsMainCameraOrthographic();
|
|
VFXExpression fov = new VFXExpressionExtractFOVFromMainCamera();
|
|
VFXExpression nearPlane = new VFXExpressionExtractNearPlaneFromMainCamera();
|
|
VFXExpression farPlane = new VFXExpressionExtractFarPlaneFromMainCamera();
|
|
VFXExpression orthographicSize = new VFXExpressionGetOrthographicSizeFromMainCamera();
|
|
VFXExpression aspectRatio = new VFXExpressionExtractAspectRatioFromMainCamera();
|
|
VFXExpression pixelDimensions = new VFXExpressionExtractPixelDimensionsFromMainCamera();
|
|
VFXExpression lensShift = new VFXExpressionExtractLensShiftFromMainCamera();
|
|
VFXExpression depthBuffer = new VFXExpressionGetBufferFromMainCamera(VFXCameraBufferTypes.Depth);
|
|
VFXExpression colorBuffer = new VFXExpressionGetBufferFromMainCamera(VFXCameraBufferTypes.Color);
|
|
VFXExpression scaledPixelDimensions = new VFXExpressionExtractScaledPixelDimensionsFromMainCamera();
|
|
|
|
return new[] { matrix, orthographic, fov, nearPlane, farPlane, orthographicSize, aspectRatio, pixelDimensions, scaledPixelDimensions, lensShift, depthBuffer, colorBuffer };
|
|
}
|
|
}
|
|
}
|