משתמש:DanAvner/ארגז חול

ליפנית

====[[/מנוע המשחק/]]==== *[[/הכרת יסודות הממשק/]] *[[/שמו על הכדור/]] - משחק פשוט שמלמד את היסודות



לזכור בעיין עריכה

למחוק קוביה,
לסמן "בחר נראים בלבד"
הרישתית צריכה להיות שקופה בוהקת
ככול הידוע לי אי אפשר לצבוע פאה אחת בכמה צבעים

לתרגם את: עריכה

Adding the textures


  1. First, switch to editing mode and change the select mode to Face

select. (Oh, and switch off proportional editing if it's still on from the last section)

  1. Press A a couple of times to ensure nothing is selected.
  2. Press Z to switch off wireframe; this will be easier without it.
  3. Place the mouse pointer in the centre of one of the faces on the

outside layer of the eye and press “L” to select linked faces. If you get a message saying “Nothing Indicated” try positioning the pointer on a different face and try again.

  1. Once the cornea section is selected in

the “Links and Materials” panel of the editing buttons, click “New”. The counter above it will change to “1 Mat 1” best read as material 1 of 1. Click “Assign” to assign the cornea faces to material 1.

  1. Hide the cornea faces (H-Key). We'll

assign the rest from the outside in. If a face is already assigned to a material and it is assigned to another, it just switches place. Therefore, it's easiest next to assign all the visible faces.

  1. Press A to select all and, as above, click “New” then click “Assign”.
  2. Now for the iris and pupil. Hit A to deselect all.
  3. Switch to a front view and zoom in. Hit “B” twice to enable paint select and

select the central faces plus one ring out. You can control the size of the selector by rotating your mouse wheel.

  1. Again, create a “New” material index and “Assign” the pupil faces to it.
  2. Finally, click A to deselect all and use paint select again to select the remaining

faces on the iris. Assign them to a new material.

  1. Now we're ready to make the materials. Switch to object mode (Tab). Change

to the object editing buttons and in the Draw panel, locate the “Transp” control. Set this on. This means as we go we'll be able to see through the cornea.

Cornea Material

We'll start with the simplest texture first. The cornea is basically just colourless and transparent. Note that we're using Z-Transparency instead of Ray Trans. This is because some lighting conditions make the eye under the cornea difficult to see.

White Material

The white of the eye's a little trickier. The material here includes some red veins that can be seen at the side of the eye, but not from the front. This can be done with two textures, but there's a cheat we can use. First, the veins: Switch to Material Index 2 (In the Links and Materials panel, click the right arrow so it reads “4 Mat 2” or Material 2 of 4). Click the cross next to the material name and add a new material. Go to the texture buttons: Using a marble texture, copy these settings. The two colour band items are shown here separately. This makes a nice marble texture that will evenly cover the eyeball. So how to hide it from the front of the ball? Another colour band trick, but this time in the material itself. Here they are in all their glory. The colour band items are both white with one alpha 0.0 and one alpha 1.0. As you can see they are very close together to give a fairly clear line that the veins will stop at. The input setting for the band is set to “Normal” this means the left hand side of the band refers to faces that are parallel to the camera view and the right is faces that are facing directly towards the camera. I've also added a bit of mirroring so that we get a little scenery reflected! There's also some colour band fun to be had with the pupil material.

Pupil Material

I wanted a nice black texture, but I also wanted to get a red-eye effect if a light is shone directly at it from behind the camera. Why? I guess just because I can, and now so can you! As before move to the next material index and create a new material. There's no textures in this one. It's basically black and a little reflective with a nice hard specular. Have a good look at the colour band settings though! Position 1 is black with an alpha of 0 and positioned at 0.97. Trust me on this setting, it took a while to get it right! The second is all the way across at position 1 and is fully red (with no blue or green) and alpha 1. We want the red-eye to respond to light not angle like the white of the eye, so set the colour band input to “Shader”. Now the bit you've all been waiting for – the iris!

Iris UV Map

Save your work and grab a cup of coffee for this part. It's a little involved. We need the texture to stay glued to the mesh irrespective of the shape of the mesh. This gives the effect of the muscles in the iris expanding and contracting. In a nutshell, we're going to UV map a procedural texture to a single part of the mesh. OK, here we go. Switch to a material editing window. You'll need to be able to see both a 3D window and an image window. It wouldn't hurt to see a buttons panel as well. My material screen kind of looks like this. Make sure the window is displaying a front view (Keypad-1) this will be important when we unwrap the bit we're going to use. Change the 3D window to mesh editing / face select and use the brush select (B-Key twice) to select the iris faces. Now change to UV Face Select mode. The faces should remain selected. With the cursor in the 3D window, press “U-Key” for unwrap and select “Project from View”. The image window should now contain a nice even circle of dots. Put the cursor in the image window and press “A” to select all the points. Scale and move them until they fit nicely in the outer square of the image grid. Now select each ring in turn using brush select, starting from the innermost, and scale them until they cover from the centre to the outside of the image grid as shown. Now we've got a map, lets get a texture. Switch back to a modelling screen and change to object mode for the next part.

Iris Material

Firstly, a texture to control the colour blend across the iris. Generally it starts on the outer edge dark and gets lighter as it moves to the centre. Sound like a job for the blend texture. The texture itself is fairly straight forward, but again, the colour band is where the magic happens. I've pictured all three stops in the colour band. Note the alpha values. This blend texture is meant to tint the iris texture so it's lighter in the centre and darker in the outside. Now for that iris texture: I stumbled over this texture almost by accident when I was working on a different project. Copy the settings as they appear here. Note: the colour band points are black with alpha 0 and white with alpha 1. This allows the material colour to come through the texture, so we can set the main eye colour in the material buttons. The main colour is blue which sets the colour of the iris. The centre colour comes from the texture settings: The blend texture is applied to the UV map input. The green colour is used as a lighten mix to tint the iris near the centre. Using the Stencil option allows the other texture to show through. The iris texture is applied to UV again and some normal as well as colour is applied. This makes some small shadows in the iris when the light is from the side. Add some lights and have a look at your eyeball so far.

Pupil Dilation

We're going to use shape keys to create the pupil effects. We're going to create a normal eye and a cat's eye. Fortunately, the fully dilated eye is the same in both cases so that's going to be our shape key basis. Go to the edit buttons and select the Shape Key panel. Make sure “Relative” is selected and click “Add Shape Key” to create the base shape. Switch to edit mode, point selection. Select just the first loop in of the iris. To select an edge loop in point mode, place the cursor on a line between two points that's on the loop and Alt-Right Click. Shift + Alt-RClick will add the selected loop to what's already selected. Now scale this to just inside the width of the loop that the iris shares with the white.. Now do the same with each of the other two loops. This should produce a nice dilated pupil. Hint: If you scale the inner loop out, but the edge of the colour doesn't follow it exactly, drop it and hit Shift-E, then move the pointer to the right. This causes the subsurfaced mesh to closer follow the selected edge. Now to create the normal (human) pupil shape. Switch to object mode (Tab) and add a new shape key. Name it “Normal Pupil Contract” Now grab the edge loop between the pupil and the iris. Scale is down so it's just a little bigger than the loop in the pupil. Select all the points in the pupil as well now and scale them all very small. Now select the next loop out and scale it down, followed by the final edge loop. It should look like this. Now switch back to object mode and try the shape key slider out. Pretty neat huh? Let's make a cat's eye now. Switch shape keys back to “Basis” and add a new shape key called ”Cat Pupil”. Use the same method as before to scale the edge loops. As you scale, restrict your scaling to the X axis (That is “S” then “X”). You should end up with a shape key like this: That's pretty much it. Try some other things like rotating iris edge loops in the shape keys for spiral eyes, or weird shapes for the contracted pupil. Don't forget to save – and enjoy!