The Daily Click ::. Forums ::. Klik Coding Help ::. Glowmaps for lasers, fireballs and such
 

Post Reply  Post Oekaki 
 

Posted By Message

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
24th November, 2009 at 06:32:30 -

I would like to know how to make lasers and certain projectiles, objects and whatever possible glow

Question tough would that mean if there are too many glowing projectiles it would slow down the game? make it lag or something?

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
24th November, 2009 at 10:26:50 -

there isnt really any kind of "glow" feature. i know there is a pixel shader that does a "glow" effect in MMF2 HWA, but nothing that cant be done with simpler non cpu intensive methods. should be as easy as using the alpha channel in an image.

 
n/a

BattleCat



Registered
  08/09/2002
Points
  978

VIP MemberThe Cake is a LieIt's-a me, Mario!Wii OwnerPokemon Ball!
24th November, 2009 at 10:50:08 -

What I did (and this is so simple that it works in TGF1) was to create the light source as a ball of solid color that gradually goes more and more towards white as it gets closer to the edge. Then have this object be transparent.

 
n/a

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
24th November, 2009 at 12:44:24 -

Oh I wish there was a glowmap feature. The glow shader doesn't even work like that, Bloom 2D does but it's contained within the active and doesn't spread out.

What I just tend to do is load the image into photoshop. Add the glow effect in there, save as PNG and import back into MMF2. You have to jump through hoops to get the collisions working again though.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
24th November, 2009 at 14:25:39 -

Yes thats the word, blooming and I mean 2D blooming that is

Check these 2 screenshots below to see what I mean.

http://www.create-games.com/dcimg.asp?img=http://willay.clement.free.fr/demo/luor/screen3.jpg&ID=7710&n=3
http://www.create-games.com/dcimg.asp?img=http://www.create-games.com/uploads/puzzpower2.png&ID=7768&n=0

Edited by LavaWave

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
24th November, 2009 at 15:35:46 -

Well that Puzzpower one just looks like an OR ink effect, or whatever the older ones were before Add came along. Luor is most likely using photoshop enhanced objects. All you do for that is create something in pixel art, copy into photoshop, remove the black background, duplicate the layer and blur the lowest layer. Save as PNG and import into MMF2.

What they should add is proper post-processing effects that takes a bloom map and overlaps it over objects/layers. HWA supports shaders and its a start, but real PP would be excellent.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
24th November, 2009 at 17:39:50 -

nvm I got it trough using Gimp with it's alpha layering, I think there are better ways to do it tough but for now it looks good enough.

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
24th November, 2009 at 20:08:56 -

I did some lasers with some careful use of the alpha channel. Just put a fluorescent layer outside the laser/fireball, and make it semi-transparent. It works much better than some glow effects with lasers.

Main problem here is that the laser glows will be part of the collision too

Alpha channels won't slow down the game nearly as much as proper image filters, so it's a nice, low memory way to get special effects, if you're willing to hand draw all the alpha channels.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
25th November, 2009 at 14:08:54 -

Now that I am playing around, I used Gimp and gave it a glow with the laser but the laser indeed hit's the wall with the glow and explodes before it should in other words the glow is colliding with the obstacle as well, I tried putting collision with the laser but can't figure out how to do it properly, What I did is "Place LaserX (the collision) on Laser x0 y0" but the gun fires alot of lasers at once so it goes on the first laser, another thing is I did when laser dies the LaserX object teleports out of map/level view but you see it doesn't work properly when there is more then one laser at the same time, create LaserX I cannot figure out how to make it so as the laser is summoning alot of LaserX at once. (I putted create LaserX on "Always")

btw I am using "Shoot Object" when you press Shift to fire the laser btw, if you hold shift it fire the laser every 5 seconds as it's a rapid firing laser machine gun.

About drawing alpha channels I have no probs with that, I draw the alpha on Gimp, calculate the size of the glow with the object first and then put a blank glow object to apply on the projectile.

Edited by LavaWave

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
25th November, 2009 at 14:58:38 -

Muz, for the fluorescent layer do you mean making the transparency color fluorescent and using the alpha channel to create varying degrees of transparency for that color?

I've only really just started messing with the alpha channel feature a couple months ago and am still learning how to do it right. Right now I just use it for shadows mostly.

Edited by Del Duio

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!

Dr. James MD

Addict

Registered
  08/12/2003
Points
  11941

First GOTW AwardSecond GOTW AwardThird GOTW AwardPicture Me This -Round 26- Winner!
25th November, 2009 at 17:14:27 -

The alpha channel is basically a texture map for each pixels transparency. You could set each colour to be more transparent than another in a proper image editing app.
I hope they add support for more maps/channels in MMF3 like a bloom map, bump mapping etc alongside Alpha and Transparent colour.

 
Image
http://uk.youtube.com/watch?v=j--8iXVv2_U
On the sixth day God created Manchester
"You gotta get that sand out your vaj!" x13
www.bossbaddie.com

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
26th November, 2009 at 05:59:57 -

OK This is what I did I put pressing shift shoot laser and the glowmap, the glowmap doesn't have collision and dies when the laser dies, they are seperate objects and you shoot them both at once, is this the correct way to do it? because I think there is a better way to do it but this is my guess.

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
26th November, 2009 at 11:16:51 -

you can do this to get rid of extra actives.
put the collision map on one frame and the glow map on another.

1. force animation to collision map frame
2. detect for collision
3. force animation to glow map frame

doing this, it will use the collision map for the collision but mmf will only render the glow map.
this probably wont work if your laser is animated though.

edit: btw this is a good way to do detectors for anything else as well. instead of having a separate active for each detector you just use one active and have detectors on different frames, and force to that frame right before detecting for that specific collision. great trick.

Edited by Cecilectomy

 
n/a

LavaWave

Sin Binned (Broke The Rules)

Registered
  22/12/2008
Points
  -319

VIP Member
26th November, 2009 at 14:03:03 -

Recently I just got across something known as fast loops, do fast loops work for what I am trying to achieve here? I'l search for tutorials about fastloops in the meantime.

 
Visit my Newgrounds account.

http://lavawave.newgrounds.com

Rob Westbrook



Registered
  25/05/2007
Points
  193

360 OwnerVIP Member
26th November, 2009 at 15:19:45 -

LavaWave, if you have separate objects for the glow and actual laser beam then fastloops are definitely the way forward. When you create the beam and the glow, give them an identifier in their alt values. There's a couple of ways to do this, the most common being Spread Values. However setting the Alt Value to the "Number of Objects -1" also works (the -1 is necessary since fastloops are 0-index based)

Then to position the glow, start a fastloop with the same number of loops as the number of laser objects and add the condition:

-On Loop ("Loop Name")
+Alt Value of laser = LoopIndex ("Loop Name")
+Alt Value of glow = LoopIndex ("Loop Name")

then

Position the glow at 0,0 to the beam.

 
There are 10 types of people in the world: Those who understand binary and those who don't.
   

Post Reply



 



Advertisement

Worth A Click