Too-large images may exceed available space, while too-small images may exhibit visible jaggies (unless
you’re aiming for that effect as described above). The ideal size can be calculated based on the
circumference of the iris or the whole eye…
The iris and overall eye size are configurable (shown on following page)…but for example, let’s assume
you’ve got an iris with a 60 pixel radius (120 pixel diameter) and the eyeball has a 125 pixel radius (250
pixel diameter)…both of these are the defaults.
Multiply the iris and/or eye diameters by Pi (3.14) to get the ideal width in pixels for the iris and sclera
images.
For example: iris with 120 pixel diameter. 120 px × 3.14 = 377 pixels wide. You can use that, or round up or
down a smidge to a round number if you like (e.g. 360 or 380 pixels).
Sclera image width for 250 pixel diameter eye: 250 × 3.14 = 785 pixels wide…but again, OK to round up or
down a little…use 800 pixels wide if you like, unless really pressed for space.
The ideal image
heights
are a bit different. First, although the code can
load
any size image, it won’t
actually
benefit
above 128 pixels on the vertical axis, it’s just wasted space. For the iris, use its radius (60
pixels in the case described above) or even a little less, since the pupil is always open a bit. For the
sclera…try 200 minus the iris radius, keeping in mind the 128 pixel recommended maximum (e.g. with a 60
pixel iris, 140 is our target, then cap it at 128). But…with an 800 pixel wide sclera as described above…800
× 128 × 2 = 204 kilobytes…quite a bit over the 160K RAM limit! Whittle down one or both axes, whatever
you think can best handle less resolution, until you find a size that fits. Once in motion, and at a reasonable
viewing distance, minor “jaggies” aren’t that noticeable.
Photoshop users: the eye code maps textures differently than Photoshop’s “Polar Coordinates” filter. Ours
wraps
clockwise,
with the
top
of the image becoming the outer circumference, while Photoshop wraps
counterclockwise,
with the
bottom
becoming the outer circumference. If using Photoshop to create or
preview textures, simply rotate the rectangular image 180°
before
applying a rectangular-to-polar filter, or
after
a polar-to-rectangular filter.
Eyelids
The eyelids have stricter requirements. There are always two files (one each for the upper and lower
eyelids) both 240 × 240 pixels exactly, both 1-bit BMP images
(NOT 24-bit like the texture maps!)
.