Ranger@Posted: Mon Sep 27, 2010 5:01 am :
How can I make objects distort the screen?
For example, making the plasmagun's pulses warp the air around them as they fly?



The Happy Friar@Posted: Mon Sep 27, 2010 3:17 pm :
Take a look @ the material file "vp_materials.mtr" in pak000.pk4/materials. It's all special effect material, VERY nice to pick apart & learn from.

Basicly, you need to add a stage like this:
Code:
        {
                vertexProgram           heatHaze.vfp
                vertexParm              0       time * 0.1 , time * 0.5 // texture scrolling
                vertexParm              1       .2          // magnitude of the distortion
                fragmentProgram            heatHaze.vfp
                fragmentMap             0       _currentRender
                fragmentMap             1       textures/sfx/vpstatic.tga   // the normal map for distortion
        }


vertexProgram = the heathaze effect
vertexParm 0 = how fast it moves
vertexParm 1 = the amount of distortion
fragmentProgram = the heathaze again
fragmentMap 0 = the texture to apply it to (_currentRender is what's on screen at the moment, so it distorts the screen)
fragmentMap 1 = the texture to apply for the distortion.



Ranger@Posted: Tue Sep 28, 2010 3:13 am :
Where do I add this to? The plasmagun's .def file?



The Happy Friar@Posted: Tue Sep 28, 2010 3:31 am :
It would go in the material file for the material of the plasma bolt that flies. I think it's a particle so you'd need to look at the particle file for the material name to put it in.