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.

Code Snippets / [DBP] Pixelate your game (old school look)

Author
Message
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 21st Feb 2010 06:09
Hello friends,

Do you want to give an old school look to your game?

Look no further.. welcome to Pixelate!!!
hahahaa

This is a very very simple way of pixelate your game. Just call pixelate() before your main sync loop.

Usage:

pixelate(factor)
factor is a number from 1 to ....
1 means no pixelation, if you increase factor, pixelation increases.

Example:



Screenshot:



The function that makes the trick:



Just replace freeAssset with a free image and sprite number and replace camera with your current camera.


The screenshots.

Pixelate(1) //No pixelate


Pixelate(4)


Pixelate(6) // My favorite...6, 6, 6... the number of the...


Pixelate(8)


Pixelate(16) // too much!!



I will upload a video soon!

Enjoy.

Best regards

JF
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 21st Feb 2010 09:15
Hello,

Sorry for the double post but I cannot edit my posts

Well... the video:

http://www.youtube.com/watch?v=F0HYvA52t7Q

Best regards

JF
vampirictorch
14
Years of Service
User Offline
Joined: 20th Feb 2010
Location: Kansas
Posted: 22nd Feb 2010 13:08
i haven't really got into my darkbasic yet been messing around with fpscreator recently but I hate to see good work go to waste so nice job, just some acknowledgment your way

Cybermind
Valued Member
21
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 22nd Feb 2010 15:01
sweet very cool snippet

The byte chrunchers are coming...
DIVIDING BY ZERO/BECAUSE WE SUCK...
Silvester
18
Years of Service
User Offline
Joined: 7th Dec 2005
Location: Netherlands
Posted: 22nd Feb 2010 16:12
So this is like.. Anti-Anti-Aliasing? Seems interesting though.


EDP Map Editor[2D]
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 22nd Feb 2010 19:16
Hello guys,

Thank you for the comments!!

I'm thinking about remaking a level from Wolfestein 3D or Doom using this function

Best regards

JF
Softwizz
14
Years of Service
User Offline
Joined: 14th May 2009
Location: U.K.
Posted: 26th Feb 2010 02:09
Thats pretty awesome:
Quote: "I'm thinking about remaking a level from Wolfestein 3D or Doom using this function"


Perfect.

Nothing to see here, move along please.
Neuro Fuzzy
16
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 26th Feb 2010 05:19
Quote: "Anti-Anti-Aliasing"

lol!

cool code snippet! might use it some time just for fun.


jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 26th Feb 2010 08:15
Hello guys,

I've been playing with the Pixelate function and with the help of Sven B, I could code a simple depth of field effect without using shaders, it is "a fake effect" but it looks similar to the real one.

I used the effect in this FPS demo made with DBPro:

http://www.youtube.com/watch?v=oJpWBtu8W6M

Have you played Black? If you have, you should remember the effect when you reload your gun.


The effect is based on camera and sprite manipulation, and it uses AdvancedSprites DLL. It is very similar to the Pixelate function but it leverages the resizing algorithm in AdvancedSprites.

Best regards

JF
Yitzu
15
Years of Service
User Offline
Joined: 14th Feb 2009
Location:
Posted: 24th Apr 2010 05:25
Can u use it in a 2d game??? That would be sooo cool
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 24th Apr 2010 22:46
Hello,

Yeah.. that would be great.

I don't think it is possible with this function, but I recommend you to check the eXtends Expansion Pack: There is a function called "IMG Mosaic" that pixelates an image.

You can pixelate the images using a graphical application (like Gimp) before using them in your game, as well.

Hope this helps.

Best regards

JF
Jaeg
18
Years of Service
User Offline
Joined: 16th Mar 2006
Location: Indiana
Posted: 28th Apr 2010 15:18
I'm certainly going to use this. My fps takes place in a digital environment and this would make for a neat effect when entering a level or dyeing. Maybe even a possible vision blur when a big enemy hits you. Hmm... possibilities.

Thanks!

If you get mad and want to type something nasty about another person do this-Type what you want to say in the box then press ctrl-a and hit delete then type what you should say.
General Jackson
User Banned
Posted: 29th Apr 2010 22:20
Cool nice job

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 1st May 2010 17:00 Edited at: 1st May 2010 17:06
Very interesting, didn't know we can do that.

Butter fingers
18
Years of Service
User Offline
Joined: 20th Mar 2006
Location: Mecca
Posted: 10th May 2010 17:57
Nice effect but It's a bit slow though right?

you don't need to "set camera to image" every loop, you could do that once, outside the main loop. The camera will remain rendering to the image once the command is called.

I want robotic legs.
jfroco
14
Years of Service
User Offline
Joined: 1st Dec 2009
Location: Chile
Posted: 11th May 2010 06:45
Hello Butter fingers,

Yes, I know. I'm not doing it. I call the function before the main loop.

Best regards

JF
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th May 2010 17:13
Nice idea.

I think the following works as well:

jeffhuys
17
Years of Service
User Offline
Joined: 24th May 2006
Location: No cheesy line here.
Posted: 12th May 2010 00:35
Quote: "Anti-Anti-Aliasing"


You mean... Aliasing?


Login to post a reply

Server time is: 2024-04-26 07:17:53
Your offset time is: 2024-04-26 07:17:53