Jump to content

Photoshop, Alpha Masks and Drop Shadows


Recommended Posts

I have looked all over the web for this and I never seem to find the right information OR the right solution that works as it says.

So here is what I am TRYING to do.

 

I am making an image, that has a drop shadow, I have to use an alpha mask around it and I want a drop shadow behind it. You would think, easy enough right? Well, the problem I am having is when I do the alpha masking around it, it doesn't take in consideration for the drop shadow. I did try another way but when I can get that, it doesn't keep the transparency to semi transparency of the dro shadow, it ultimately ends up like a drop shadow surrounded slightly by white and everything outside that is transparently covered by the alpha mask. So, I am stuck. And yes, uploading as TGA.

I swear, I've done this right before, for the life of me I can't figure out how. I have Photoshop CS5

Snapshot_004.png

Any help is appreciated.. before.. I eat puppies and throw rocks lol

Link to comment
Share on other sites

It could really be there, you may be running into the viewer's automatic alpha mode switching. On the inworld editor, see what happens if you set the transparency for that face to 1%.

Those look like tiles, sure you really want alpha on those in the first place? Alpha floors and walls tend to lead straight into the land of glitches. :/

 
Link to comment
Share on other sites

It's a multi frame picture, the alpha mask is to cover around it otherwise, I get a picture with a white background that I don't want. It's just on a basic prim at the moment. I don't want my whole texture going transparent, even 1%, isn't waht I want to do.

I see this done all the time in items, I just don't get why I can't get it to work myself.

 

Trying to learn to do this, so when I do a photo for someone on SL, they can have thier photo this way, but I was running into issues trying to figure it out to begin with.

 

The drop shadow is properly transparent on photoshop, it just doesn't continue to here. Or I just don't know how to create a mask thta will work with the drop shadow

Link to comment
Share on other sites

You have to create the drop shadow first, then cut and paste it into your alpha channel.  That way, the alpha channel image will grade properly from white (behind your image) to black, matching the gradual shading of your drop shadow.  Depending on how you do the drop shadow, you may end up having to create that alpha channel image by doing a composite of two or more cut and pasted selections from different layers in your file.

Link to comment
Share on other sites

In all likelihodd your texture is fine. The rounded edges show that you are getting an alpha channel, and it really does look like you are dealing with the viewer's automatic alpha mask mode.

In this image, I am using the exact same texture on the exact same prim. On the left, I've forced alpha blending mode, and on the right I've forced alpha masking. Note that it looks exactly like what you're getting, even though the texture itself has a translucent shadow.

blend-vs-mask.jpg

 
 
Link to comment
Share on other sites

OK, here's one way to do it.  You don't create your drop shadow with the Photoshop Layer Style >>> Drop Shadow tool. You follow a process like this:

First, create the image you want to have as your foreground

First.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Then, use your Rectangular Marquee tool with Feather set to 10px, so that it will create a soft marquee. Make an appropriate rectangle on the Background layer, so that it's underneath the layer you created in the first step and offset a bit, like this:

Second.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now, use Layer From Background to convert the Background layer to a normal layer and then Edit >>.. Copy to copy that layer.  Open your Channels palette, create a new Alpha channel, and paste the copied layer into that new channel:

Third.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Type CTRL + I  (or Image >>>. Adjustments >>> Invert) to reverse black for white:

Fifth.jpg

Then go back to your Layers palette, open the layer that has your original foreground image on it,  select all pixels, and then use Select >> Save Selection to save that selection to your existing Alpha channel.   Before you click the OK button, though, click the little radio button to Add to Channel:

Fifth.jpg


Your alpha channel should now look like this:

Final image.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

When you save your file, upload it, and put it on a prim in world, it should look like this (The uploaded image is the red square plus its drop shadow.  The plywood behind it is a backdrop, not part of the image.):

Final image.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

This process doesn't take very long and with practice it gives you a pretty decent-looking drop shadow like the one you are trying to produce.

Link to comment
Share on other sites

I'm not in PS at the moment, and it's been years since I've done this, but here's how I think I'd do what you want. For example's sake, let's say you want a 480x480 pixel image with 32 pixel wide drop shadow on the right and bottom, and no shadow on the top and left, making a full 512x512 texture.

Start by making the alpha channel. I think you click in the channel column of the layer palette and click something on the bottom to make a new alpha channel. I believe it defaults to black, which is full transparent. (I can never remember if black is transparent, or if white is, so if I got it wrong, reverse black and white in everything I say).

