I've got a theoretical exercise at my university which belongs somewhere between alpha blending and ray casting – to be honest, I’m not sure. It says, that we are looking at a voxel (1-centimeter distance) which consists of different colors (sand: yellow, stone: red, oil: green and water: blue) where sand and water are transparent, stone is half transparent and oil is completely opaque. This information led to the following color value: 80 | 120 | 245 The value ranges from 0 – 255. The function values of the given elements are: sand (50-100), oil (100-150), water (180-200), stone (210-250). Now we are supposed to calculate the actual value of the pixel given the formula:
Color x = a_s * c_s (1 – a) + c ;
opacity c = a_s (1-a) + a
Where a_s stands for alpha sample and c_s for color sample. I’m already thinking about this problem since days. I can’t differentiate between a_s and a. I’m quite sure I have to solve this problem recursively but how do I initiate the first step?... Suppose that a is 0 at the beginning and just use the information in the text? Also is there any meaning regarding the order of the calculation? Maybe someone understands my problem.
EDIT INFORMATION: Thank you both for your help!
I fully understand that it is really unclear what we are supposed to do because the wording of the exercise is pretty messy. I try to be more precise:
The whole exercise, consisting of 5 subtasks, gave us the following information (translated from my native language): “You are given a volume data set regarding the earth structure of an earth field. The following relationship between these density values exists:
Sand: density 50-100, Oil: density: 100-150), Water: density 180-200; Stine: density 210-250. Values range from 0-255.
From a)-d) we were supposed to draw the transfer functions of these opacities. D) says: “Draw the transfer function for the opacity given that sand and water are transparent, oil is semi-transparent and stone fully opaque.
Now coming back to the initial question: “An observer looks from the left side at the voxels with the same density from a distance of 1 centimeter. The voxel influence the calculated color value with their initial colors (sand yellow, stone red, oil green, water blue) and the opacity given in subtask d), which is:
80 | 120 | 245.
Calculate the actual color value for the visible pixels (using the formulas above). I (!) can just assume that the three digits represent a RGB code because the given colors of the elements could translate into: R=80=Stone; G=120=Oil; B=245=Water. I also just assumed ray casting because there is a volume data set given, even though I recognize some formula elements of Alpha Blending in the formula given in the text. So that is why I’m so confused.