Unity 2D Scene Tutorial - Layers, lighting, post-processing, blur camera etc
Summary
TLDRThis video provides an in-depth devlog on building a game scene using the Universal Render Pipeline (URP). The creator walks through the process of layer management, lighting, and post-processing, offering practical tips for organizing assets, adding depth with lighting techniques, and creating effects like fog and blurred backgrounds. The video emphasizes the importance of maintaining control over each element, adjusting blur levels, and using post-processing tools to achieve a cinematic look. It's a helpful guide for solo developers looking to enhance their game scenes with visual effects and organization.
Takeaways
- 🎮 The video is a devlog explaining how the creator built their simulation game with details like layer management, lighting, and post-processing.
- 🛠️ The developer mentions that creating games as a solo dev is overwhelming, as they have to manage everything from story, scripting, and design to technical aspects.
- 💡 The first step was to set up a scene in Unity using the Universal Render Pipeline (URP), warning that transitioning to URP might break materials but is fixable.
- 📂 The developer organizes assets into three folders: foreground, mid-ground, and background, while adding multiple sorting layers for proper sprite management.
- 🎨 Blurred assets were used in the scene for depth, with closer objects having less blur and distant objects more, offering control over the depth effect.
- 🌟 Global lighting was created for different layers to manage the brightness and darkness of the scene, with special attention to foreground, mid-ground, and background lighting.
- 🔦 Shape lights and spotlights were utilized for more control over specific scene elements, enhancing the platforms and creating mood with colors.
- 🌫️ Fog sprites were added for depth and atmosphere, created in Photoshop and imported into Unity, with color and transparency adjustments.
- ✨ Sprite lights were applied to specific layers for additional lighting effects, requiring proper layer management to avoid conflicts with other elements.
- 📸 The developer used multiple cameras with different post-processing effects to blur the background, stacking them in Unity to achieve the desired sharpness and blur in specific scene layers.
Q & A
What is the main purpose of the video?
-The video aims to provide a detailed devlog on how the creator built a simulation game, covering aspects like layer management, lighting, and post-processing, among others.
Why does the creator emphasize the need for a detailed devlog?
-The creator explains that as a solo developer, they have to manage many areas of the game development process, making it easy to forget certain details after moving on to other tasks. The devlog serves as a reference for future work.
What is the first step in setting up a new scene in Unity using the URP pipeline?
-The first step is creating a new scene in Unity using the Universal Render Pipeline (URP) or converting an existing scene to URP, though this process might cause material issues that need to be fixed.
How does the creator manage layers and assets in the scene?
-The creator organizes the scene by creating three folders: foreground, mid-ground, and background. They also add sorting layers to manage how sprites are displayed relative to one another, assigning each sprite to its appropriate layer.
What technique does the creator use to add depth to the scene?
-The creator adds depth by blurring certain assets in Photoshop, with objects closer to the player having less blur and distant objects having more. They also use semi-transparent planes for additional layers.
How does the creator handle lighting in different layers of the scene?
-The creator uses multiple global lights, each affecting different layers like the foreground, mid-ground, and background. They start by making layers dark and then gradually adjust brightness using tools like shape lights and spotlights.
What is the purpose of using Sprite lights and how are they created?
-Sprite lights are used to add localized lighting effects. The creator makes them by painting white dots on a transparent background in Photoshop, blurring them, and exporting them as PNG files to be used in Unity.
How does the creator add fog effects to the scene?
-Fog effects are created by designing blurred white dots in Photoshop and importing them into Unity. The fog sprites' transparency is adjusted, and they are placed in the scene to add atmospheric depth.
What method does the creator use to blur the background of the scene?
-The background blur is achieved by duplicating the main camera and setting up one sharp camera and one blurred camera. Separate layers are assigned for background blur, and depth of field effects are applied only to the blurred camera.
What final touch does the creator add to improve the visual quality of the scene?
-The creator adds post-processing effects like Bloom, color curves, and Lift Gamma Gain to enhance the scene's lighting and colors, creating a more cinematic feel while being careful not to overdo the effects.
Outlines
📽️ Introduction to the Devlog and Scene Setup
The video starts by introducing the content as a devlog requested by viewers, focusing on the development process of building a simulation. The creator highlights the complexity of game development as a solo developer, covering aspects like auto direction, game design, and coding. They emphasize the challenge of retaining knowledge as projects evolve and explain that this video will walk through the process of creating a new scene using the URP pipeline in Unity. The tutorial begins by adjusting sprite rendering settings, organizing assets into foreground, mid-ground, and background layers, and assigning sorting layers to each sprite for clarity.
💡 Enhancing Scene Depth with Lighting
This section focuses on adding depth to the scene by adjusting background opacity layers and global lighting effects. The creator discusses setting up multiple global lights for various scene layers, using the first light for the foreground with zero intensity and the second for the mid-ground. They also describe techniques for controlling the lighting of specific platforms in the game using shape lights and spotlighting the background to create a fantasy-like atmosphere. The section concludes with advice on choosing color schemes to avoid cluttering the game’s aesthetic.
🌫️ Adding Fog and Depth to the Scene
To add atmospheric depth, the creator introduces fog sprites, explaining how they are created in Photoshop with blurred white dots. These sprites are imported into Unity and used to enhance the sense of distance in the background. The creator also adds sprite lights, generated similarly to the fog sprites, and applies them selectively to specific layers. After some troubleshooting with fog panels affecting lighting, they suggest organizing these into dedicated layers for better visual control. More sprite lights are added to enhance the scene’s ambiance.
🌅 Applying Sprite Shape Lighting and Post-Processing Effects
This section discusses refining the lighting by ensuring sprite shapes are aligned on the same Z axis as the relevant assets to prevent parallax issues. Sunrays are created using volumetric lighting techniques, and more assets like grass and rocks are added to fill out the scene. The video then transitions to post-processing, where the creator introduces global volume settings to apply effects such as Bloom, color curves, and lift gamma gray. After experimenting with different post-processing effects, they caution viewers not to overuse these tools to avoid overwhelming the scene.
📷 Blurring the Background with Dual Camera Setup
In the final section, the creator demonstrates how to blur the background using a two-camera setup. By duplicating the main camera, they create a 'sharp' camera for foreground elements and a 'blur' camera for the background. Both cameras are assigned specific rendering layers, and post-processing is applied to the blurred camera only. After troubleshooting issues with global lighting affecting the background blur, the lights are reassigned to the correct layer. The section ends with fine-tuning the blur effect to achieve the desired result, adding the final touch to the scene.
Mindmap
Keywords
💡URP Pipeline
💡Sorting Layers
💡Global Lights
💡Sprite Lights
💡Post Processing
💡Depth of Field
💡Volumetric Lighting
💡Fog Sprites
💡Camera Stacking
💡Bloom Effect
Highlights
Introduction to the devlog explaining how the video will cover a more detailed breakdown of the simulation creation process.
Emphasizing the importance of documentation for solo developers to avoid forgetting key aspects of development over time.
Creating a new scene using the Universal Render Pipeline (URP) and warning about potential material issues during conversion.
Fixing sprite overlay issues by adjusting the rendering axes and implementing custom sorting layers for proper sprite organization.
Organizing the scene into foreground, mid-ground, and background layers to enhance visual depth and manage asset sorting.
Using blurred assets to create a sense of depth, applying more blur to distant objects and less to closer ones for visual distinction.
Demonstrating the use of multiple global lights to control the lighting for different scene layers, including foreground, mid-ground, and background.
Introducing the shape light tool for lighting specific scene elements, such as platforms where the player will interact.
Enhancing background visuals with spotlights and playing with color to create a fantasy or mysterious mood.
Adding fog sprites to the scene for atmospheric depth by creating blurred white dots in Photoshop and adjusting their transparency in Unity.
Introducing sprite lights for dynamic scene lighting and discussing issues with overlapping fog panels and sorting layers.
Using parallax effects to create depth in the scene and ensuring that sprite shapes align with the correct Z-axis for proper rendering.
Creating post-processing effects, such as Bloom and Lift Gamma Gain, to add cinematic depth and mood to the scene.
Demonstrating how to blur the background by duplicating cameras, applying post-processing effects, and separating camera layers for blurred and sharp elements.
Final step: Managing the global lights and blur layer interactions to properly display the Skybox and adjust the desired blur level for the background.
Transcripts
hi guys this video was a requested one
there were quite a few people who were
interested in seeing a more detailed
devlog on how exactly I built my sim you
know layer management lighting post
processing etc etc so I thought this
could be a great opportunity to make one
and hopefully you'll get to learn
something along the way aside from that
this devlog I think could be useful even
for future me as a solo developer you
must cover almost every area of the game
from Auto Direction scene building to
game Design Story Lord effect script
code and so many other things oh my God
I'm just getting a panic attack just
thinking about all this but anyway the
point is well it's very easy to forget
stuff you've been working on for a while
especially after you move down to
something else so here we go let's start
from the beginning first we'll make a
new scene using the urp pipeline if your
scene is not already in urp watch this
video on how to convert it but be
prepared just to have a nervous
breakdown since the urp transition is
going to ruin many of your materials but
fortunately you can fix that it just
takes some time okay so let's drag a few
assets into our scene the very thing
you'll notice is the fact these Sprites
don't really overlay much with each
other especially in the Z position so
let's fix that search for a rendered 2D
this comes automatically with a urp
Pipeline and we are going to change from
default to custom axes then set 0 value
to y axis and 1 to Z and voila Magic
now we should organize things a bit so
let's make three folders foreground
mid-ground and background the next thing
we most absolutely do is add sorting
layers I'm thinking to add around the 6
maybe but if needed I can definitely add
more so each sprite from the scene will
go into the assigned layer the platform
the player will walk on will remain on
default while Sprites closer to that
will go in the Middle Ground section
[Music]
foreign
foreign
[Music]
objects to the scene by the way you can
select multiple Sprites at once and sort
them rather than each individually for
the purpose of this video I'm thinking
nothing to fancy rather a simple scene
with some platforms the player might
jump on
foreign
Sprites are a bit blurry that's because
well I simply blur them in Photoshop as
you can see I have a special folder for
the Blurred assets things that are
closer to the player will have less blur
while things in the distance will have
more that's at least one way to do it
maybe is not the most effective one but
at least gives me a certain level of
control having multiple levels of blur
another way would be to use multiple
cameras and then blur the backgrounds
with that I will show you towards the
end how to do that as well anyway as you
can see the scene seems to have more and
more assets and layers now in the
background as well in the foreground
[Music]
thank you
[Music]
foreign
thank you
[Music]
[Music]
foreign
[Music]
[Music]
[Music]
I also added a few simple planes with
reduced opacity on almost each
background layer this is pretty great if
you want your scene to have more depth
[Music]
[Music]
foreign
[Music]
that being said let's take care of the
lighting the very first thing that I've
made was to create a few Global lights
that would have an effect on certain
layers I made one for the foreground
with reduce the value to zero and I made
another one except this one won't be
zero something a bit closer it's all up
to you how dark you want the second
layer of your foreground to be now let's
make another Global light except this
one will be for the mid ground and
lastly one for the background actually
let's make two the idea is to make
things dark first and then bring them to
light using various tools
foreign
[Music]
thank you
okay so the first thing we are going to
use is the shape light which is pretty
great since allows me to have more
control over the things I want to be lit
I primarily use this for the platforms
where the player is going to step on
ignoring pretty much everything else
[Music]
thank you
[Music]
[Music]
[Music]
foreign
[Music]
[Music]
foreign
[Music]
[Music]
foreign
[Music]
for the backgrounds I'm going to use
various spotlights that will highlight
parts of the world I can also play with
color in order to create a more
mysterious and fantasy mood I highly
recommend watching this video which
explains very well how to use color and
what works with what so you don't end up
just throwing random colors in your game
managing this can be pretty challenging
overall and I did see plenty of games
from AAA to Indie mess this up
[Music]
foreign
[Music]
foreign
[Music]
foreign
[Music]
[Music]
next I'm thinking to add more depth to
the scene by creating some Fox Sprites
these are pretty easy to make just some
white dots blurred in Photoshop and
exported as pngs then I can simply bring
them into Unity change color reduce
transparency and that's it
foreign
[Music]
[Music]
foreign
[Music]
[Music]
[Music]
okay now let's add some Sprite lights
just as before they are pretty simple to
make then I grabbed and dropped one of
the textures I made to make this you
follow pretty much the same procedure as
before go into Photoshop paint a few
white dots over a transparent background
blur them and then export it as PNG now
I don't want the Sprite lights to have
an effect over everything so I'm going
to assign only the layer I wanted to be
affected and oh okay so the reason this
doesn't work as intended is because of
those large fog panels we added in the
beginning which are on the same sorting
layer as soon as I disable those Sprites
bam we see the lights falling only over
the trees however I do want my fog as
well you know have my kicking knitting
tool so let's make another layer that is
special only for the fog panel as I said
we can add multiple layer later if we
must okay now let's add multiple Sprite
lights to the scene
[Music]
foreign
[Music]
by the way one quick tip the Sprite
shapes must have the same Z position as
the assets you want to assign it on
otherwise The Parallax effect will
display it on a different speed you see
something like this we want to avoid for
the sun rays we can apply the same
technique except we'll turn on the
volumetric option from this point onward
you can spend as much time as you want
adding more assets to the scene so it's
Fuller grass rocks bushes whatever you
want now let's take care of the cherry
on the top which is post processing to
do that we must create a global volume
with a new profile then click override
and then select whatever effect you want
foreign first I would like to add some
Bloom but just a bit since it can burn
up my scene very quickly oh it doesn't
work okay so I think I might know why I
simply forgot to check the cross
processing option from the main camera
then I added some color curves and
pretend that like I knew what I was
doing yeah I would not bother much with
that anyway the next effect is pretty
great lift gamma gray this can easily
turn up your scene into something a bit
more cinematic just play around a bit
with these three wheels and see what
fits your scene okay so after a while
these are the effects I ended up with at
the end of the day it's a lot of mix and
match and see whatever works for you but
the idea end result is an improvement
however be careful not to go too
overboard with this effect now the last
thing I want to show you is the Blurred
background so the very first thing we
need to do is duplicate the main camera
make two copy of that Ctrl D is the
shortcut for that by the way so the
first camera we are going to name
something like a camera Sharp and the
second one which will contain the blur
effect while Camera blur simple as that
then select both cameras and make them
child of the main camera
okay so next let's make another cross
processing volume this one will only
contain the depth on Field Effect and
that's it by the way don't forget to
make a new profile for this post
processing effect as well okay so the
next step is very important we need to
create a separate layer for the Blurred
camera click add layer and name it
whatever you want in this case blurred
background or something like this but in
your case you can type it actually
correctly anyway so the Blurred camera
will go on this separate layer so
instead of default choose background
blur okay we need to set up these two
cameras select both of them go to render
type and change from base to Overlay
then let's choose first camera sharp in
the cooling mask and volume mask section
we need to deselect the background blur
layer now on the other hand on the
Camera blur in the same sections we'll
do exactly the same except will only
make visible the background blur layer
everything else will be deselected next
the post processing effect must be
placed on the same layer here as well as
the folder which contains all the assets
for the background next we need to go in
the main camera in the stack section
here we need to add those two cameras we
just created by simply pressing the plus
button now the order of this really
matters the one above is going to be in
the background and the one below in the
foreground it's like the inverse version
of Photoshop layers
so as you can see the mid section has no
blur while the background is completely
blurred which is pretty much what we
really wanted except we still have one
problem we don't really see the Skybox
at all and that's because the global
lights we created in the beginning well
they are on the wrong layer so we'll
select both of them and choose
background blur layer and bam bam thank
you ma'am here's how you blur the
background next you can choose the type
and amount of blurry wand but that's
kind of it hopefully you've learned
something from this video but if you
have any questions please let me know in
the comment section and I will do my
best to respond in time so bye bye see
you next time
[Music]
関連動画をさらに表示
Just use this cinematic schemes to Improve your lighting skills
Make your digital art look like those classical paintings
CapCut Tutorial: How to Create EPIC FILM with Ai
Create Hyper Visuals & Physics - Motion Design in After Effects
Creating a Product Render in Blender 3D - Sony Mp3 Players
2024 Unity VR Tutorial (OpenXR and XR Interaction Toolkit) - PART 1 - Project Setup
5.0 / 5 (0 votes)