Sign in to follow this  
Guest Patrick_Waugh

C Devs - Solution found to shadow/highlight problems

Recommended Posts

If you ever tried to develop shadow and highlights in C/C++ and had problems I wanted to share something I discovered the hard way over many hours of trial and error.First, you must have a version of imagetool that works. I had two different versions on my system, and found that one of them would not even open certain .bmp files. The working version is: imagetool.exe v1.0.0.2 160 KB (not the 184 KB version)Second, you MUST recompile the resources manually. While VS is supposed to recognize when a resource or file has been changed, and recompile it and all dependencies automatically, I have found that it misses the changing of these .bmp's for some unknown reason. Strangely, it notices changes to others, but not these. The solution is to do a "build all", or right click on your .rc file and select build (faster).Third, contrary to popular opinion, the SDK is correct, but difficult to understand properly on how to create shadow's and highlights, however it does not discuss reflections at all.Thanks to the efforts of others, I finally understand those as well, and just briefly will say that conceptually, they are different in two primary ways. First, they use a desaturated (colorless) copy of the RGB layer you wish to reflect as the alpha channel (ie gray scales vs. pure white/black). Second, for any given image you will need to experiment to find the right contrast and opacity needed to give you the look you seek. Also importantly, you will want the non-reflective part of the alpha to be white, and you will want to use the "negative" of the RGB image as the alpha channel's reflective part. This is because "bright" areas in the RGB will need to be darker in the alpha as darker indicates more blend of the underlying image (ie more translucent). As a result, many prefer to start with a black background, merge down a desaturated RGB masked to the reflective part of the gauge, and then invert (get the negative) and then copy that to the alpha channel.Just thought I would share as I was pulling my hair out thinking I was doing something wrong and I wasn't.Hope this helps someone avoid hours of work. If you feel you have the wrong version of imagetool and need the one I have, feel free to contact me.Patrick

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this