Can grahics 2.0 be used to make cool laser weapon beam effect like this?

Hi,

First and formost, WOW! I tried all the examples and I really like what I saw! One of the thing I always to do with Corona is a space game with realistic laser/phaser beam effect like on this image:

http://store.steampowered.com/screenshot/view/204880/9/?size=800

or in this video:

http://store.steampowered.com/video/107200

Would graphics 2.0 able to handle that? I am talking about having a “laser” beam (line) from point A to point B with some glow like seen on many high level combat space games like Galaxy on fire, Eve online and so on.  That would be super cool :slight_smile:

Again congrats on releasing the graphics 2.0 beta!

Thanks.

Mo

Actually Mo, a pretty good version of this can already be achieved even in 1.0.

Just create an animated (if you want it crackling or something) laser beam image at the max length it will be used in the game. Then simply set its scale to transform as it’s fired say from 0.1 to 1. The only other thing you’d need to do is make sure you set the reference point to the start of the beam so that as it grows its start remains positioned at the firing point.

This is the method I used in my planetary command game a few years back for laser beams and missile trails.

Thanks Jacques1. That’s funny but it is the same exact technique I am using in my current game (not animated but that 's great idea) I was hoping that will all the great effects in GFX 2.0 p, I would able to simple draw a line between point A and point B and then some effect to make the line brighter in the middle and lower alpha on the edges of “line”. That way it would simulate a laser beam like shown above. By the way you game is very cool! Thanks again. Mo

Thanks Mo, your game is cool too. I guess your question is similar to what I’ve been wondering, whether applying filter effects to vector shapes/objects is possible. I suppose for sure if you have a 2 or great pixel width beam as an image file then 2.0 can easily add a blur/glow effect to it but then you’re still stuck with using a predefined image right. So hopefully will also find an answer to filters on vectors soon.

Yes that what I was thinking. Having a “wide” line drawn and apply some filters to it. Not sure if that would work but I am very jealous of the weapon effects on the games listed above. Given the amazing things GFX2.0 is able to do, I would think those laser beam effects would be a piece of cake for it!

Thanks again for taking the time.

Mo

Graphics 1.0 already has blend modes.  I did my blasters in Photoshop and added a glow to them and then in my apps, I added a blend mode 

phaserCenter.blendMode = “add”

to get it to blend into the background a little better.

yup Rob, but i think Mo was thinking of on-the-fly glow effects created from vector graphics, at least, that’s what I’m hoping can be done in 2.0, ie; adding filter effects to vector shapes.

You can add filter to rect objects for example. However the filter only applies the effect within the boundaries of the rect. So something like a blur effect will not work.

Maybe you can create a snapshot or container or something and apply filter to that? I’m not sure what the best way is.

Thanks guys for the ideas. I guess we will need to experiment with the new graphic engine. I lwill look into how the games above (and others) deal with those fantastic laser beam effects. I will share if I can come up with something.

Thank you all for taking the time.

Mo

I imagine they do it with either lighting blooms (as part of an overall screen bloom effect) or they just make the texture as wide as the beam plus bloom and use additive effects on the texture.

You can mimic some of that yourself, although you’d have problems making the ends match up (as ideally you’d have a semi-circular ‘cap’ for each end of the beam, plus a middle section that you stretch along the length of the beam). It is very simple in theory, but I’ve not done it in corona, so I won’t judge the workload until I know more about it.

Actually Mo, a pretty good version of this can already be achieved even in 1.0.

Just create an animated (if you want it crackling or something) laser beam image at the max length it will be used in the game. Then simply set its scale to transform as it’s fired say from 0.1 to 1. The only other thing you’d need to do is make sure you set the reference point to the start of the beam so that as it grows its start remains positioned at the firing point.

This is the method I used in my planetary command game a few years back for laser beams and missile trails.

Thanks Jacques1. That’s funny but it is the same exact technique I am using in my current game (not animated but that 's great idea) I was hoping that will all the great effects in GFX 2.0 p, I would able to simple draw a line between point A and point B and then some effect to make the line brighter in the middle and lower alpha on the edges of “line”. That way it would simulate a laser beam like shown above. By the way you game is very cool! Thanks again. Mo

Thanks Mo, your game is cool too. I guess your question is similar to what I’ve been wondering, whether applying filter effects to vector shapes/objects is possible. I suppose for sure if you have a 2 or great pixel width beam as an image file then 2.0 can easily add a blur/glow effect to it but then you’re still stuck with using a predefined image right. So hopefully will also find an answer to filters on vectors soon.

Yes that what I was thinking. Having a “wide” line drawn and apply some filters to it. Not sure if that would work but I am very jealous of the weapon effects on the games listed above. Given the amazing things GFX2.0 is able to do, I would think those laser beam effects would be a piece of cake for it!

Thanks again for taking the time.

Mo

Graphics 1.0 already has blend modes.  I did my blasters in Photoshop and added a glow to them and then in my apps, I added a blend mode 

phaserCenter.blendMode = “add”

to get it to blend into the background a little better.

yup Rob, but i think Mo was thinking of on-the-fly glow effects created from vector graphics, at least, that’s what I’m hoping can be done in 2.0, ie; adding filter effects to vector shapes.

You can add filter to rect objects for example. However the filter only applies the effect within the boundaries of the rect. So something like a blur effect will not work.

Maybe you can create a snapshot or container or something and apply filter to that? I’m not sure what the best way is.

Thanks guys for the ideas. I guess we will need to experiment with the new graphic engine. I lwill look into how the games above (and others) deal with those fantastic laser beam effects. I will share if I can come up with something.

Thank you all for taking the time.

Mo

I imagine they do it with either lighting blooms (as part of an overall screen bloom effect) or they just make the texture as wide as the beam plus bloom and use additive effects on the texture.

You can mimic some of that yourself, although you’d have problems making the ends match up (as ideally you’d have a semi-circular ‘cap’ for each end of the beam, plus a middle section that you stretch along the length of the beam). It is very simple in theory, but I’ve not done it in corona, so I won’t judge the workload until I know more about it.