Now, you want your artwork to be fully opaque, and the shadow to go from opaque at the artwork edge to transparent at the texture edge. To make such a gradient, create a fixed size 480x480 pixel marquee and move it 16 pixels right and down from the top left corner of the canvas.

Next, you want to fill the marquee with white, using the bucket tool (and I think you have to click the B/W icon somewhere in the lower left to do that, or use the color picker to get white paint).

Now you have a white (opaque) rectangle centered on you canvas, and you want to fuzz the edges to make the drop shadow gradient. Select the entire image, open the Gaussian Blur filter, set the radius to 16 pixels (half the shadow width). Now you have a shadow gradient 32 pixels wide, on all sides.

But you want your image in the upper left, fully opaque, so you pull up the marquee again, locate it in the upper left and fill it with white. This paints over the shadow on the left and top edges of the image.

Your alpha channel is complete, now return to the Layers tab and fill the entire image with black, the color of your shadow. Open your artwork document and crop/scale it down to 480x480, then copy it into the upper left of your new texture document, then make sure the new alpha channel is enabled. In the layer view, you should see your artwork, with the red alpha highlight over the black areas on the right and bottom of the image.

If you export that as TGA, the artwork area of the texture will be opaque, and the black border will go from opaque near the artwork to transparent at the texture edge.

If you want a softer shadow, you can adjust the levels/curves of the alpha channel just after applying the gaussian blur and just before painting in the white marquee in the upper left. If you darken the alpha channel, the shadow becomes softer. But you must do that before painting in the fully opaque area with the marquee, or your artwork will become translucent.

You may find Rolig's way easier, as her example is a hell of a lot easier to follow than mine.

Good luck!

Link to comment
Share on other sites

That's mostly because I wasn't being quite as careful as I should have been.  You can get rid of that by gently blurring edges on the alpha channel image (make them little darker) or simply by using a smaller feathering setting when you make the drop shadow itself. Each time you try this you discover new subtleties, ways to alter the shadow color or opacity a bit or make it a little sharper...

Link to comment
Share on other sites

  • 1 month later...

When you save a file from Photoshop as TGA, you get an automatic prompt that asks whether you want to save it as a 24 or 32 bit file (that is, with or without the 8 bits that define the alpha channel).  When you save as PNG, you do not get that prompt.  If you have cleared portions of the background to create transparency, your file is automatically saved as 32 bit.  To save it without the alpha channel, you have to choose explicitly to "Save for Web".  Personally, I find that just annoying enough that I never use PNG.  I prefer TGA because I can easily customize the alpha channel to make it as intricate as I like and then save it, knowing exactly what I will get on upload.  I have found that TGA/PNG preference is a highly partisan issue in SL, so I refrain from telling you what you ought to do.

Link to comment
Share on other sites

Thanks for the quick response.  For what I'm working on, I have to use PNG. When I save as PNG, the Alpha Channels checkbox goes unchecked and becomes disabled. Save for Web only has the PNG-24 option, which (I guess intentionally?) doesn't include the alpha channel. I don't see a way to save the png with the dropshadow and transparency.  

I did just try to save at TGA per your advice, and it seems to work, except the dropshadow is white. I'm using a file created by following this tutorial to a T, so I'd inverted the alpha channel once I created it. I expected the dropshadow to be black.  Any ideas?

Again, I thank you for your help.

Link to comment
Share on other sites

There are several ways to create an alpha channel image in Photoshop.  For one of the most basic methods, start by creating a mask on its own layer, above all other layers in your file.  The mask is simply a layer in which you have filled all areas that should be opaque with black.  Transparent areas should be white or cut away entirely. Areas to be semitransparent should be filled with an appropriate shade of gray.  I generally create my mask by filling the new layer with black, setting it to 70% opacity so I can see through it, and cutting away the areas that will be transparent.  Having done that, I select all pixels in the layer (right-click the layer icon and choose "select all pixels") and then click Select  >>> Save Selection ...  Choose the default to save your image to a new channel and click OK. If you open the channel tab, you'll see your new alpha channel.  It should look exactly like the mask you created it from, but with B/W inverted.  White areas will be transparent, black ones will be opaque.

As I said, there are several other ways to do it.  If you have a tricky image with areas of transparency that are derived from design elements on different layers, you can create several masks and save them each to the alpha channel, choosing the Add to channel ... option.  You can also work directly on the alpha channel image itself to create subtle variations in transparency.  It's really quite versatile.

A nice way to begin learning about alpha channels is to visit Robin Wood's web site.  Start with http://www.robinwood.com/Catalog/Technical/SL-Tuts/SLPages/ChannelDiscovery.html  and then explore the other tutorials on the left sidebar.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...