Tutorial 5
UTAS KIT207 Portfolio » Devlog
Alright, for my last exercise I'm using Cinemachine and post-processing.
I expanded on the cinemachine camera I'd already added to the scene with two extra viewpoints, one static and the other on a path.
(On Path)
(Path)
I like the pathed one in particular, with the slight dolly in tandem with the pan giving a slightly more natural feel to the camera movement.
Afterwards, I added some post-processing effects with the post-processing package. A combination of Vignette, Grain, and a custom effect leads to this output:
Code Snippet
- Shader "Hidden/Custom/CADOF"
- {
- HLSLINCLUDE
- #include "Packages/com.unity.postprocessing/PostProcessing/Shaders/StdLib.hlsl"
- TEXTURE2D_SAMPLER2D(_MainTex, sampler_MainTex);
- TEXTURE2D_SAMPLER2D(_CameraDepthTexture, sampler_CameraDepthTexture);
- float _Intensity;
- //sampler2D _CameraDepthTexture;
- float2 _rS;
- float2 _gS;
- float2 _bS;
- float4 Frag(VaryingsDefault i) : SV_Target
- {
- float p = _Intensity * 0.003;
- float d = LinearEyeDepth(SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, sampler_CameraDepthTexture, i.texcoordStereo));
- //focal distance
- d = abs(d - 20);
- //focal length
- d *= 0.03;
- d = clamp(d, 0, 1);
- p *= d;
- float r = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord + _rS * p).r;
- float g = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord + _gS * p).g;
- float b = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.texcoord + _bS * p).b;
- float4 color = float4(r, g, b, 1);
- //color = float4(d, d, d, 1);
- return color;
- }
- ENDHLSL
- SubShader
- {
- Cull Off ZWrite Off ZTest Always
- Pass
- {
- HLSLPROGRAM
- #pragma vertex VertDefault
- #pragma fragment Frag
- ENDHLSL
- }
- }
- }
I also made some position-sensitive camera effects, like a red "danger" vignette to tell the player they're near a deer spawner.
UTAS KIT207 Portfolio
Status | In development |
Category | Other |
Author | ChimeraMusic |
More posts
- Self Study 5Aug 16, 2022
- Self-study 4 + Tutorial 3Aug 09, 2022
- Self-Study 3 + Tutorial 2Aug 02, 2022
- Test Devlog for HTML code syntaxJul 31, 2022
- Self-study 2 + Tutorial 1Jul 26, 2022
- Week 2 modelling studyJul 19, 2022
Leave a comment
Log in with itch.io to leave a comment.