TV Screen/CRT Monitor script/shader?

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
I'd love to have a shader which goes after all my scripts, etc., and is rendered on top of the whole game screen to make the game look as if its being run on an old, very-large-pixel, CRT monitor.

I've looked around the internet and have seen folks pull it off -- but I haven't seen anyone attempt it for VX Ace.



This is a GM:S script/shader, available here: http://gmc.yoyogames.com/index.php?showtopic=598227 .  The author goes into lots of detail on how they pulled it off (it was a request to convert an existing script into GML format)

The best fulfillment of this request would be a script which does something similar to the effect I'm using in my (currently incomplete) trailer.  1:04 is about what I'm looking for if this video effect script was running in-game.
 
Last edited by a moderator:

Venka

Veteran
Veteran
Joined
Jun 20, 2012
Messages
945
Reaction score
365
First Language
English
Primarily Uses
now I have the mario theme stuck in my head... that's a neat idea and could see other uses for it as in representing the player playing through a memory sequence.
 

boldpaste2

The Dragon Heretics
Veteran
Joined
Dec 7, 2013
Messages
797
Reaction score
439
First Language
English
Primarily Uses
CRT Lines are not to complicated to pull off. Here is a basic one I had wiped up for you. Also, if you want to enhance it further, have a common event running on a parallel process that changes the opacity of the image very subtly (but quickly) to simulate crt flicker.

 

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
CRT Lines are not to complicated to pull off. Here is a basic one I had wiped up for you. Also, if you want to enhance it further, have a common event running on a parallel process that changes the opacity of the image very subtly (but quickly) to simulate crt flicker.

I'm afraid I'm looking for a more complex solution than that.  See the trailer I posted above: I'm looking for a phosphor grid which I can light up individual cells randomly with.

Examples of phosphor grids (I'm looking for the LCD one, but with super-big "pixels".  Most LCDs have these things so small that you can't see them unless you put your nose up against your monitor.)

 
The grid, when applied to an image:

And here's how it works, mechanically speaking:

I'm not sure what I'm looking for can be accomplished outside of a coded solution.
 
Last edited by a moderator:

orochii

Abomination of life, or life itself.
Veteran
Joined
Apr 29, 2012
Messages
652
Reaction score
364
First Language
Spanish
For the phosphor grid, you can use an overlaying image with additive pallete. Same for the CRT scanlines. Both things would be easy to do, not even needing a common event, you can use a very basic script to display these images over ALL things in the game.

#Something like this at main.$crt_overlay1 = Sprite.new$crt_overlay2 = Sprite.new$crt_overlay1.bitmap = Cache.pictures("crt_overlay_lines")$crt_overlay2.bitmap = Cache.pictures("crt_overlay_grid")$crt_overlay1.z = $crt_overlay2.z = 1000000000$crt_overlay1.opacity = 128$crt_overlay2.blend_type = 1Now, all it needs is some updating, I often commit the horror of aliasing something at Input and adding a few updates there to things I want there at all times.

module Input  class << self    alias crtupdate_update update    def update      crtupdate_update      if($crt_overlay1 != nil && $crt_overlay2 != nil)        $crt_overlay1.update; $crt_overlay2.update      end    end  endend
Just know ALL THIS CODE IS HORRIBLE, terrible, ugly... But use it if you want. Just don't show it to anyone.

Now the screen deforming is the part that it's hard to do. Thing is, in RGSS you can't access to the game screen for, like, apply effects, deform something drawn on screen, or anything. You would need to apply to each sprite, plane, whatever else, the effect by sepparate (you could manually deform some graphics, like static backgrounds and such). And you would need to write your own algorithm anyway, and I ignore how to start with it xD.

Soyeahgoodluck!
 

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
I would go with a solution like that -- however the static underneath it would not be interpreted correctly.  Rather than adding noise to individual Red, Green, or Blue LEDs it would add noise 'within' those LEDs which isn't how LEDs work! :p

Edit: Still, if this is the best I can get outside of paying someone for a custom script then I suppose I might settle for it.
 
Last edited by a moderator:

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
I don't understand why even in this modern time and day someone would like to have their game with this kind of effect.
 

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
I don't understand why even in this modern time and day someone would like to have their game with this kind of effect.
Slenderman, Outlast, Fatal Frame, Republique, etc. are games which are played 'mainly through a device'.

