D2X-XL Worklog
Notes on features and problems from the development of D2X-XL, newest first.
Improved Coronas |
|
My initial corona implementation suffered from hard edges where the light coronas hit the wall. In the form of 'hard coronas', it still does. After Jaz had gone over my corona code, they blended softly with their environment, but now they could bleed through walls in front of them, even if they were far behind these walls. While that still looked much better than the hard edges, and usually wasn't too apparent, I wasn't happy yet. I had this going round in the back of my head until I got an idea: Why not test each pixel of a corona whether it was occluded in a shader program, and if it was use the pixel's distance to the occluder to softly fade it away, instead of either completely dropping or blending it with the occluder? This sounds suspiciously like DirectX 10's soft particles, and in some way I think this is pretty close. Well, the idea sounds strikingly simple, but the way to getting where I wanted wasn't. I asked holes into people with more knowledge about OpenGL than I have, but nobody could help me to get this to work. Finally I found something related with Google, and it turned out I had to use certain very special values when calling OpenGL for this. The information came from some guy working at NVidia's (so I read), and seemed completely illogical and inaccessible. You really had to work in a graphics hardware vendor's driver development department to know this I reckon. Anyway, I got it to work, and it looks great. Like all good things it comes at a cost though: It will slow the renderer down, so you need some good hardware to utilize it. Here are a few screenshots for a comparison. hard coronas
soft coronas (regard the corona in the image center bleeding into the wall in front of it)
depth blended coronas (no bleeding)
|





