Possibility for a Displacement Plugin? [Cool Example included]

Started by subspark, Sat 15/11/2008 09:57:02

Previous topic - Next topic

GarageGothic

Well, if you want to distort the full screen as in subspark's example, you need a DynamicSprite copy of the current screen (including objects and characters at their current position, with their current animation frame and current lighting) to then distort. Arguably you only need to grab the screen when something has changed, but since there's no easy way to determine when this has happened, we do it every frame.

Creating a DynamicSprite from a screenshot rather than just creating it from the background is much slower in Direct3D mode as the data must be read back from the video card's memory rather than system RAM. For this reason, instead of grabbing a screenshot to DynamicSprite, my EffectModule replicates the area behind the object in question by grabbing part of the background and then cycling through all the characters and objects in the room, checking if they're overlapping the object and if so, sizing and tinting their graphics to match the actual objects/characters) using DynamicSprite functions and then drawing them in baseline order to the background sprite. This method improves the speed considerably compared to using a screenshot, but I think it could cause quite a slowdown if used full-screen in a room with more than one or two characters and a few objects.

This is also why I suggest pre-distorting the background graphics (storing the frames as DynamicSprites you could have much more than 5 animation frames, though you would probably have to delete and then re-render the frames when saving/restoring to avoid 20+ MB savegame files). Running the realtime distortion only on characters should allow decent framerates.


subspark

There's been some great responses from everybody here. It's nice to see everybody experimenting either in their heads or in practice.

QuoteIt's eye candy that's easy to overuse.
Sure. But the same could be said for laser guns in movies or the fade transitions that Chris implemented into the modern AGS. ;)
"Something great is always remade because it is great and doesn't perish upon birth." I forget which philosopher said that.

Cheers,
Sparx.

Trent R

QuoteIt's eye candy that's easy to overuse.
So are lens flares, but everybody knows that you shouldn't use them. If they try to, it's immediately shot down once it reaches the CL, GiP, or Database.

And I'd like to add that I'd love to see it, even though I wouldn't use it (anytime soon at least)

~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

subspark


Ghost

Hmm, then let me rephrase: It's easy to overuse, and thus, it should be highly customizeable.

That's what I really had in mind, sorry if it came over the wrong way.

Trent R

Not at all, I got what you meant. And I meant that if it does become a trend, it will control itself through the forums mentioned.


~Trent
To give back to the AGS community, I can get you free, full versions of commercial software. Recently, Paint Shop Pro X, and eXPert PDF Pro 6. Please PM me for details.


Current Project: The Wanderer
On Hold: Hero of the Rune

Gilbert

Since the subject of this thread was so misleading in a way that made people think such a plugin has been made, I have decided to change it to something more reasonable. :P

subspark

Thanks Gilbet. Somehow I lost my question mark when I added [Cool Example Included] next to the original  subject.

Cheers,
Sparx.

SMF spam blocked by CleanTalk