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 / Understanding shaders, making sprites glow?

Author
Message
Fluorescent
FPSC Reloaded TGC Backer
18
Years of Service
User Offline
Joined: 1st Aug 2005
Location: Stockholm, Sweden
Posted: 11th Jan 2015 14:00
I've been working on a sokoban clone as a way of understanding the different parts of making games.

Now when the player pushes a box over a target, I want to apply a shader that makes the box glow. And I've been looking through this forum and other places for more information about this.

If I understand correctly, that I need is to clear the screen. Draw the box or boxes that should glow and only those sprites. Apply a blur shader and render to image. Apply a bloom shader and render that out to an image. Then show that image on some kind of surface, redraw the rest of the scene and render to screen.

Is this correct? As an example I've been looking at the bloom shader that comes with agk and the 2d soft shadows project that Janbo posted in AppGameKit Showcase forum. Do I have to create 3d objects for this to work?
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Jan 2015 14:44 Edited at: 11th Jan 2015 14:46
Hi,

If you want to
Quote: "understanding the different parts of making games"
you probably don't need shaders at all not?

But i see that parts of your suggestion are right.
And yes, you can make the everything sprite only.

For now you can just draw your sprites to an image and throw the Bloom shader at it.
Make sure the threshold is low enough if you want the whole sprite to be glowy.

Take a look at the User Demos there is my Demo labyrinth wich uses the Bloom Shader for glowy things(but 3D).

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 12th Jan 2015 08:24
If you are talking about a 2D game then you can do all of this with 2 images pre-made in a graphics program and used as 2 separate sprites, the box drawn over the glow image.

unlikely
12
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 12th Jan 2015 15:48
Yeah, for something like this effect, I'd recommend forgoing shaders and just do as baxslash suggested. It will be a lot simpler code wise (probably), and more importantly, will not be as large of a performance hit (probably.)

Login to post a reply

Server time is: 2024-05-06 06:02:44
Your offset time is: 2024-05-06 06:02:44