Dim is also a game being played through a device -- I want the person playing the game to see what the person you're playing as sees and what they see is an old CRT monitor displaying footage whose native resolution is much higher than what the screen was intended for.
 
Last edited by a moderator:

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
It isn't about paying someone for a custom script. The only way this can be achieved is by literally recreating the RGS***,dll, or at best rewriting a bunch of it, which is essentially recreating RPG Maker. Do you know how much that'll cost ya? The overlay will have to do for now :p
 

Milena

The woman of many questions
Veteran
Joined
Jan 26, 2014
Messages
1,281
Reaction score
106
First Language
Irish
Primarily Uses
N/A
Slenderman, Outlast, Fatal Frame, Republique, etc. are games which are played 'mainly through a device'.

Dim is also a game being played through a device -- I want the person playing the game to see what the person you're playing as sees and what they see is an old CRT monitor displaying footage whose native resolution is much higher than what the screen was intended for.
Well the games you've mentioned are not using the ones you were talking about. It is simply an effect they achieved through some videographics / cinematics effect. In Unity, there's a bunch of effect that lets you do this, which, in RPG Maker has a way to be done also. Get that picture boldpaste2 posted, make a show picture command and that's just it. I don't think there's such complex scripting made in those games as mentioned though, as to I can assert they're videographics.
 

cabfe

Cool Cat
Veteran
Joined
Jun 13, 2013
Messages
2,353
Reaction score
2,549
First Language
French
Primarily Uses
RMVXA
If my memory serves me right, there was a somewhat similar effect for the computer device in Fallout 3 (and New Vegas subsequently).

There was a dev blog where they explained they got this effect by actually sending light rays to a 3D "screen" object, much like the real world monitor device.

That's something that cannot be done in RPGMaker of course, so that's not very useful, sorry.

The topic just reminded me this story.
 

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
Get that picture boldpaste2 posted, make a show picture command and that's just it.
The show picture method doesn't blend well as my only options are a difference blend, an additive blend, or an opacity (normal/alpha) blend.  The blending portion of this is the important bit and it can't be done sloppily -- if it is, then the screen becomes unreadable.

Throwing a phosphor grid into the show picture command doesn't work well with any of the default blending modes: see the below images.

Normal (100% opacity)



Additive (100% Opacity)



Subtractive (100% Opacity)



What I'm looking for:



The only way this can be achieved is by literally recreating the RGS***,dll, or at best rewriting a bunch of it
You're mistaken.  If I wanted to have a sound's volume vary depending on the distance I was from the emitting object I wouldn't have to go in to the core engine and rewrite the Audio module or 'literally recreate it'.  The tools that I would need are already in the engine.  The tools a coder would need to accomplish this effect are also already in the engine.  I'm not explicitly asking for shaders and FBOs - I'm asking for an approximation of a visual effect accomplished by overlaying an image with particular, custom, blend settings.  It'd probably run the fastest and be more flexible if done in a shader, sure, but I recognize that binding OGL/DirectShow functions and/or capturing the frame and messing with it and reinjecting it is something that's not trivial enough that somebody'd just do it for the heck of it as a request fulfilment.

It's not necessary to bind OGL functions into the game executable, hack up a new DLL to call OGL functions to/from, or even modify the core rendering system to accomplish advanced graphical effects in RGSS3.  There are plenty of scripts which don't require or use custom DLLs/EXEs but still replicate effects that would normally be done through a shader because what we've got in-engine is plenty powerful enough to achieve them (if a bit slow).

http://forums.rpgmakerweb.com/index.php?/topic/13941-map-effects/

Even most realtime lighting scripts don't require particular DLLs -- though they would likely gain an immense speed boost from doing so as that would move the processing from software rendering to hardware rendering -- but this topic is not about that.  There are many ways this could be achieved that I could think of that work decently, can't be done through events alone (or at least could but would require very particular and specific images), and also wouldn't require rewriting parts of the engine and/or binding/intercepting OGL/DirectShow stuff.

It is simply an effect they achieved through some videographics / cinematics effect.
Which is also what I'm looking for here.  I don't need a physically-accurate CRT shader (e.g. Fallout 3, Alien: Isolation).  I just need a decent visual approximation.
 
