R Reynolds Posted February 7, 2023 Posted February 7, 2023 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. 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. 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. Quote
Hash Fellow robcat2075 Posted February 7, 2023 Hash Fellow Posted February 7, 2023 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. Quote
Hash Fellow robcat2075 Posted February 7, 2023 Hash Fellow Posted February 7, 2023 The sample model will still give an odd result in a direct specular reflection... for a smoothly-feathered spec, adding the original greyscale image as a specular intensity decal fixes that... BlueSquare_wSPEC.zip Quote
Hash Fellow robcat2075 Posted February 7, 2023 Hash Fellow Posted February 7, 2023 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... "Premultiplied" eliminates the halo. I don't know what the math is that does this.... Quote
R Reynolds Posted February 9, 2023 Author Posted February 9, 2023 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. Quote
Recommended Posts
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.