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.

Author
Message
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Jan 2018 11:04 Edited at: 30th Jan 2018 11:06
Hi All,
It's been a while! I have been working on this idea for making a retro game for a while and finally got a little time to start working on the main shader. It started out in code using memblocks just to get the look right but I was getting about 3fps which isn't quite good enough. Now I have turned it into a shader which can work around 400fps on my machine and works around 150fps in my game engine at 800x800 pixels. The game actually only needs to create these images every second or two anyway at much less than 800x800 so this is WAY fast enough for my game idea. Anyway below is a test I ran on a googled image:


EDIT: A small explanation. You can add a palette of colours for the shader to use from as little as 2 to as many colours as you like. This image is done using 18 colours including pure black and pure white.
Using AppGameKit V2 Tier 1

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 30th Jan 2018 13:30
A dithering shader! Looks great
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Jan 2018 13:46
At a basic level yes! It also effectively posterizes to a palette you can set yourself. It selects the closest mix of colours to the pixel colour and uses one or the other depending on whether it's an even/odd x/y co-ordinate. You just need to edit the length of the array in the shader based on how many colours you have in your palette. This could be made more dynamic using a palette count if required but suits my needs as it is.

Shader code:
Using AppGameKit V2 Tier 1
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 30th Jan 2018 16:40
I love that effect! It looks like Preben's C64 shader in GG Loader (https://forum.thegamecreators.com/thread/216912?page=2#msg2592126).
GaborD
6
Years of Service
User Offline
Joined: 3rd Dec 2017
Location:
Posted: 30th Jan 2018 16:54 Edited at: 30th Jan 2018 16:58
Really cool. Would be fun to apply to a 3D game for a weird, interesting look.

You could also think about the process as color grading, which would allow to simplify the shader a lot. You'd just have to add the pattern (or noise if you prefer PS style diffusion instead of a pattern) before you colorgrade.
I played with this idea for a 16 color compo, unfortunately not in AppGameKit, thus I have no AppGameKit code.
Because it was just a simple colorgrading lookup, it ran at 1000s of FPS. Would work with a pattern too, it would just have to be exactly aligned to the screen.
An old testshot attached, was realtime 3D being converted to a 16 color palette.

Attachments

Login to view attachments
Bengismo
6
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 30th Jan 2018 17:02
Wow, that looks cool. Good shader for some retro nice retro effects.

Is it a pixel shader (for3d) or a fullscreen shader (2d) ??
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 30th Jan 2018 17:13 Edited at: 30th Jan 2018 17:13
Quote: "I love that effect! It looks like Preben's C64 shader in GG Loader (https://forum.thegamecreators.com/thread/216912?page=2#msg2592126)."

Yes, it's not far off that!

Quote: "Really cool. Would be fun to apply to a 3D game for a weird, interesting look.

You could also think about the process as color grading, which would allow to simplify the shader a lot. You'd just have to add the pattern (or noise if you prefer PS style diffusion instead of a pattern) before you colorgrade.
I played with this idea for a 16 color compo, unfortunately not in AppGameKit, thus I have no AppGameKit code.
Because it was just a simple colorgrading lookup, it ran at 1000s of FPS. Would work with a pattern too, it would just have to be exactly aligned to the screen.
An old testshot attached, was realtime 3D being converted to a 16 color palette."

Yes, I am planning on using it on a 3D world. Just not updating "realtime". The speed is plenty fast enough for now but I might use a lookup if necessary.

Quote: "Wow, that looks cool. Good shader for some retro nice retro effects.

Is it a pixel shader (for3d) or a fullscreen shader (2d) ??"

It's a sprite shader. I am rendering to an image, using the image in a sprite which has the effect applied. Here's a screenshot:
Using AppGameKit V2 Tier 1

Attachments

Login to view attachments
Preben
AGK Studio Developer
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 30th Jan 2018 17:49
baxslash: This should speed it up a bit, j loop:


Yes it can look pretty cool in 3d, this is a AppGameKit skybox with some smoke
https://www.youtube.com/watch?v=AX9JY09mgK0
Subscribe and checkout great AppGameKit video's here: Videos click here
Latest GameGuru Loader news: News click here
Get GameGuru Loader PBR version here: Steam click here
best regards Preben Eriksen,
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 30th Jan 2018 22:03
@baxslash that is very nice!

Also check your messages when you get a free moment.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 31st Jan 2018 08:03
Hi Preben, I had to edit it slightly to get the same effect:

With the same effect it actually runs about 20fps slower, which surprised me. Looked a lot simpler mind you!

Like the effects you have going there! I was considering using the Game Guru loader for building my game world but I am still considering creating the world procedurally.

GarBenjemin, I have sent you a PM.
Using AppGameKit V2 Tier 1

Login to post a reply

Server time is: 2024-04-25 14:25:51
Your offset time is: 2024-04-25 14:25:51