Browse Source

Added motion blur to the post-process profile, along with a script to test camera movement

stable
Nico de Poel 3 years ago
parent
commit
f8f2ac2792
  1. 32
      Assets/Scenes/SampleScenePPV2.unity
  2. 24
      Assets/Scenes/SampleScenePPV2_Profiles/Main Camera Profile.asset
  3. 8
      Assets/Scripts.meta
  4. 49
      Assets/Scripts/CameraMover.cs
  5. 11
      Assets/Scripts/CameraMover.cs.meta

32
Assets/Scenes/SampleScenePPV2.unity

@ -230,6 +230,7 @@ GameObject:
- component: {fileID: 963194226}
- component: {fileID: 963194233}
- component: {fileID: 963194232}
- component: {fileID: 963194234}
m_Layer: 6
m_Name: Main Camera
m_TagString: MainCamera
@ -344,6 +345,22 @@ MonoBehaviour:
sharpness: 0.25
stationaryBlending: 0.95
motionBlending: 0.85
superResolution:
qualityMode: 1
performSharpenPass: 1
sharpness: 0.8
enableFP16: 0
enableAutoExposure: 1
preExposure: 1
exposure: {fileID: 0}
reactiveMask: {fileID: 0}
transparencyAndCompositionMask: {fileID: 0}
autoGenerateReactiveMask: 1
generateReactiveParameters:
scale: 0.5
cutoffThreshold: 0.2
binaryValue: 0.9
flags: 13
subpixelMorphologicalAntialiasing:
quality: 2
fastApproximateAntialiasing:
@ -378,8 +395,23 @@ MonoBehaviour:
m_ShowCustomSorter: 0
breakBeforeColorGrading: 0
m_BeforeTransparentBundles: []
m_BeforeUpscalingBundles: []
m_BeforeStackBundles: []
m_AfterStackBundles: []
--- !u!114 &963194234
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 963194225}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e3b91bb9659da8f49b7b36df73b7f70a, type: 3}
m_Name:
m_EditorClassIdentifier:
amplitude: 30
frequency: 0.5
--- !u!1001 &1313173313
PrefabInstance:
m_ObjectHideFlags: 0

24
Assets/Scenes/SampleScenePPV2_Profiles/Main Camera Profile.asset

@ -62,10 +62,10 @@ MonoBehaviour:
m_Name: Main Camera Profile
m_EditorClassIdentifier:
settings:
- {fileID: 3185594499184808736}
- {fileID: 318921389242660834}
- {fileID: -3210546339682213159}
- {fileID: 1914479938552302798}
- {fileID: 6248481887015335191}
--- !u!114 &318921389242660834
MonoBehaviour:
m_ObjectHideFlags: 3
@ -1499,3 +1499,25 @@ MonoBehaviour:
qualityMode:
overrideState: 0
value: 2
--- !u!114 &6248481887015335191
MonoBehaviour:
m_ObjectHideFlags: 3
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b94fcd11afffcb142908bfcb1e261fba, type: 3}
m_Name: MotionBlur
m_EditorClassIdentifier:
active: 1
enabled:
overrideState: 1
value: 1
shutterAngle:
overrideState: 0
value: 270
sampleCount:
overrideState: 0
value: 10

8
Assets/Scripts.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5aa83ca4c2df89f4faa8cf440643c0ab
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

49
Assets/Scripts/CameraMover.cs

@ -0,0 +1,49 @@
// Copyright (c) 2023 Nico de Poel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraMover : MonoBehaviour
{
private Camera _camera;
private Vector3 _startAngles;
[SerializeField]
private float amplitude = 30f;
[SerializeField]
private float frequency = 0.1f;
void Start()
{
_camera = GetComponent<Camera>();
_startAngles = _camera.transform.localEulerAngles;
}
void Update()
{
var angles = _startAngles;
angles.x += amplitude * Mathf.Sin(2 * Mathf.PI * frequency * Time.time);
angles.y += amplitude * Mathf.Sin(2 * Mathf.PI * frequency * Time.time * 0.73f);
_camera.transform.localEulerAngles = angles;
}
}

11
Assets/Scripts/CameraMover.cs.meta

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e3b91bb9659da8f49b7b36df73b7f70a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Loading…
Cancel
Save