3D Game Development with Microsoft Silverlight 3: Beginner's Guide — Save 50%
A practical guide to creating real-time responsive online 3D games in Silverlight 3 using C#, XBAP WPF, XAML, Balder, and Farseer Physics Engine
This is the second part of the two part article series by Reynante Martinez. In this article series, we will learn how to digitally sketch/draw your scenes, give them subtle color shifts, add fake lighting, and apply filter effects to further emulate how 3D does its job in a step by step process. Read Creating Pseudo-3D Imagery with GIMP: Part 1 here.
The next step would be to play around with Layer Modes which, I believe, is one of the most exciting aspects of graphic design. Let's leave layer “lower shine” for awhile and let's get back to layer “upper shine”, and change its layer mode to make it look more appealing and following a scheme in accordance to the color of the sphere. To do this, let's select “upper shine” layer on the Layers Window and right above the Opacity Slider is a dropdown menu containing lots of interesting layer modes, each having its own distinct advantages. You can play around and choose whichever suits your vision the best. I chose Overlay for that matter. Ever since I've started GIMPing, this layer mode has been my best friend for a couple of years already, it works like a charm most of the time. I wonder though why on some applications, applying the overlay layer mode does different results. As in the case of Photoshop, the closest I could get with GIMP's overlay is the Screen mode. You've got to play around a bit and see which works best for you.
Do the same thing for the “lower shine” layer, choosing Overlay as the layer mode. Then, whenever you see fit, you can duplicate the layers to achieve a multiplied effect of the mode. I did that because it felt that something was still missing in the luminous aspect of the shine. So I selected each layer, duplicated them both and voila. To duplicate a layer, you can either right click on the layer name and choose Duplicate Layer from the choices or just press the Duplicate Button on the bottom part of the Layers Window.
Next, we'll add additional highlights to better emulate specular reflections. And again, we're exploiting the Ellipse Select Tool and another new technique called Feathering. I don't know exactly the definition of feathering in CG, but as far as my experience goes, feathering is a technique from sets of tools where you soften the edges of a selection creating a subtle transition and blurred edges.
Create a new layer at the top of the layer stack and call it “blurred shine”, then give it a Layer Fill Type of Transparency, just like what we did with the previous layers. And with layer 'blurred shine” active, let's create an elliptical selection on the upper left hand part of the sphere, just where the sharp shine has been cast.
Creating the Specular Selection
With the selection active, right click on the Image Window and choose Select > Feather, then input a value for the feather and the unit to be used. I used 50 pixels. You might have noticed now that the selection seemed to have become smaller, and that's alright, that means you've done it right. And with the marching ants still active, grab the Bucket Fill Tool over at the Toolbox Window or press SHIFT + B to activate it. Change your foreground color to something close to white or simply pure white, then with the Bucket Fill Tool active, click on the active selection. Tadaaaa! You just created a replica of a specular highlight, though not so close enough. What's great about feathering selections as opposed to applying a blur filter is that you only blur the selection border and not the entire selection.
So, say, you have a picture of yourself and you wanted your face fade out smoothly on a vast landscape that you have photographed. Simply create a selection around your face, then apply a Feather to that selection, invert the selection and delete the outer parts, thus leaving only your face and the landscape behind (supposing you have your picture on a separate layer above the landscape layer.)
Feathering the Selection
Applying the Color with the Bucket Fill
Whew, that was pretty quick, isn't it? I hope you agree with me on that. If so, let's create another one, though smaller and placed just on the left of the blurred shine. Create a new layer for this new blurred shine and name it “small blurred shine”. Follow the same procedure for the feathering and color-filling. I used the same feather value for the smaller selection (even though it obviously is smaller), just so it almost affects the center of the selection, blurring the whole selection already, which is what I like for this part.
And then, just like what we did with the upper and lower shine respectively, we'll change the Layer Modes to Overlay and duplicate the layers as we see fit. Doing so results in this image:
Blurred Shines Overlay
Our sphere now looks a lot better than it had been when we first added its color. However, the shading still looks a bit flat and volumeless. To deal with that, we'll simulate the strength with which the light diffused our sphere object, creating deeper shadows on the opposite side of the light source.
Duplication of layers is not only a matter of multiplying the effects of layer effects or such, but it can also be a good way to trace your changes, or better yet, as safe backups where working on the duplicate doesn't affect the original one and you can go back each time to the untouched layer anytime you want to see the differences that have been made. But be careful though, the more layers and contents of each layer you have, the more computing memory will be consumed and will eventually cause a system slow down.
Let's select the “sphere” layer and duplicate in once. Automatically, the duplicate layer which is now named “sphere copy” becomes the active layer. Right Click on “sphere copy” layer and choose Alpha to Selection to create a selection out of the fully opaque sphere.
Next step is to shrink the selection such that we create a smaller elliptical selection inside the sphere. To do this, right click on the Image Window and choose Select > Shrink. Then on the pop up window that appears, type in an appropriate value for the shrinking. I chose 50 pixels.
Shrinking the Selection
Remember how we moved the selection last time? I believe you do. To translate/move our selection, grab the Ellipse Select Tool and activate the selection by clicking on it (clicking the middle portion of the selection makes this easier) until you see your cursor change into crossed arrows, this means you have just activated the move tool for the selection.
And since the light is coming from the upper left direction, we would want to move the selection over to the location where the specular reflections are and where the lightest shading is. Thats because later on, we'll be using this same selection to create shadows on the opposite side of the shade. Now go ahead and drag the selection over to the upper left portion of the sphere.
eBook Price: $29.99
Book Price: $49.99
Moving the Selection
Now that we have successfully moved the selection and is still currently active (with the visibility of the “marching ants”), right click on the Image Window and choose Select > Invert. What this does is it inverts the selection. So instead of having the selection affect the inside of the ellipse, it will now affect the outside part of it. You'll notice the marching ants are now affecting the image border as well.
Inverting the Selection
While the inverted selection is still active, do a right click, choose Select > Feather, and enter something large so the border of the selection would be blurred by a greater factor. Here, I entered 100 pixels. After successfully feathering the selection, we now darken the opposite side of the sphere, which happens to be part of our current selection. To do this, right click on the Image Window then select Colors > Brightness-Contrast. Play around with the Brightness and Contrast values until you see the opposite side of the sphere darkened enough but still recognizably subtle. You'll notice that as you input values or move the sliders, it is being reflected on to the image as well.
Feathering the Selection
Adjusting the Brightness-Contrast
Resulting in this image:
With Brightness-Contrast Applied
So far, our image now looks like it's done already. The only things left for us to do is to add some effects, filters, and some secondary objects to fill out our empty space. As in our case (and I wouldn't want to bore you with this), we'll just create two more spheres. We have two options of doing this: 1) repeat the steps we did in creating the sphere (with the shines, shadows, etc.) or 2) we can create a Duplicate of our current image, change some colors as necessary, merge the layers on the duplicate file, then import them back on the original image file but on a different layer. Whichever seems easy and convenient to you, both processes yield to the same result. Since the first option has already been done on the steps we did before, it's just a matter of repeating them again. As for the second option, I'll be guiding you to it.
Now that we have everything set for this image, all we have to do now is to activate the Image Window, choose Image on the menu bar, then click Duplicate, or simply press CTRL +D on the Image Window. A new image window will appear with an untitled filename. You'll notice that it has the same order and number of layers and that is exactly what we need for that.
New Duplicate Image File
While the Duplicate Image is active, go to the Layers Window and delete “black bg” and “Background” layers respectively, because we'll only be needing the information that the sphere has and not the background layers. After deleting the two layers, right click on any of the layers remaining then click Merge Visible Layers, then on the pop-up window that appears, choose Exapanded as Necessary. What this does is it flattens out all layers that are visible (indicated by the eye icon on the left of the layer) and maintains the alpha/transparency values.
Merging the Visible Layers
Once the layers are merged, indicated by the Layers Window as only having a single layer now, press CTRL + C on the Image Window or go to Edit > Copy. This copies to the buffer whatever is being seen on the current layer (including alpha values). After copying, let's go back to our original image and create a new layer above layer “black bg” and name it “second sphere” with layer fill type of transparency. This time you might have already done our next steps. But to those who haven't yet, here it is: do a CTRL + V on the Image Window or go to Edit > Paste to paste the image from the buffer, then use one of the Selection Tools and click outside the active selection to anchor/deselect the image selection (indicated by an anchor icon beside the cursor).
But you might have noticed that the new sphere has the same exact location as that of our original sphere and is hardly seen from our view since it is being occluded by the layer on top of it. To move this new layer, click on the Move Tool on the Toolbox Window or press M. Then on the tool options on the lower half of the Toolbox Window, choose “Move the active layer” as the option.
Get back to the Image Window and click drag on layer “second sphere” to move it to the right.
Moving layer “second sphere”
However, we want to create a feeling of depth into the scene and scaling down this layer might be a quick way to it, and so we will. To scale layer “second sphere”, select the Scale Tool from the Toolbox Window or press SHIFT + T to activate the tool. Then leave all tool options as is except for the Keep aspect option, which should be turned on. Click and drag on the layer and scale it accordingly.
Scaling layer “second sphere”
After scaling has been done, the translation and offset might be a bit not where we want it to be, so go ahead and use the Move Tool again to move this layer in an appropriate location, as seen below:
“second sphere” new location
I just can't take it seeing only two “balls” on the screen right now, so doing the preceding steps again, we'll make another small sphere and place it on the right-most part, like this (remember to create a new layer above “black bg” layer and name it accordingly):
New Sphere on layer “third sphere”
Now some reflections! I suppose you still remember the steps we did in merging and copying the merged layers of the original-sized sphere, because we'll need that for our first reflection.
Create a new layer named “sphere reflection” below layer “sphere” with layer fill type of transparency. Paste the merged layer with the original-sized sphere on layer “sphere reflection”. Once the image is on its rightful layer, activate the Flip Tool on the Toolbox Window or just press CTRL + F then choose the option Vertical to flip it vertically, thus creating a reversed look. To flip the layer, just click on it while on the Image Window. Tadaa! Then offset the reflections-to-be so they'd be just below the original and unflipped layers. As for the other layers (“second sphere” and “third sphere”), simply duplicate them and rename the layers accordingly then move the layers below their respective original ones. With everything set and all the flipping and locations done, here's how it should look like:
Spheres with Reflection
They aren't bad, are they? There's still some things missing though. We'll treat them one by one. First thing we have to do is to darken the reflections to give it a more reflective look (uh?). We'll do that by selecting the reflection layers one by one and bringing up the Brightness-Contrast menu which can be found by right clicking on the image window, choosing Colors, then Brightness-Contrast.
eBook Price: $29.99
Book Price: $49.99
After successfully doing so, here's my result:
We're almost there, just some more enhancements here and there. Now, let's simulate DoF (Depth of Field) which I love the most here. DoF is one good way to make the viewers lead to where the subject and focus is. Where the subject in focus stays sharp and the rest blurred. The farther the object is the blurrier it gets. That's pretty easy to achieve here, and we'll be very happy with the results, I bet.
First, let's blur layer “second sphere”. How? GIMP's filters! Go ahead and activate layer “second sphere” and on the Image Window, click Filters on the menu, then Blur > Gaussian Blur. A pop-up will appear showing a preview of the blurring process and input boxes and options for you to manipulate. Do as you wish here; just make sure it will look good when applied. You'll see my settings below:
Gaussian Blur Filter
Gaussian Blur Settings
Repeat the same process for the rest of the layers that needed blurring and adjust the blur radius accordingly
Lastly (man, that was lengthy!), we'll finally duplicate our entire image and create a new one with which we'll merge everything into one layer and apply subtle effects and color adjustments. Do a CTRL + D on the Image Window to duplicate the image, then with the new image active, activate the Layers Window, select any of the layers, right click, and finally select Flatten Image. Now there's our image in its glorified single layer and nothing else to worry about.
Let's do some quick color adjustments by using the Brightness-Contrast and the Color Curves function which can be found by right clicking on the Image Window, select Colors > Curves. You just have to play around and have fun here, judging which looks the best to you and to your prospect viewers. I achieved something like this (which I do hope we have the same thing [almost]):
After Applying Brightness-Conrast and Color Curves
Finally (how many times have I said this word already? My oh my!), we'll be adding a cool (yeah, cool) effect known as lens flare to simulate light bouncing off the surface of the sphere which hits our [imaginary] lens parallel to the bounced light.
Just to be safe, let's duplicate the only layer we have (now we have 2, yikes!). Activate the Image Window and click on Filters under the menu, then go to Light and Shadow > Lens Flare. And yet again, nothing beats the “playing around and having fun” technique here. Judge it with your eyes, confirm your settings, press OK, and let's call it done! Congratulations! And a tap on our backs! But wait, don't forget to save your final image NOT in XCF format, but in a more readable and compatible format. You might want to choose between JPG and PNG, depending on your preference. Do this by going to File > Save As, and choose the proper filetype filter.
Here's what we should have:
Final Image ^_^
And here's a little something just to add a little touch to it:
Spheres with Suzanne
After the lengthy reading and whining, we're finally done with creating our pseudo-3d image. So far what we have learned are the following:
- planning your work beforehand
- creating an appropriate canvas
- layer modes
- layers as backups
- selection tools
- color transition and theory
- faking Depth of Field
- faking reflections
- general composition
- simple post processing
I hope you've had fun reading my article as much as I had writing this. If you have any further questions, clarifications, comments, and/or suggestions, feel free to contact me or check me at my blog http://www.reynantem.blogspot.com. Have fun!
If you have read this article you may be interested to view :
About the Author :
Reynante Martinez is a self-learnt graphic designer, illustrator, web designer, and 3D generalist. His interest in CG started nine years ago and was directly introduced to The GIMP as one of the open source image editing applications available in Linux. Aside from being an animator at work, he also has experience in mentoring and has been a speaker and workshop conductor at several occasions during the past few years. He is also the co-founder of PinoyBlender, a Filipino Blender User Group. Since his discovery of Blender six years ago, his passion for CG art grew even more, with more upgrades coming now and then and with an active and helpful community of Blender artists being one of the most exciting factors in his career. He can be reached through the email above or through his weblog and you can also view his online gallery.
Books From Packt