Pixi JS Doom style screen wipe (is it possible?), on screen or for individual events?

Hi all, I'm back with another weird question. I want to ask the community how they would go about leveraging the pixi js graphics system which rpg maker relies on in order to produce a "DooM Style Melting Screen Wipe" on individual event/NPC sprites to simulate the character melting to death/crumbling, etc.

I've been messing around a lot with pixi js lately, mostly just making edits to existing parameters on screen effects but realistically I have absolutely no idea what I am doing outside of the simplest tinkering.


Carmack's code for the screen wipe is available on git for what I assume is legitimate viewing for whatever that is worth, though it is obviously in a different programming language.
I want to ask the community how they would go about leveraging the pixi js graphics system which rpg maker relies on in order to produce a "DooM Style Melting Screen Wipe" on individual event/NPC sprites to simulate the character melting to death/crumbling, etc.
This wipe effect sounds like a post-process shader, so you could assign a custom PIXI Filter to sprites whose character has been marked for wipeout. For a time-dependent shader like a wipe effect, you'd basically just need to give your shader a "time" uniform, then update the value of that uniform on the filter each frame.

MZ creates HTML games that use WebGL, a.k.a. OpenGL ES (Embedded Systems), for rendering. So the final vertex and/or fragment shader code for the wipe effect would have to be in that language.

I don't know if there already exists an MZ plugin for custom time-dependent filters. I suspect the hard part here would be finding/devising suitable shader code.


It could be possible to achieve a similar effect on the CPU, using the Canvas API to perform image data edits on a cloned texture (basically blt the bitmap every frame). However, that would be much less resource efficient and you'd still need an appropriate algorithm to inform the edits.
This wipe effect sounds like a post-process shader, so you could assign a custom PIXI Filter to sprites whose character has been marked for wipeout. For a time-dependent shader like a wipe effect, you'd basically just need to give your shader a "time" uniform, then update the value of that uniform on the filter each frame.

MZ creates HTML games that use WebGL, a.k.a. OpenGL ES (Embedded Systems), for rendering. So the final vertex and/or fragment shader code for the wipe effect would have to be in that language.

I don't know if there already exists an MZ plugin for custom time-dependent filters. I suspect the hard part here would be finding/devising suitable shader code.


It could be possible to achieve a similar effect on the CPU, using the Canvas API to perform image data edits on a cloned texture (basically blt the bitmap every frame). However, that would be much less resource efficient and you'd still need an appropriate algorithm to inform the edits.
Thank you very much for the reply. I think you gave me a lot to chew on here. I will R & D this in the direction you've pointed me.
I just realised that for a custom filter a more useful link would probably be the docs for the base class, PIXI.Filter. A custom filter can be created like this:
JavaScript:
const VERT = "custom vertex shader code goes here";    // or null for default
const FRAG = "custom fragment shader code goes here";  // or null for default
const UNIFORMS = { time: 0 };  // any custom uniforms referenced in shader code
const f = new PIXI.Filter(VERT, FRAG, UNIFORMS);
PIXI uses some pre-defined structure, so a generic WebGL shader may need editing if it's not already written for use with PIXI. ColorFilter defined in rmmz_core.js inherits from PIXI.Filter and may be helpful as a reference~

Good luck! 👋
it is obviously in a different programming language.
not only a different language... a different set of resources altogether.
you have 3 middle men in between your code and the screen now, each with their whims and diva complexes.
I just realised that for a custom filter a more useful link would probably be the docs for the base class, PIXI.Filter. A custom filter can be created like this:
JavaScript:
const VERT = "custom vertex shader code goes here";    // or null for default
const FRAG = "custom fragment shader code goes here";  // or null for default
const UNIFORMS = { time: 0 };  // any custom uniforms referenced in shader code
const f = new PIXI.Filter(VERT, FRAG, UNIFORMS);
PIXI uses some pre-defined structure, so a generic WebGL shader may need editing if it's not already written for use with PIXI. ColorFilter defined in rmmz_core.js inherits from PIXI.Filter and may be helpful as a reference~

