Simulate CRT

Previous topic - Next topic

quangdx

Hello everyone,
does anyone have any idea how I would simulate a CRT effect with GLBasic?
As covered in this article
http://gamasutra.com/blogs/KylePittman/20150420/241442/CRT_Simulation_in_Super_Win_the_Game.php
I make a lot of stuff in a low res, like 320x200 and 256x244 and it would be nice to give the player the option to have a CRT effect in place.
I've read elsewhere in the forum that GLBasic supports shaders, but I don't know where to even start with shaders.
Any help would be great, thanks.

Asobi tech - the science of play.
Spare time indiegame developer.

quangdx

Asobi tech - the science of play.
Spare time indiegame developer.

erico

I didn´t check the links, but you can probably do by rendering your game on a virtual screen and uvmap it on a 3d tube.
Apply a scanline map with a set transparency and someother bits and bobs, like another map with darker borders and so on.

Overall, I will be sincere, I fully dislike crt simulation and on all games with it, I search for how to turn it off, like the locomalito´s games.
Cheers.

quangdx

UVMap erico?
I appreciate you may not like the effect. But that's why you give the choice to the player.
Asobi tech - the science of play.
Spare time indiegame developer.

kanonet

You can simply draw an image with Alpha channel on top that contains those buttom to top lines etc. Would need proper alpha mode settings too of cause.
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

quangdx

Quote from: kanonet on 2015-Aug-27
You can simply draw an image with Alpha channel on top that contains those buttom to top lines etc. Would need proper alpha mode settings too of cause.

That's fine for the scan lines,
but I was more looking for the curve of the CRT and to some extent the separation of RGB channels.
Asobi tech - the science of play.
Spare time indiegame developer.

mentalthink

For do the curve you can use Polyvector tray to do a "mesh" with divided segments and use the UW map like said erico, (Take a look to polyvector you will see what I want say with UW).

Another way but really I think don't works, is: In 3D put a plane curved, use a viewport for paint in 2d, and use grabsprite and capture the 2d viwewport (perhaps using memsprite runs quick, but I don't know how works) , then paint this sprite in the 3d mesh with X_texture, but I think this will be very slow and you can see the game working fine.

About divide the RGB channels, search in the forum, we have some tutorial about this, I think in sample folder have one, is easy to do.

No more ideas  =D

erico

The 3d uvmap that Mental described is what I meant.
You can CREATESCREEN and do your game stuff there, then use it as a texture on a tube curved 3d object.

kanonet

I think you would need a mixture of different technics:

-Alpha overlay image for scan lines

-USESCREEN+POLYVECTOR for drawing in curved shape

-Color distortion/RGB separations could be achieved either by shipping your game with a second set of images in that colors or manipulate them on loading with MEM2SPRITE etc. I would not go with manipulation on runtime, that probably would be to slow. If you can use shaders on your target devices this also is an option. Or did you try if you can achieve a mild version of that effect with a special semitransparent overlay image and some playing with settings for alpha blending?
Lenovo Thinkpad T430u: Intel i5-3317U, 8GB DDR3, NVidia GeForce 620M, Micron RealSSD C400 @Win7 x64

Hemlos

Please, no offense...
Lemme get this right, you WANT your game to look crappy??

I remember the CRT days......I want to make mention about the image that is simulated on the link to the tutorial ...
This simulation of a CRT tube , is one that:
A. the crt monitor is in CRAPPY CRAPPY condition, probably old.
B. Probably sitting next to a stereo speaker, or even ON a speaker.

CRT were distorted by magnets......thats what usually caused that weird color shift.

A shader can definetly do this to any game, but the shader will need to be custom designed for GLBasic language, by you.
In other words...you need to edit your shader, so that it can accept the proper inputs from your program.
X_PUTSHADER only lets you pass floating point numbers....sad but true.

Perfect in your case: you only need to send GETTIMERALL(), the shader should be able to do the rest of the work.

Bing ChatGpt is pretty smart :O

erico

Yep, I guess for old people, that dirty arcade with a crt that was never cleaned and was probably burned with the game´s title looks crappy.
But there is the nostalgia thing and it is also cool to nowadays kids to experience such. Personally, I never liked it.

I think using shaders would be overkill, even a 3d object would be too.
My guess is that Kanonet´s solution is the best one.

spacefractal

im would also not like deformed picture either, that does not work on LCD at all. Also many 16 bit games also ran on monitores using scanlines.

So instead, its better to uses color blending, noise, scanlines, motionblur and such artifact effects. Scanline is property the easiest one.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Ian Price

Yeah, I don't see the point of CRT style games either. I love and have loved thousands of old games, and I've been there with them throughout the history of gaming, and I'm a real chunky pixel guy, but scanlines and such? Nah.
I came. I saw. I played.

MrTAToad

They tried it with the remake of Flashback, and, in addition to no sound, it wasn't great...

erico

Also, if you want the tube look, be sure that the output of your game is in a very high resolution, otherwise you will have problems with broken pixels and blending.
A 320x240 game will work on a full HD resolution. Same game with an 800x600 will have a lot of garbage.