Jump to content
Hash, Inc. - Animation:Master

Cookie cut maps with alpha channel not handling specular correctly[solved]


R Reynolds

Recommended Posts

I think I've found an anomaly in the way cookie cut maps with alpha channels (which is the only way I use them) render specular highlights.

My test map is shown below, an out of focus ellipse.

cookie_cut_specular_test_map_b&w.jpg

I applied this as a color decal to a blue, four patch plane as a TGA file with an alpha map based on luminance so it should appear as a fuzzy white oval. The blue plane had a white specular color with size and intensity equal to 33%.

In the top half of the following image are screen renders (9 pass) of the plane as seen from four different viewing angles; 20 deg. off perpendicular, 15 deg., 10 deg. and 0 deg. or normal to the plane. As expected, both the fuzzy oval and blue background are lightened by the specular.

cookie_cut_specular_test_compare.jpg

The bottom row is a similar sequence but now the decal is set to cookie cut. At a 20 deg. viewing angle, the fuzzy, blue ellipse cut out from the plane is what you'd expect. But as the angle decreases and specular starts to contribute, there does not appear to be any effect from the alpha channel. If there is a non-zero value in the alpha channel it gets full specular. Right now the work around is to add a specular map to force a correct alpha effect but it would be nice if it would do it automatically.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • Hash Fellow
1 hour ago, R Reynolds said:

 with an alpha map based on luminance so it should appear as a fuzzy white oval.

This where the scheme begins to go wrong.

Consider that the result of alpha semi-transparency is to mix some of the color of the RGB image with the color of whatever it is overlaying. A 75% transparency value will create a 25/75 mix of image color vs. the background color

However, since your alpha transparency is based on the gray value (luminance) of the fuzzy oval image,  then... for example... at a point where the transparency channel represents 75% transparency it is taking it image color info from a pixel that is not white, but dark gray. The renderer will mix 75% background color and 25% dark gray.

It's basically the halo problem, but big.

Try this version...
BlueSquare.zip

Do you have Photoshop? Or some other Photoshop plugin-compatible paint program?

There is a plugin that will simplify the creation of decals such as you want to make here.

Link to comment
Share on other sites

  • Hash Fellow

FYI... there aresome apps that can somehow read your original alpha channel design and yet get the desired result.

Adobe After Effects has an "Interpret Footage" panel with choices for the Alpha channels.

"Straight" leaves the gray halo in this situation...

image.png

 

"Premultiplied"  eliminates the halo. I don't know what the math is that does this....

image.png

Link to comment
Share on other sites

Thanks Robert. PaintshopPro can make proper alphas and I use them regularly. I guess I shouldn't have said from luminance since that just distracted from my issue with the cookie-cut map not automatically handling specularity. Using one more decal for specularity is an easy fix.

Link to comment
Share on other sites

  • robcat2075 changed the title to Cookie cut maps with alpha channel not handling specular correctly[solved]

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...