Good luck! 👋
Thank you, I will review this snippet and try to apply it!
not only a different language... a different set of resources altogether.
you have 3 middle men in between your code and the screen now, each with their whims and diva complexes.
Tell me about it! haha!!!
What exactly is a melt screen wipe?
I recall I saw a plugin with similar effect:
https://chaucer.itch.io/rosedale-transition-effects
What exactly is a melt screen wipe?
I recall I saw a plugin with similar effect:
https://chaucer.itch.io/rosedale-transition-effects
I believe that they mean the specific screen melting effect that happens on the scoring screen on the original Doom.
"DooM Style Melting Screen Wipe"
As always, regardless of how popular something is, we always request you include references to the game in question when you are wanting to emulate something from that game.
It helps reduce the amount of guessing we have to do.

That said, I was going to drop a gif here, but surprisingly either no one has made a gif of the end level transition effect or my google-fu is off.
I am on cell data and don't want to use up my limited monthly data allowance on video, but I am certain OP, you can find a video walkthrough of classic Doom and just link/tell us the time stamp where the transition happens. E1M1 is remarkably short, so it's not like it would take you long to find it.
I believe that they mean the specific screen melting effect that happens on the scoring screen on the original Doom.
Ah, OK I found a video for the original doom. It doesn't look like a filter. It looks like the screen pixels fall down in rows. Very similar to a battle transition effect I made before. Maybe I can modify the plugin for this effect.
1731315354962.png
@utunnels - not sure what you have in mind, but I was thinking that a snapshot (SceneManager.snap()) of the pre-transition scene could have its texture assigned as a uniform to the fragment shader: the shader would then pull color values from the appropriate texture, based on time (and maybe an initial random seed).

I haven't tried writing a shader with a custom texture uniform before, but I looked it up and, based on the fragment shader of the built-in DisplacementFilter, that aspect looks fairly simple:
Perhaps it'd be simpler to just show the snapshot as an overlay sprite with a custom "melting" shader.
Actual I'm talking about a canvas solution. Take a snapshot of the previous scene, break it down into an array of vertical rects and make an animation by moving the rects.
Here's an example of a battle transition.
Wow everyone, this blew up while I was gone! Thank you for posting the link, I should have linked that so everyone would know what I meant, I'll make note of that for any future references I may have. I'm going to experiment with the transition effects plugin and the Melt Battle Transition generously provided by @utunnels. Thank you everyone I will look over all these posts and very soon will return with more info regarding my games demo!
Actual I'm talking about a canvas solution. Take a snapshot of the previous scene, break it down into an array of vertical rects and make an animation by moving the rects.
Here's an example of a battle transition.
That plugin you provided is amazing. It is absolutely cool! Here is a brief overview of my experience with it. Upon loading the plugin it works as expected melting the screen into a transition. The screen melts to a black screen, with the enemy visible, any pixi js filters applied are still animating over the enemy which is cool, however the black screen is interesting indicating that the "Scene" was wiped as well.

However, upon using the wipe function on some screens the "Scene" is retained into the battle screen. IE you can still see the background including any events, which is funny because in this instance the enemy is appearing in the battle screen but also still visible as part of the background. I wonder what could cause this discrepancy in scene visualization.

I am willing to work around it because the effect is just amazing, but a fix would be worthwhile.

Additionally can this transition be used for regular scene moving from one map to another transitions?

I can not recommend this effect enough!!!
The trick is you take a screenshot in the previous scene, and use the image to make the effect.
However there's a default fadeout/fadein during map transition. There's also a loading black screen (in MV maybe also MZ?), I haven't checked all scenes but I guess they are a bit different.
The trick is you take a screenshot in the previous scene, and use the image to make the effect.
However there's a default fadeout/fadein during map transition. There's also a loading black screen (in MV maybe also MZ?), I haven't checked all scenes but I guess they are a bit different.
I see, I'll keep all that in mind as I proceed. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/pixi-js-doom-style-screen-wipe-is-it-possible-on-screen-or-for-individual-events.173097/