Glow effects

I want to recreate this glow effect in code:

http://www.gamelizard.com/images/games/rimscape/glow_effects.png

You can see it around the text and the ship images. Anyone know how I’d go about doing that? I’d like to be able to do it in code so that I wouldn’t have to pre-create all that. Thanks!

The OpenGL Superbible (Publisher: SAMS) has some stuff on dilation and erosion in chapter 23, which looks a possible starting point. It uses Fragment shaders.

“Dilation grows the size of bright objects, whereas erosion shrinks the size of bright objects (They each have the reverse effect on dark objects)”

As a openGL beginner, I haven’t done more than skim the chapters on shaders. Maybe worth googling on “opengl” “shaders” and “erosion”. Lots of duff stuff came up but this looked interesting:
http://collective.valve-erc.com/index.php?go=tron1

[quote]The OpenGL Superbible (Publisher: SAMS) has some stuff on dilation and erosion in chapter 23, which looks a possible starting point. It uses Fragment shaders.

“Dilation grows the size of bright objects, whereas erosion shrinks the size of bright objects (They each have the reverse effect on dark objects)”

As a openGL beginner, I haven’t done more than skim the chapters on shaders. Maybe worth googling on “opengl” “shaders” and “erosion”. Lots of duff stuff came up but this looked interesting:
http://collective.valve-erc.com/index.php?go=tron1
[/quote]
I’ve read about that before, to be honest I think its complete overkill for what malohkan is trying to do ! Its a neat effect though. In terms of effort, the way you’re doing it know is probably the easiest way. I presume you just have alternate images for the text/ships ? I was trying to think of some jiggery pokery you could do in a sort of multipass way and SRC_INVERT or something so you could use the same image and just additively blend it over the original but it probably wouldn’t be general enough.

Is that the new GUI for rimscape ?? Its looking pretty good ! much better than the previous one if you don’t mind me saying. Is that actually in the game yet ? or still in dev ?

D.

The lines in the list has a background. Selected background looks greenish, unselected is black. You can store the images of size 5x5. Then break it up into 3x3 images that the center is stretched to fit whatever area you want.

Looks like the selected line is the only one that influences the ship. You draw it like this:

  1. draw green background opaque
  2. draw ship
  3. draw green background with transparency. Experiment with what looks look. Maybe 50 %.
  4. draw text

The text looks like it has a glowing effect, but that is all part of the font.

Ask your artist what he did in adobe. Atleast then you’ll know exatcly what was done.

Yup, that’s part of the new GUI design for Rimscape. I’m working on a GUI system that will be applicable for multiple games right now, and while working on it I’m considering how to generalize all of what I have for reusability, and the one thing I see in that image that won’t be generalizable is the glow effect. So in studying that effect I thought, “how the heck am I gonna do that?” :slight_smile: When I asked my artist about it he said it was, “just a drop-shadow glow.” He uses Paint Shop Pro 8.

I could perhaps just make a sprite sheet for the font, but with the handy tools you gave me for creating an OpenGL usable AWTFont (as you called it, Tom) on the fly, I would love to just create that object and then apply the effect to it. As you can see with the ships, they also have the same exact glow effect on them. I don’t want to have to have a whole separate stash of ship images with just the simple glow effect applied to them somewhere else. I would much rather take the same image, then make it glow in code.

It is possible to do it in code, but it’s just so much more complicated than telling your artist to knock up another version. Or just forget about the effect and draw the default ship. Your artist probably used 5 seconds to do the effect so that the prototype image would look better. The real game don’t have to look that good.

The AWTFont extends ImageFont that have a constructor that takes an image. With that you can create a font that will look like anything you wan’t. You just have to tell your artist how you wan’t it. Basicly all the characters has to be on one line with a vertical line of a special color separating them.

It’s not that complicated. Use imaging extention ( notably glConvolution… ) and a bluring kernel to “grow” your pictures, then apply a sharpening kernel to intensify it.

sounds great! How do I do that? :wink: It’s worth a try I think

  1. Load your sprite in a texture.

  2. Create a large bluring kernel ( search goole about convolution kernel or look at the java.awt.image.ConvolveOp class ). It is nothing more than an array of weights applied on source pixels to produce a destination pixel.

  3. Load the kernel using glConvolutionFilter2D

  4. Configure post convolution scale to intensify the glow.

  5. Enable convolution : glEnable(GL_CONVOLUTION_2D_EXT)

  6. “Blit” your sprite

  7. Disable convolution

  8. “Blit” your sprite again.

I must admit I’ve never tried it =) I dont even know if it is accelerated on common opengl cards.

[quote]It’s not that complicated. Use imaging extention ( notably glConvolution… ) and a bluring kernel to “grow” your pictures, then apply a sharpening kernel to intensify it.
[/quote]
Only, there is not a single card that supports that extension: http://www.delphi3d.net/hardware/extsupport.php?extension=GL_EXT_convolution

heres a solution that could work for your text :
If the text images are alpha masked (which I presume they are) , you could additively render a blue quad over the original text image, using the original image alpha mask on the quad. This would make the outlines blue (as above) and the text white ( 0,0,0 + 0,0,255 = 0,0,255 and 255,255,255 + 0,0,255 = 255,255,255) . use glTexCombine to do it. I can’t remember how to do it off the top of my head, I’ve done something similar before for terrain texture splatting (IE using one texture for color and another different texture’s alpha channel for the alpha mask), but I could dig up some of my code if you’re interested.

D.

Convolutions are part of the imaging subset ( ARB_Imaging ) that is widely supported … by NVIDIA only :frowning:

The website you mentioned is quite handy !