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.

Dark GDK / Blur on sprites

Author
Message
Szymat
14
Years of Service
User Offline
Joined: 17th Oct 2010
Location:
Posted: 7th Jan 2012 19:51
Is it possible to blur sprite or whole screen? I'm using dbSprite not bitmaps. I have no 3d objects.
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Jan 2012 03:49
void dbBlurBitmap ( int iBitmap, int iBlur ); // iBitmap 0 will blur the screen.

To blur a sprite, I would prepare the images first.

dbLoadImage ( "sprite.bmp" , 1 ); // Load the sprite image
dbCreateBitmap ( 1, 32, 32 ); // Create a bitmap the same size as the sprite image.
dbPasteImage ( 1, 0, 0 ); // Paste the image to bitmap 1
dbBlurBitmap ( 1, 6 ); // Blur bitmap 1, second value is blur amound (1 - 6)
dbGetImage ( 2, 0, 0, 32, 32 ); // Get image 2 after blurring the bitmap
dbSetCurrentBitmap ( 0 ); //Set current bitmap back to the screen
dbDeleteBitmap ( 1 ); // Delete the bitmap

Just switch the image number in the dbSprite command to show the normal or blured sprite image.
Szymat
14
Years of Service
User Offline
Joined: 17th Oct 2010
Location:
Posted: 8th Jan 2012 13:22 Edited at: 8th Jan 2012 13:28
Wow, I have about 1200 sprites, and I want to blur them all, Will it not be a little bit you know, laggy?
And ummm... I have PNG files ;p
But ok, I will try, thanks anyway
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Jan 2012 15:09
The method proposed would only need to be done once. If you are wanting to blur them on-the-fly, then that's a tall order. Give an example of what you are trying to achieve.

The fastest code is the code never written.
Szymat
14
Years of Service
User Offline
Joined: 17th Oct 2010
Location:
Posted: 8th Jan 2012 15:41 Edited at: 8th Jan 2012 15:42
I want to blue whole screen with gaussian blur method.
Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Jan 2012 16:12
Blue as in the color? or blur?

There may be some "post processing" .fx out there. Sorry I have never tried that.
http://www.evolved-software.com/shaders/postprocessing
This may help, but I don't know if it will work on 2D.....

The fastest code is the code never written.

Login to post a reply

Server time is: 2024-11-19 04:16:38
Your offset time is: 2024-11-19 04:16:38