How to make Cool Lasers?

Hi fellow Blender-ers,

I’m making a game, and I was looking for some cool laser effects.

I saw the game trailer for a Transformers game made a few years back, you may have heard of it, called “War for Cybertron”.

I would like to know how to replicate the laser blaster effect as shown at 35 seconds in this game trailer:

Is there a way to create that effect in, say, Cycles, and bake it to be used in the game engine?
Thanks!


https://youtu.be/XinVIq8VN4s

Well, that’s a cinematic. An animation, not in-game graphics so it’s going to look much better than anything we can make in BGE.
Still, there are ways of making cool effects in blender GE, but it depends on how much time and effort you want to devote to it. what kind of lasers do you want? Continuous beam lasers or laser bolts/bullets?


Hey! I am happy to say I am working on a laser and it works pretty sweet! So here goes!

This laser is a ‘cylinder’ object that extends along the y axis, assuming it is rotated so that the ‘length’ goes along the y axis (which I have decided I want to be forward in my case, you could make it x or z depending on what you want)

The important thing about this cylindar is WHERE the ORIGIN is! Snap the cursor to one ‘end plane’ of the cylindar, apply the origin there. If the origin is in the middle, the laser will shoot out ‘in either direction’ or ‘grow from the center’. If you set the origin from one end (towards the -y axis) it will extend toward the y axis!

So! This laser looks for a ‘player’, finds the distance to the player, and then scales itself to the distance between its origin and the player, add peeeewww effects! As long as this object gets loaded in ‘to scale’, as in, isn’t scaled to .25 or whatever, it will work perfectly! So! Here is the code ! YAYAAAA!

from bge import logic, renderfrom mathutils import Vector


cont = logic.getCurrentController()
own = cont.owner


scene = logic.getCurrentScene()
obj = scene.objects


delay = cont.sensors['Delay']


for i in obj:
    if 'Player' in i: # --- this says, if the property Player is in an object in the scene
        
        vectToPlayer = Vector(own.getVectTo(i)[1]) # --- gets a vector to the player
        vectToPlayer.magnitude = .5 # ---- assigns a speed for the vector (I'm pretty sure it will scale at this speed)
        own.alignAxisToVect(vectToPlayer, 1, 2) # ---- aligns its y axis (its forward, head pointy axis, to the player)
        distancetoplayer = own.getDistanceTo(i) # ---- gets the distance to the player
        own.scaling = (1,distancetoplayer,1) # ---- scales itself 'to' the player, assuming the origin correctly set
        if delay.positive: # ---- delay
            own.endObject() # ---- ends the laser

I like retro effects, so I am probably going to leave it as a simple object, shadeless, but if you want it to be fancier, do things like:

1.Change material properties, animate the ‘object color alpha’ to make the laser ‘fade out’
2. When the laser is added, cause a ‘stand by’ light’s energy to increase to create a flash and illuminate the area, as I learned from a Solar Lune video
3. Add 10 simple polygons that look like little doodads that add along with the laser and fly off like plasma juice or something
4. etc

You could use motion trail for creating laser shot and some shockwave muzzle flash. But to render it, if you have slower CPU, render shockwave animation first and then add it as movie in compositor later in the center of laser shot.
That’s how I intend to make it. Although I didn’t use motion trail for awhile. Maybe there is better way to do.

maybe a bloom 2d filter?

Speaking of this, just tried out the 2d filters for the first time today. the Sharpen filter looks AMAZING!!! And it would be great for a ‘laser shock’ effect if getting hit by a laser! I am just gonna use it for its cell-shady vibe

Thanks for the responses everyone! In reply to smoking_mirror, I’m sort of going for a single bolt laser. The part I’m trying to create is the “sprouting” of the laser from the blaster, similar to in the cinematic. Could I animate a shockwave frame by frame in Internal or Cycles, and then bake them to textures? If so, would the animation of such a shockwave need to involve a force field to direct the shockwave in one direction? (The direction the laser is coming out of the blaster)

Both, on Cy and BR. I’ve made one for you. You make laser blast and then in compositor get add node with movie and place it in correct frame and x,y position of the end of blaser. I think it’s much faster to render it than way.
https://dl.dropboxusercontent.com/u/13451287/sw0001-0100.ogv

I have another queston. Is it possible to make this movie a trigger ? For example, shockwave movie triggers in compositor at correct frame when laser hits the spot?

Thank you Vejn! That looks pretty awesome! In the game engine,you could make it a trigger. You would have to bake the shockwave on a texture and use either shape keys or key frames in the action editor to trigger when the laser collides with an object. The animated texture object ( your “explosion” object) would be stored in another layer. You then use an Edit Object actuator to add the laser explosion animation. This would all be happening in the game engine.

I have never done it. Could you point me to some video tutorial for triggers and this particular situation?

Of course! Here’s one for detecting if an object has touched another object:

http://www.tutorialsforblender3d.com/GameDoc/LogicBricks/Sensors_5.html

send me the blend file of the laser, and I’ll try to get back to you with a blend file by tomorrow.
Thank you!

also, is there a way to make lasers without cycles?