Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Advice on achieving an effect.

Author
Message
Supertino
7
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 4th Feb 2018 20:41 Edited at: 4th Feb 2018 20:45
Any advice on how to achieve this rolling scan-line effect, specifically the highlighting of text and images, I thought AGK2 had a full set of blend modes I could experiment with so I could just move a line (sprite) down the screen but looks like we only have Additive. I assume the next port of call would be a shader?

Fast forward to 2:05
puzzler2018
User Banned
Posted: 4th Feb 2018 20:45
I did this a while ago



May be not what you after
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 4th Feb 2018 23:05 Edited at: 4th Feb 2018 23:40
Secondary sprites (all white) overlayed on top. Use spriteScissor to show a bit of white in relation to where the scanline is at. I made a quick demo.





Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
Supertino
7
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 5th Feb 2018 08:29
@Phaelax - you genius, I thought about overlaying a sprite but couldn't think of a way to only show a small cross section.
@puzzler2018 - yeah not not I was after but a neat effect none the less.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Feb 2018 15:16
I was hoping there was a way to turn a sprite all white without creating a secondary image by setting the sprite color, but I didn't work like I thought.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Riusz
8
Years of Service
User Offline
Joined: 27th Feb 2016
Location:
Posted: 6th Feb 2018 13:22
Hello,

I've try to make an image white with two methods : a memoryblock and a shader.
My code :


code of my shader called "white.ps" :


PS: if you click the color used with the shader solution is changed.

What do you think ? Which method is better ?

Riusz
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 6th Feb 2018 13:30
Well shaders are pretty fast. And if you can control manually what part of the image you turn white with the shader, then we can skip a 2nd image altogether. I considered a memblock, it'd be simple enough to just create a blank white image and copy the alpha channel over from the source. It may just slow down loading time a little.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 12th Feb 2018 05:35
Quote: "Secondary sprites (all white) overlayed on top. "

Very handy way of doing so and I believe fast

Ive also found that fog can be produced by using a large transparent png
http://users.tpg.com.au/subarpk/blackCircle.png
it dithers from black to totally transparent and set to the front
this in efffect makes the edges look dark

very similar to this and you could instead of lighting the visible sprite look at darkening the other sprites
with a dithered black.

I used Gimp to create mine becuase its great and i like the price free lol
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Feb 2018 03:09
I once did a dynamic light source from text.
https://forum.thegamecreators.com/thread/176757 (a little shameless self-promotion)
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Supertino
7
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 13th Feb 2018 12:15
Thanks all, as I wanted to emulate an old school green displays, think of the displays in the Aliens movies; I took the approach of drawsprite() any sprites (inc. text) I wanted to display to the back buffer (these are white) and grab that area of the screen twice to create two sprites, I keep one as white and I tint the other green. not sure if this is recommended for real time so I'll probably only grab new sprites only when needed.

Additionally I created a 3rd sprite using drawline to create a scaline overlay.

Lookout for these cool looking displays in my forthcoming game "Galactic Trainspotting simulator".
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 13th Feb 2018 15:57
What about using a shader for the scanline effect? Can AppGameKit even do fullscreen shaders?
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 13th Feb 2018 20:46
Quote: "What about using a shader for the scanline effect? Can AppGameKit even do fullscreen shaders?"


https://forum.thegamecreators.com/thread/214598?page=1
has many shaders that you may find useful there is a scanline shader and a modification to jacks lensshare shader (page 3) instead of using
a sun going down effect could be just a line that moves down the screen instead
fubar
janbo
16
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 13th Feb 2018 23:24 Edited at: 14th Feb 2018 00:05
Hey I hope I don't disturb any creative approaches to create this effect but here is a shader I made for you today.

AGK:

Fullscreen Shader

Login to post a reply

Server time is: 2024-11-24 00:36:33
Your offset time is: 2024-11-24 00:36:33