|
From: Jose' C. <cru...@ce...> - 2007-07-05 19:40:22
|
Il giorno 05/lug/07, alle ore 20:57, Roger Holmes ha scritto: > I need to change RayShade to support the alpha channel. > > Currently each pixel is encoded as four floats, r,g,b and alpha. This > is then converted to three bytes when the alpha is thrown away. This > is then converted back to the representation desired by the > application and O.S. . I can do it three different ways, by making > the internal buffer always four bytes, or always four floats, or by > looking at the output representation and using either three or four > bytes as appropriate. For simplicity, I favour the four byte > approach, though at the cost of a larger buffer, but then RAM is now > fairly cheap. > > Your thoughts please. > > Roger. I vote to maintain four floats till is converted to the native format the code to write the pixels to the destination bitmap is ugly to say =20= the least, specially on windows, so I think it has to be reworked. On the other hand, while experimenting with spherical lights, I've =20 noted problems with the antialiasing, but I've not gone much further =20 since, if we have to redo the antialiasing code (cubic and gaussian) =20 probably is better to have the data as four floats, the size is not a =20= problem, anyway we need just a tiny strip of data that will be copied =20= to the destination buffer Pax et Bonum # Dott. Jos=E9 Cruanyes Aguilar - C.E. Soft srl # Pzza. Firenze,4 MILANO - XX Settembre 10, CREMONA # 02,3923101 0372,460602 |