Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Krackers87 on October 03, 2009, 02:33:49 pm
-
Forgive my insolence if I'm speaking on common knowledge here, but would it be possible to make a 3D distortion effect, essentially take lets say, the current 3d shock wave, make it invisible, yet distorts light based on its geometry similar to a heat wave/water ripple/looking through a glass cup or ball. If not currently possible, how difficult would this be to implement?
-
It could probably be done with a shader now. But only people with shaders would see it.
-
My skills in this arena are quite few, but I'd assume you'd (on the cheap...) start with sphere and apply a translucent texture to it. The sphere would have to enlarge and probably have a few rotational constants about its origin to look right if you only used a singular texture. Using glowmaps would probably remove the need to spin the enlarging sphere. Add a flash of light a few degrees of magnitude smaller than a subspace flash upon bomb/torp impact and you'd have a very cool effect indeed...
-
My skills in this arena are quite few, but I'd assume you'd (on the cheap...) start with sphere and apply a translucent texture to it. The sphere would have to enlarge and probably have a few rotational constants about its origin to look right if you only used a singular texture. Using glowmaps would probably remove the need to spin the enlarging sphere. Add a flash of light a few degrees of magnitude smaller than a subspace flash upon bomb/torp impact and you'd have a very cool effect indeed...
I'm talking more along the lines of distorting other effects, using another effect. a ship is blowing up, little explosions all over it, a shock wave occurs between the player and ship, thus a ripple distorts the entire scene of the ship exploding. unless this is the effect you're explaining, than i apologize for my sleep depraved delusions.
-
Shaders.
-
Screen-space effects like that are doable, for people with shader support, and I suppose with proper depth sorting it might be doable on a per-shockwave/distorty-effect basis.
But it's not something that's doable using the same shaders system that's in place for normal maps, etc.
Edit to appease the almighty Zacam: um... yeah
-
I'm talking more along the lines of distorting other effects, using another effect. a ship is blowing up, little explosions all over it, a shock wave occurs between the player and ship, thus a ripple distorts the entire scene of the ship exploding. unless this is the effect you're explaining, than i apologize for my sleep depraved delusions.
You're looking for something like the shockwaves in FEAR right? (and other games I assume)
-
I'm talking more along the lines of distorting other effects, using another effect. a ship is blowing up, little explosions all over it, a shock wave occurs between the player and ship, thus a ripple distorts the entire scene of the ship exploding. unless this is the effect you're explaining, than i apologize for my sleep depraved delusions.
You're looking for something like the shockwaves in FEAR right? (and other games I assume)
yup, exactly
-
Shaders.
A lot more to it than that, unfortunately.
Individual shaders work on a per-vertex/per-fragment basis, and thus know nothing of the other items in the scene.
They basically get per-model 'variables' (including textures) and per-scene 'global variables'.
I believe this can only really be done using post-processing shaders, where you first render-to-texture, then render 'shockwave info' to another texture, then use a shader that takes the 'shockwave info' texture and uses it to distort the first result.
There might be a way to use a stencil buffer instead (which would be faster), but I suspect that wouldn't give the kind of result you're after.
-
@Tomo: that's what I told in post-processinig topic, http://www.hard-light.net/forums/index.php?topic=64986.msg1289883#msg1289883
I will have to create an interface to create and use g-buffers while implementing "new" motion blur (the old one was removed from post-processing code), which will enable many more techniques (deferred shading, heat haze, post-processing effects applied only on some parts of screen and improved shockwaves). However, that will require much more from the hardware.