Last edited by a moderator:

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
It isn't about paying someone for a custom script. The only way this can be achieved is by literally recreating the RGS***,dll, or at best rewriting a bunch of it, which is essentially recreating RPG Maker. Do you know how much that'll cost ya? The overlay will have to do for now :p
Overlays do the job just fine.


zeus81 used images for all sorts of effects
 

FenixFyreX

Fire Deity
Veteran
Joined
Mar 1, 2012
Messages
434
Reaction score
310
First Language
English
Primarily Uses
Hmm, now that I think of it, I guess I'm kind of a hypocrite. After all, I did make this:


Heat Effect Tutorial


So yeah, what Tsukihime said; overlays will work, you just have to do it right. A bit of tweaking (or a lot, depends on how accurate of a representation you want).


I think the problem with your overlay now is that the RGB is separated; blur/blend it into a semi-blue-green transparent overlay (because you don't have a shader that will do this for you), and then overlay it.


Also, don't forget that you can set the map's tone, and also the overlay's color (as it's a Sprite object), so you can lighten / wash out the overlay and map as well to complete the effect in your last example pic.
 
Last edited by a moderator:

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses




Thanks for all the tips and so forth.  I'm still struggling to get it to look just right, but it's getting there.

Marking this as solved thanks to Muramasa's script snippet up there, the rest of y'all's encouragement/tips, and the some 6 hours I put in today to try and make assets which approximate what I wanted.
 
Last edited by a moderator:

orochii

Abomination of life, or life itself.
Veteran
Joined
Apr 29, 2012
Messages
652
Reaction score
364
First Language
Spanish
GameMaker and Unity have access to shaders (or something like that), in RPG Maker I think it would need some heavy workarounds (I am... pretty curious about zeus81's overlays though -he applies rotation, blending, colour and other built-in sprite properties, but still... performance is so sexy <3-).

Well, I think it looks really nice C:. I dig a lot the style in your menues, and the contrast between the back and the character seems pretty good too. Although I feel the effect seems better at the background and HUD (maybe because of the strength of the colours on it) than at the sprite (the black rips away the overlay effects, for example).
 
Last edited by a moderator:

Firgof

Artist / Designer
Veteran
Joined
Jul 29, 2012
Messages
236
Reaction score
214
First Language
English
Primarily Uses
Although I feel the effect seems better at the background and HUD (maybe because of the strength of the colours on it) than at the sprite (the black rips away the overlay effects, for example).
Aye, I agree.  I can't find a way to make it all blend uniformly without alpha/normal blending though.  When I do blend it that way, makes the game a little hard to read.  This would be one of those things that a shader would be good at! :p
 
Last edited by a moderator:

Celadon-G

Villager
Member
Joined
Jan 31, 2016
Messages
5
Reaction score
0
First Language
English
Primarily Uses
I literally just made an account to reply to this.


I tried to use @muramasa's script. I pasted it in at the bottom of main. Nothing happened. (One time I got an error message, which I tried to recreate, but couldn't.) I don't know what the problem is, but I think it is that it pastes as one long line instead of multiple lines. I tried to fix that by pressing enter where I found it logical. (See below.) Am I doing something wrong?


Edit: I used the first script they posted, and not the second. This is how I arranged it:

Code:
#Something like this at main.
$crt_overlay1 = Sprite.new
$crt_overlay2 = Sprite.new
$crt_overlay1.bitmap = Cache.pictures("crt_overlay_lines")
$crt_overlay2.bitmap = Cache.pictures("crt_overlay_grid")
$crt_overlay1.z = 
$crt_overlay2.z = 1000000000
$crt_overlay1.opacity = 128
$crt_overlay2.blend_type = 1
 
Last edited by a moderator:

orochii

Abomination of life, or life itself.
Veteran
Joined
Apr 29, 2012
Messages
652
Reaction score
364
First Language
Spanish
Yeah, for some reason the forum removed all linebreaks or something, I know it's not my fault. Really!


From what I can guess, you can try adding a number after $crt_overlay1.z =, like 1000000001 or 999999999. It's the only missing thing I can see.


Hope you fix it.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
Anything pasted below the Main script will only run AFTER the game has been shut down with the default "Shutdown" command.


You have to put that code before the Main script runs.


And yeah, that Z value is missing too. 
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top