D2X-XL Worklog
Notes on features and problems from the development of D2X-XL, newest first.
Yet More Smoke! | |
|
After having solved the transparency related problems with rendering smoke, there was still one issue left that kept nagging at my subconscious. It was that jerky particle animation and this perodiocally turning dark and bright again of smoke clouds. It just didn't look good. The reasons behind these two flaws were that the smoke cloud Aus-RED-5 had graciously built for me had too few frames and that the brightness differed greatly between its brightest and darkest frames. As during one smoke render frame the same smoke animation frame was used for all smoke particles to avoid constant OpenGL state changes by loading different texturs, this caused the irritating blinking. Here is the image to give you an impression: ![]() I thought that a new, better smoke animation would be the solution for these problems, but that was really hard to come by. It turned out that it wasn't required. Well, kind of, as I could create it myself from the current one simply by interpolating more frames from the existing ones. That solved the jerky animation behaviour. What it did not solve was the blinking. I had to find a way to render different animations for the smoke particles during one render frame without having to constantly tell OpenGL to use another texture. Actually the solution was a simple one: If I reformatted the animation texture into a square one, I could load all the frames to OpenGL at once and adress them during rendering by specifying offset and width of a rectangular part of the animation texture to be rendered using the texture coordinates that got passed to OpenGL when rendering a texture. ![]() So what I did was to hack an interpolation and a reformatting routine into D2X-XL, change the smoke renderer a little bit, and voilà - smoke looked just
sweet! | |




