Documente Academic
Documente Profesional
Documente Cultură
indigo (though the technique is the same with any other modelling software).
See a good example of what you can produce here.
Nothing really fancy here, but as a blender user it's been a long time I was waiting for a
blender-compatible renderer to work with alpha maps, as it's the best way to produce
good-looking vegetation.
Also for the moment you'll have to hand-edit the XML file produced by the exporter at
some point, as I didn't get it to export blended materials correctly (it's still in beta
stage).
So you need :
indigo 0.7 t3
blender exporter 0.7 t3 beta 1
blender 2.40+
and if you've got a blender version prior to 2.43 RC, download this script : randomize
(unzip it and copy the python file in ../blender/.blender/scripts)
0. How it works
You apply the alpha map to the original image : only the black part of the alpha-map
appears in the final blended material.
Here are the two images I used for this tutorial (I got them from this tutorial)
You can find some royalty-free images at www.sxc.h, but I suggest you take your
camera and make pictures of your own to get real fine looking images.
1. Create the basic uv-mapped plane in blender
ADVANCED USERS :
Create 2 planes with diffuse material like the picture above, put a
UV texture on the grass-mesh, and go directly to the step 2!
• In top view, add a plane. Keep the original 1x1 size (as I understood, 1 unit in
blender is equal to 1 meter in indigo, so this is fine for this tutorial).
• Create a new material, call it like you want (here : ground) Put spec=0, and
hard=300.
• Choose a color close to the grass image you're going to use.
b) Then create the basic grass mesh.
It will be a white diffuse material with a UV-mapped texture.
• You must have at least two windows : one in 3d-view (front view), the other in
UV/image editor mode. In that last one, choose image --> open and pick up the
grass image.
• Switch to UV select mode, in front view, press U, select Project from view
(Bounds).
That's it, your plane is now UV-mapped. You can see the result by pressing ALT + Z
2. Duplicate the base mesh and add some randomness
You could be tented to use the array modifier, but I advice you not to do so.
Instead duplicate it using ALT + D, this will activate instancing in indigo, and speed up
render times. Put the ground-mesh in another layer, and in top view duplicate the
grass-mesh the way below.
For that we'll use a very usefull script : « randomize Size Loc Rot ».
• Select all the grass-meshes, press object --> scripts --> randomize Size Loc Rot
First, we'll change each mesh location a little : (after pressing ok, you'll notice that the Z
position has changed, even if you didn't select « Z axis » in the script... well it doesn't
matter, we'll fix that afterward)
Then run the script again, and change each mesh rotation like this :
And to finish, we'll change each mesh size : (don't forget to press « link axis », each
axis must have the same dimension).
Play with this script a while, this can drasticallly change the aspect of the final grass.
And of course you can change the three values at the same time, you don't need to run
the script three times.
Now if you take a look in front view, you'll notice the meshes are not on the ground
anymore.
Let's fix this.
Go in front view.
Put your cursor at the ground level (select the ground-plane, SHIFT + S and
cursor -- > selection, choose cursor as the pivot point, and press move object center
only just next to it)
Now press S for scale, and 0 (zero on the keyboard). That's it, the grass is back in
place.
Add a sunlamp to your scene, a camera, and make a render to see what it looks like so
far. Don't forget to press separate materials
And you should get something like this :
3. Hand-edit the XML file to get a blended material
As for the moment there isn't any official indigo 0.7 version nor 0.7 official exporter,
you cannot get a blended material directly from blender. This will change in the near
future, but for the moment, you'll haveto hand edit the materials XML file
It should be located in the same folder as your .blend file. Its name is something like
xxx-materials.xml
You can edit it with the notepad, or any text editor, provided it's a very small file. (I
recommand XML-marker to edit bigger files, it's free and fast).
You'll have to make changes like in the pictures below, wich I hope speaks by itself :
(some explanations under)
If you're familiar with HTML and XML files, you should not have any problem.
If you've never edited any XML file before, this is a good occasion to see how indigo
« reads » material. It's quite simple.
To be quick, you can read it this way :
<material>
<name>grassnoalpha</name>
<diffuse>
<colour>1.000 1.000 1.000</colour>
<albedo_texture>
<uv_set>uv</uv_set>
<path>herbe0.jpg</path>
<exponent>2.300000</exponent>
</albedo_texture>
</diffuse>
</material>
<material>
<name>null</name>
<null_material>
</material>
<material>
<name>grass</name>
<blend>
<a_name>grassnoalpha</a_name>
<b_name>null</b_name>
<blend_factor>uv</blend_factor>
<blend_map>
<uv_set>uv</uv_set>
<path>herbe0a.jpg</path>
<exponent>1.000000</exponent>
</blend_map>
</blend>
</material>
4. Render !
That's it ! Save your file and render
5. Further words
Hopefully with the release of the final indigo 0.7, we will have an official exporter for
blender, that will manage blended material correctly, and the whole process will be
faster and easier.
I'll update that tutorial at the moment.
I hope that helped, and if you have any suggestions to improve it, just tell it on the
forum and I'll update it.