Attempting to port a CRT effect from VXA to MV

The original effect:




This addon:

r3fksSz.png


Grab the addon here (download provided by Google Drive).

To install, extract the archive's contents to your project's base directory and install the plugin via the plugin manager.  It's plug and play so it should be working the next time you launch the game.  (Note: Presently this script only functions on the Map view and some overlap against the base window settings is to be expected).

Spoiler
Figured I'd document the journey of this as I try and get it ported over - and ask questions while doing so.  

Nobody's got documentation on creating a new plugin from an old VXA script and I figure this one should be easier to do than other old custom effects of mine.

I'm a complete novice to JS, so I'm fumbling a lot as I try to make this thing work.  First thing's first - I've got to put together a Hello World to make sure I know how to call stuff properly.

What's currently holding me back:  I'm not sure how to properly create a sprite object, even while staring at other JS files which are doing so.  The calling conventions aren't meshing in my head.

What's needed to convert this script:

  • Render a picture to the screen
  • Get the screen's render output
  • Offset the screen's render output and mix it in
  • Set blend mode
  • Access Z coordinates
  • Add plugin commands for mutability
  • Fix zoom center offset
  • Refactor for performance
  • Reduction of the existing 12 assets into a smaller set of assets due to the 15 overlays maximum limitation making things such as menus fail to appear.
  • Fixing glitchy behavior with text boxes.
I will stop you it's not easy :/

and did you ask the person permission or this your original script?
I am the person who made the original script; I have obtained permission. 😛

It is easy.  I just am not sure how to create graphical objects in JS yet - and how to manipulate the data of those objects.

This new structure also requires me to learn how Pixi.JS goes about creating graphical objects - and I've learned a fair amount of that already.

Once that's learned, all I need to do is lay them down in the correct order with the right opacity and blend-modes and I'll have most of what the original game had.

Then, all I need to do is figure out how to pull the game's render output from the graphics rendering buffer (or create a screenshot) and then offset and blend that with what's actually being displayed.

Edit: Progress report time.

So, I've finally found where ImageManager was stored (logically, rpg_managers.js).  Looking over the methods available to me through the ImageManager class, this should be a snap - once I can switch gears from C# to JS.

At the moment, I'm staring at this block of code and wondering how JS would like me to parse it properly.  Perhaps I need something more 'IDE' than Notepad++ after all.

if (var source = ImageManager.loadPicture("crt_wave")) != null { console.log("I grabbed an image file!"); }It would help if the Help file were searchable - or, indeed, if things like ImageManager came with documentation (e.g. what the return is for "I can't find that object you're looking for")
I see actually I would give your for option to study PIXIJS it's allow the canvas and picture render
Thanks to a lot of help from ocean pollen on the steam group chat, this is finally moving forward.  This won't be the most flexible of programs for those who aren't familiar with JS code - and I might expand it to be more generic later on - but for now it should be getting close to how I'd like it at least in the next day or so.

The version I'll put up will of course be a bit more generic than the one shown below.  Consider it a 'serving suggestion'.

Spoiler
K0UYjEz.png
I see this was not supposed to be a shader xD? I am confuse now
It was never a shader, sorry.  Just a series of particularly blended images and assets put together with some code which manipulates particular values to create a 'living' space.

I'd enjoy turning it into a shader, but I just don't have the experience to pull something like that off.
Yup a shader is the "actual way to do this quickly" it will reduce lag, a lot of it.

Learning about shaders is quite hard and I understand that, but elieve me, after understanding how to do them, you won't want to do it again without them.

Anyway, looks like a great effect to apply
I am a huge fan of this effect 🙂 I wanted to do this back when I used VX ace but I could never figure it out.

I often wondered if we could apply this via shader somehow in MV. I feel like it would definitely reduce the lag.

Either way I am excited to see your progress ^-^
Hm.  It's all mostly working now except that I can't figure out the reason for the flickering text boxes in scenes which are not the title screen.

If I can get that fixed this script will be ready to deploy.
Message box flickering has been resolved.  There's a couple of performance issues to deal with now - and I need to figure out how to properly center the camera while zoomed in.

Once I get those resolved this addon/plugin will be good to go after I clean stuff up, comment it, and put in some plugin commands.

Edit: Zoom offset issue has also been resolved.  Now it's just a matter of refactoring my code, commenting, giving it a performance boost, and separating it into a 'pure' plugin version [roll your own images] and an 'addon' version which includes the base images and et cetera.
Wow that looks awesome! Really good job you've done here 🙂
The addon has been submitted to the official release section.  This thread will close down as soon as that thread is approved but in the meanwhile, I have updated it to include the first release version of the addon.

Original thread: https://forums.rpgmakerweb.com/threads/attempting-to-port-a-crt-effect-from-vxa-to-mv.46679/