Winamp AVS effects in a video game?

Started by
3 comments, last by Tom 23 years, 4 months ago
I''m seriously interested in implementing some totally bad-ass graphics effects in a game engine. If you don''t know what I''m talking about, visit the Winamp Homepage and check out the Advanced Visualization Studio (AVS). Most of you have probably seen it, or something like it. The problem is, I don''t know where to start. First, I need some performance advice from people who know more about graphics programming than I do. Would it be possible to achieve real-time AVS effects using DirectDraw? This would probably require direct memory access, and I''d want to code in Assembly just to be safe. Anybody know where I can find an article on DMA with ASM? Second, I need to know the code behind producing these effects. I''ve got a few demos that were written in VB, and they''re surprisingly fast considering the language. They demonstrate ripple, bump-mapping, and fiery blur. However, I''m more interested in the psychedelic stuff you see with AVS. Any help on this subject is greatly appreciated. I''d like to see some games start using these kinds of effects. With today''s processors, it should be possible.

GDNet+. It's only $5 a month. You know you want it.

Advertisement
If you cast around on the winamp page there are (I think) some developer resources, along with some C++ code of one of the fx...I wouldn''t worry about using assembly until you''ve written and tesed the effect in c/c++ and found that it''s too slow - event then only do the critical parts. I seem to remember the need for us as programmers to handle DMA transfers died with the advent of Windows and DirectX, I think these handle the transfers automatically.
I checked Winamp''s page but found no samples.

I know DirectX handles direct memory access, but I''m not sure if it allows for the type of control I would need to produce the type of real-time distortion I want. Case in point would be the alpha blending program I wrote a while back.

The procedure locked the back buffer, grabbed a bunch of pixels, blended them with more pixels, and rewrote them to the back buffer before unlocking it again. This worked fine for extremely small rectangles, but with larger ones it slowed to a crawl.

I''m guessing this was caused by calling GetPixel several hundred times each frame, and then calling SetPixel an equal number of times. I''ve heard accessing video memory can kill performance. I''d like to know if there''s any way I can access video memory without taking the speed hit.

Picture the Unreal engine. Remember those morphing textures that used particles and real-time distortion? I still don''t know how they managed to do that and pump the textures through the video pipeline without any performance hit. That''s exactly what I''d like to do, but on a full-screen basis.

Anyway, I''d like to hear comments on this.

GDNet+. It's only $5 a month. You know you want it.

Okay, finding it is fairly easy:

@ winamp.com, click on ''Developer'', then on the tree that appears on the left, select ''Code Vault'', under this select ''Vis Samples''. There is the source code for for the ''G-Force'' and the ''WhiteCap'' plugins.

http://www.winamp.com/nsdn/vault/vis.jhtml
AVS is a vis plug-in itself that uses .avs files to create the glorious and pretty eye candy. The method that AVS uses is far too processor intensive to be used real-time in a game (at this stage). Try running AVS and watch the CPU usage sky-rocket and everything else slow to a crawl with a decent sized AVS window.

AVS processes each pixel a number of times each frame according to the rules set out in the .avs file.


Steve ''Sly'' Williams
Tools Developer
Krome Studios
Steve 'Sly' Williams  Monkey Wrangler  Krome Studios
turbo game development with Borland compilers

This topic is closed to new replies.

Advertisement