This is the part 2 of a 3 parts tutorial about creating lighting and shadows which can be quickly rendered directly from the 3D viewport, using the OpenGL render function, without the need of other time consuming rendering engines.
In this part, I will teach you how to create basic 3D viewport shadows for a relatively small scene.
Hi, it's me again.
In my last Blender Tutorial, I have shown a simple way to create proper illumination in the 3D viewport, using a sun lamp and some other techniques.
This is the part two of the tutorial.
Now, I will teach you the technique for creating shadows directly in the 3D viewport.
Yes, with this technique, you will be able to render the scene with shadows, using OpenGL rendering, without the use of any render engine.
But wait, it get's even better than you can imagine...
This amazing technique, will allow you to render a scene, with high quality shadows and almost instant render times.
Ok, here it goes.
So, the first thing that you will need to do, is to create a second sun lamp, and position it accordingly.
I will assume you already know how to create a simple lamp object, because I hope you do.
This is my second sun lamp, and it is set at a distance of 150 meters from the characters of the scene.
Activate the specular and diffuse lighting for this lamp.
Activate ray tracing for the shadows.
The raytraced shadows will always stretch in the direction of the lighting, as they should.
Now, you will notice that there are some visible shadows in my scene.
In your scene, you will probably not see the shadows yet, because you still need to configure some parameters.
I will show you how to configure it.
Go to the Blender Game Engine.
I will show you how to create higher quality shadows.
As you can see, in the Blender Game Engine, we have a bunch of other options available for the configuration of the lamp.
Set the configuration exactly as I did.
The most important parameters are the clipping distances and the frustum size.
These parameters control the minimum and maximum distances for the generation of shadows, starting from the lamp.
As you can see, when the lamp is moved far away, the shadows will disappear.
You will notice that the shadows still look unnatural and unrealistic.
To fix this, change the shadow map type to variance.
Now, the shadows will look much more realistic.
You will probably experience computer slow down, due to the real time processing of the shadows.
Anyway, these shadows have a fading effect, which makes them look smoother and more realistic.
To reduce the viewport lag, while animating, deactivate the variance, and only activate it when you are about to render the animation using OpenGL render.
That variance option is only available in the Blender Game Engine, but if you activate it and then go back to the Blender Render Engine, the variance option will stay activated.
You have probably noticed that the lighting of the scene, became brighter, when I activated the specular and diffuse lighting of this lamp.
This is how you fix this brightness.
Click the only shadows checkbox.
As you can see, the brightness is back to normal, because this sun lamp is no longer creating any lighting effect, but only shadows.
But, if you were to deactivate the diffuse lighting effect, the shadows would disappear.
Basically, this lamp will only generate shadows.
You can also control the color of the shadows.
The show shadow box option, will show you the cubic area in which the shadows will be visible.
The shadows will only appear, within this transparent cube.
This convenient tool allows you to see exactly the limitations of your shadow generation.
I will show you how it works.
The shadows disappear when outside that cubic area, but you would not know about it without marking the shadow box option.
You may think you are all done, but there something else I need to show you.
The bigger objects in the distance will not generate shadows, and this will make your scene look incredibly weird.
Such a strange sight, indeed, don't you think so?
Anyway, in the next segment of this tutorial, I will show you how to create some smooth looking viewport shadows, for this entire scene with a cubic area of something like 6 cubic kilometers or so.
You will surely enjoy it, I believe.
That was it for today.
Subscribe, for virtual reality videos, 3D animations, Blender Tutorials and all kinds of content, the likes of which you have never seen before in your entire existence.
This was Metapixelatron, signing off.










