Tip:
Highlight text to annotate it
X
In this first tutorial about creating plants in the blender game engine i will show you how to create the most simple of them,
meaning: Farn.
Something general before starting:
Plants are very important,
because without plants this scene would look very lifeless and un-natural,
if we take a look at the scene
again, but without plants:
it simply dosen't look very realistic
because in reality plants grow in places like this
which is why we have to create them here.
I am sure this looks way more complicated as it actually is.
First of all, i am only selecting the layers i need right now,
and simply begin with the plants.
For farn and other plants like this you only need the right texture
and the rest is only making it right and fitting the scene.
For the farn i am beginning with a plane
which i will place in the room, so i can see it better.
Now we need to prepare the plane a little bit,
like placing the center of the object to one of the edges,
because if we would scale it at one of the axis the plane will scale from the middle,
but if we go into edit mode and drang it on the Y-axis while holding SHIFT (and exit the edit mode again of course)
we only scale it from this edge, which will be an advantage later on.
Now i will scale it on the Y-axis a little bit (my values during the videos were irrelevant)
in order to approximately fit the size of the leave.
Now i will create a new material.
Click on the "+" to create a new material and name it like the plant you want to create, in this case, i will name it "farn".
As a litte tip: Just place your cursor over the name and hit "STRG+C" without clicking in the box itself
and when creating the texture you can simply place the cursor over the box and hit "STRG+V" and you will have the same name.
Here of course change the type from "clouds" to "image or movie"
and open up the image you want.
I will take one from "CGTextures.com"
...plants and such stuff...
...in this case...this one.
And now i see i got the wrong dimensions for the plane (So adjust it!), and i better want to uv-unwrap it,
so i will open a "uv-image editor"-window.
And just one more little tip: If you have this much images like me currently in your scene right now
simply copy the name of your texture, paste it right here and immediately you will have the right image without searching it so long.
Now i will simply unwrap it ("U" in edit mode) from "projection from view",
scale it, so it will fit the image, and of course say blender that it should use the uv coordinates for the mapping method.
Now i will place it that the bottom of the image will be at the bottom of the farn.
Empty regions are okay.
*messing around with the right size*
Anyway, let's make some more settings in the material (and/or texture) panel,
like activating bump-mapping ("geometry"),
but in the most cases, if you use the default method, it won't look very good,
of course you COULD use an extra bump-map texture, but i won't make this kind of extra-work.
I simply change the "space" from "object space" to "texture space", in general (always) i get better results with that.
Now i will use a good-looking value, in this case...1.5 should be okay.
*useless stuff, but i get nervous when i don't do it*
For the specularity we will change the "intensity" (0,25 )and the "hardness" (100).
Of coure the images you will use should have an alpha-channel, most ones (for plants) will have one,
just activate "alpha"
switch over to the material settings, check "transparency" und underneath "z-transparency" turn down the alpha value completely.
The BGE (blender game engine) should be able to calculate realtime alpha-shadows for most images (of course, a newer blender-version is required).
If not, you can do a lot there with cycles, but this is not the topic right now.
Now we go into edit mode, create a now loopcut using "STRG+R", pull the created edge up, create another one in the middle, another one here,
in order to stop the texture from being stretched, simply (I say this a lot...) drag the edges around here, so we can delete this problem, now i will drag this one over here and create another loopcut (and place it right, of course).
Now, i will bring up this toolbar in the 3D-viewport by pressing "T" and change the shading from "flat" (what it is right now) to "smooth", just to dosen't make it look blocky.
We will see the farn from above, but not from underneath, to change that, simply (There it is again!) go to the material settings and deactivate the "backface culling".
Now that we have one leave ready, the rest is fairly easy.
Because we made the center of the object to be at the starting point of the leave, we can just copy this, scale it a bit, rotate it a bit (use normal rotating ("R") and free rotate mode (press "R" twice).
You shouldn't work quite accurately with plants, because this will destroy the natural look.
Once you have all this, you can now copy it, make it a little bit smaller and rotate it a bit on the z-axis (from above).
In general, you now have your farn.
Now, you can join these objects together by selecting them all and pressing "STRG+J". (You can work better with the farn if it is one peace.)
But now you can notice some wierd shadow and/or alpha-problems, if we take a closer look to it. This is because of the blending-method, just change "opaque" to "alpha clip".
As far as i know, this takes a little more perormance (which is probably wrong).
The rest now is about placing the farn in the right place, you can use it as a placeholder or to cover ugly edges in your scene.
With the right 2D-Shaders for (more of that in the description) (or baked) ambient occlusion you can place it in this areas, which will look more natural (since farn grows mostly in the shadows) and casting nice environment-"shadows" in the area around it,
what will make the corner look less faked and simple.
Here for example you can see how this fits in the environment, becasue this is kind of the usual place of farns.
Thanks to the ambient occlusion from the script we have some nice, let's call it, shadows,
And now you will only have to copy this farn, change the size and rottion a bit, and place it in a good place.
Of course you can make 2 (or more) farns, one for empty space and one specially for corners, but this should it be it for the farn!
I am just taking another look to it, and we can see that this corners (and the other one i don't know the name) look now way better than before.
Using this method, you can create a lot of different plants to make your level look nicer, and someday i will make another part about other plants.