Way back on the original Xbox and PlayStation2, the framebuffer and the textures were in the same memory space. And coincidentally, because you had complete control over the machine, you could construct a texture using any memory address --including that of the framebuffer! This was very not recommended. Both the internal memory layouts and the order-of-operations of memory reads and writes from different pixel operations were explicitly undefined in every hardware graphics API ever so that different GPUs could be free to have wildly different implementations. Here are some examples: http://www.youtube.com/watch?v=ZJU_CO6gRfs and http://www.g-truc.net/post-0597.html
On the consoles, the memory formats and layouts were well defined, but the order of operations were not. And indeed, if you tried to draw anything that wasn't a pointless memcpy(src, src, sizeof(src)) while using the framebuffer as a source texture, you would get random, rectangular and z-shaped (morton order) glitches because of out-of-order operations stemming from the aliased source and dest buffers.
However... My goal was a blurry, streaky, screen distortion effect in the weapon trails --to look like the blades were so awesome they caused refraction by cutting the air ;) I found that by sampling the framebuffer from four locations along the weapon's line of motion, the glitches were blurred and streaked out to the point that they really were not objectionable :D
To do the effect according to the spec (and without glitches) I would have had to copy the whole framebuffer to a temp buffer. That would have been simply too expensive for such a small visual difference. What did ship looked great and the framebuffer-feedback feature added effectively zero cost. But, I felt kinda bad for future (now long past) emulator writers who would later try to support my out-of-spec use of the hardware which is simply not allowed by desktop APIs. (AMD's Mantle might expose it. We'll see...)
That sounds like a neat hack. I don't suppose you could mention the name of the game, or link to some YouTube footage of the weapon-trail effect in action?
Unfortunately, the artists tuned the effect to be really subtle and it's hard to see it through the compression. When the axe is on fire, the flames are using the effect to do heat distortion as well.
On the consoles, the memory formats and layouts were well defined, but the order of operations were not. And indeed, if you tried to draw anything that wasn't a pointless memcpy(src, src, sizeof(src)) while using the framebuffer as a source texture, you would get random, rectangular and z-shaped (morton order) glitches because of out-of-order operations stemming from the aliased source and dest buffers.
However... My goal was a blurry, streaky, screen distortion effect in the weapon trails --to look like the blades were so awesome they caused refraction by cutting the air ;) I found that by sampling the framebuffer from four locations along the weapon's line of motion, the glitches were blurred and streaked out to the point that they really were not objectionable :D
To do the effect according to the spec (and without glitches) I would have had to copy the whole framebuffer to a temp buffer. That would have been simply too expensive for such a small visual difference. What did ship looked great and the framebuffer-feedback feature added effectively zero cost. But, I felt kinda bad for future (now long past) emulator writers who would later try to support my out-of-spec use of the hardware which is simply not allowed by desktop APIs. (AMD's Mantle might expose it. We'll see...)