This tutorial is mostly about how to take the photos for the color and alpha layers; how you would actually process them in your photo-editing program of choice is up to you. Google for some tutorials if you'd like.
Your end goal is to make a 32-bit TGA (a TGA with transparency) with dimensions 256x256. This looks complicated but once you get used to it, you can process these photos really quickly! (I would know, we have hundreds of fish and I did the photography for almost all of them...)
Okay, first wear your fish and tell it to stop swimming. Turn off bubbles, too.
Rez a copy of your fish in world; we will end up destroying this fish in the process of photographing it! You have a backup copy in your inventory so this should be OK.
Now, IF your fish has simple edges, no transparency shading, is all one color, and you take a really high-res photo... you can just take a photo against a contrasting background, go into your photo editing program, select the background, use that selection to make your alpha channel, resize to 256x256, save as TGA, and stop the tutorial here. The edges might be a bit messy but maybe you don't care.
BUT, this tutorial assumes you're trying for a more detailed image than that. So, continue. :)
If you're using a fin flapping script, any kind of animation, or flexis that react to wind, you'll need to take a few extra steps to make the fish stop moving now. That way you can get two identically-aligned photos later. Edit your fish and choose Tools > Set Scripts to Not Running in selection. If you have flexis flapping around, set them to not flex.
Raise it up a bit so it's easier to get a good angle. Place it against a flat background (an object you've created, so you can change the color.)
Line up your shot so the fish faces left. (Or you can flip it in your photo editing program later, but don't forget that part!)
Change the time of day in SL to noon.
Adjust the fish's background so it matches as much of the fish as possible. This is especially important if the fish has any transparency in the fins. (more on that later.) If you want an absolute match, you might want to make both fish and background be fullbright. Or just make the background fullbright.
Take a screenshot of the full color fish, filling as much of your screen as possible. Be VERY careful not to change your camera angle afterward!
- 1prim-example-color.jpg (33.69 KiB) Viewed 35196 times
(This example is square because I already cropped it, but your picture will presumably be rectangular, may have other crap in the background, etc. Don't worry, we will crop it to square later.)
Now -- still not changing your camera angle, this is tricky -- edit your fish to remove all glow and shine. Tint it black.
Make the photo backdrop white, fullbright.
Take another screencap like so:
- 1prim-example-BW.jpg (28.69 KiB) Viewed 35348 times
If you were careful not to move your camera, these screencaps should line up exactly, which makes life much easier. If you DID move your camera I suggest you delete this fish, rez a fresh one, and repeat the above steps again.
So, now that you've successfully acquired the two matching shots, you can clean up all the stuff inside SL and shut SL down if you have to.
Go into your photo editing program and open the two photos -- the color one and the black and white one.
You want to make these two layers of the same file so when you crop it, it'll still match up. I don't know what program you're using so... consult an expert in that program for help.
Now, most of this fish is green and the transparent spaces in the wings are green because of the background, so it works out nicely. BUT, the wing edges are black. There's a chance I'll get a green halo (faint green line) around the black part of the wings, which you don't want because ... well, *I* don't want it because I'm a perfectionist. ;) Skip this step if you don't care or your fish is already the same color all the way around as the background.
So what you want here is black edges around the black part of the fins, so you have some leeway to knock out that halo. You can select the background and expand the selection a bit, or just freehand. But either way, paint some black around the parts that need to be black:
- 1prim-example-color-blackedge.jpg (36.57 KiB) Viewed 35269 times
It can be messy, no big deal. Notice I left the fish's stomach alone since that's green on green already.
So now... if you haven't done so already, you can crop your photo to be square. Don't cut it too close on any side. If needed, add background to your image so it can be square (nobody will see that background other than the few pixels right around your fish, so don't worry about the color or whatever.)
Resize to 256x256 pixels.
Remember that neglected black-and-white layer in your document? Reveal that now. You want to invert the colors (again, consult your particular program's peculiarities to figure out how to do this. In Photoshop it's control-I). That will make all the black white, and the white black, like so:
- 1prim-example-WB.jpg (28.71 KiB) Viewed 35344 times
If you've done any work with alpha channels before, you'll see that this gives you a perfect alpha mask! The black is transparent, pure white is opaque, and shades in between are various degrees of transparency.
(This is why I recommend TGA rather than PNG... you get nice smooth edges because it allows for all these extra shades of gray...)
So, however this works in your program of choice, use the new white-and-black image to make your alpha channel.
Reveal your color layer again. When you apply your alpha channel, in Photoshop it appears as red. So here's what it looks like in Photoshop at this point:
- 1prim-example-color-with-alpha.jpg (33.87 KiB) Viewed 35292 times
I save it as a 32-bit TGA. The 32-bit is important since that's the transparent part.
Now, upload your pic into Second Life. In the preview it'll look like this, with the checkered background to demonstrate transparency:
- 1prim-example-color-checkered.jpg (44.78 KiB) Viewed 35340 times
See how the middle sections of the wings are still semi-transparent? Nice eh?
Anyway, find the image in your inventory. Set the properties to FULL permissions: mod, copy, trans. This will allow people to use it in aquariums later without actually having a copy of the image. Be sure to never delete this copy of the image from inventory, or all your in-world fish images will break!
Right-click on the image and choose "Copy Asset UUID." It copies an alphanumeric string into your clipboard that looks something like this:
1hhcd8de-166e-4d82-4341-7c79e9e4be40
That's the UUID you'll put into the OpenSeas driver script for your fish (once that script is available.)
So, wear the nice clean ready-to-go version of the fish that is still in your inventory. Plug that number into the script, reset the script, save it.
Take the fish off, wait five seconds to make sure SL really saves what you just did, and wear the fish again. This usually causes the rotation to start back up again, but you might want to turn bubbles back on too.
Click the fish and try loading it into a nearby aquarium. It should work! :D
Hope this helps. Please make suggestions and I'll revise this top post to clarify!