Wednesday, 5 November 2014

COP3 Unity Workshop: Lighting and Shaders

Context of Practice 3 Unity Workshop: Lighting and Shaders
Today we had a workshop taken by Annabeth Robinson, one of our tutors, and we learnt all about Unity lighting and shaders in much more detail than w had previously. In the workshop we also went through light mapping and how to set up Unity properly.

I started by adding in a few shapes into the environment and ensuring that there was a basic directional light in the scene. This light gives off a simple shadow coming from it and we can easily change the settings to ensure that we can get the best quality look of it. I started by looking at the scene and how it would seem when we ask the computer to run at the fastest setting and this produces no shadow at all as the PC is trying to run at an optimal speed.
I then upped the settings slightly to simple and you can see that the shadows are now their but you get this very jagged line around the edge which doesn't look very attractive.
 I then finally looked at the fantastic setting and you can clearly see how much better it makes the shadows of the shapes look. It gets rid of the horrible jagged look but their is still more that we can do to make this look even better.
We then looked at the anti aliasing and how it can be used in the game space to make objects look just that little bit nicer. We first started by looking at what it looks like without any and you can see below that the lines are very jagged around the edges of the shapes and it just doesn’t look that attractive.
We then looked at the space with anti-aliasing and it makes such a bit different even when its on x4, you can see that there is virtually no jagged lines and the shape appears smoother at the edges. You can then also see it below at x8, this looks great but will only really work in a small scene like this, otherwise the computer will eventually start slowing down due to how much real time rendering it has to do.
As we only really want to add shadows onto point lights, we look at what would happen if you were to add it to a spot light instead. We did the test and the lighting looked good, but this method isn’t a great approach to light mapping as the computer has to think about the 360degrees, instead of just one direction which is has to do with a directional light. This can really slow the real time rendering down, but if you were to light map the scene using spot lights this can work, but would take a lot longer for it to render than a directional light that only takes a few seconds. The only problem with this is that you do not get the anti-aliasing around the edges so you end up with harsh jagged lines and unfortunately can’t do anything about this.

A really nice little test that we got told about was to look at already existing video games to see how they look and what lighting they use as more than often it isn’t very good, especially when it comes to character lighting. This can be a problem in most modern games as there is only so much a processer can do at one time and generating shadows on a moving character, especially when they are very detailed can really eat into the processing power of a PC or console. This is why most companies tend to not add anti-aliasing as this can slow down a game massively when you have a moving object and this is the reason as to why most environments can look really beautiful against the jagged shoddy character shadow. What they can do with environments is make the shadows ‘static’, especially if the time of day isn’t going to change as the shadows to not need to move then, its only when objects can be interacted with that they are not going to be light mapped.

Light mapping is an excellent way in which you can generate shadows on static objects and really make them look impressive at the same time. Light mapping, in Unity has its own menu and options and it is generated by selecting everything in the scene along with the light as well. The menu gives a number of different options that I will go through in a minute, but once selected the shadows are now baked into the scene and you can then turn the light off or get rid of it entirely and the shadows will still be there in the scene even without a light source, which really cuts down the real time processing speed.

1.       Hint of colour in a scene are a really nice way of adding a sense of day or night and can also give that effect of realism into the scene, as colour reflects off most surfaces and there is no such thing as pure white light. You can alter the colour of the light in the light mapping menu to bake in the colour into the light but you can also do this for real time lighting as well in which it will give a small hint of colour through the actual light source.
2.       You can also change the resolution of the light mapping and this is represented by checkers on the shapes in the scene. 50 res if the default and this produces a nice shape but you can see the change as you put it down to just 10. By lowering the resolution you can see that the shadows aren’t as accurate and are just shapes, not the actually tru shapes of the environment. You can also bump up the resolution, resulting in some really nice shadows when I put mine up to 100 res, but this can go higher but will eventually start to slow your processer down as it has to render more.
We can then start to introduce coloured shapes into the scene and then, using light mapping, we can see how the colour of one shape is then displayed on the other shape due to bouncing of light from one object onto the other. This creates a really nice effect and again adds another level of realism into the scene. This can work really nicely if you are wanting to use lit up signs which use different colours that reflect onto other objects in the scene, and the amount of bounce and intensity can also be altered in the settings.
We can then, for a further level of detail, add in ambient lighting into the scene as a whole. This can be nice if you want to go for either day or night scenes as it effects the entire environment, but can also be very effective for other world locations as you can add colourful elements to the environment and change the whole atmosphere very simply with this technique.
Finally we looked at ambient occlusions which is self-shadowing on objects in a scene, this is a very nice finishing touch on an environment as once again it just gives that little touch of detail that makes it slightly more realistic and it looks nice, altering the shadows towards the bottom of the shape, emphasising them more.
I really enjoyed todays workshop and learned a lot from them. I really want to get on with my own game environment now as lighting is something that I am very interested in learning more about and practising myself, especially for this module as I want to see how lighting and colour can be used to alter perspective in an environment which is something that I anticipate will have been benefitted from by doing this workshop.

No comments:

Post a Comment