Torch beam reveals alternate scene?

Hello All! I want to create an FPS game environment where the player’s torch beam illuminates a different version of the blender scene they’re in. I have a couple of ideas on how it might be done but has anyone succeeded with anything like this before?

I want the light to illuminate ghostly figures that are only visible when the torch is pointed their way. I hope this is do-able.

I’ll experiment with it tonight and post if I get anywhere with it.

EDIT: I thought I might be able to do it with a duplicate torchlamp lighting up just the objects on another layer - but that won’t work.

Attachments


check this out

I use a collision sensor to set a property in the ghosts, the ghosts then set this back to zero over like 9 frames or so.

Attachments

ghosties.blend (474 KB)

Thanks BPR - that certainly works. It’s a little late here so I’ll carry on with this tomorrow. If it works, it’ll be a nice little scary experience.

This seems to be working! It took me a while to dissect what BPR had done to build his scene - but it works roughly how I want. It’s certainly useable despite some collision detection issues.

Once these guys are properly designed, mobile (animated) and have their audio (which you’ll be able to hear even when you can’t see them) they should be pretty scary.

This effect may be similar to what you want:

At 22 seconds you can see the “scan” mechanic where you can see objects behind walls etc. This is done by using a clever node material and some Z-offset.

A simple setup that will make an object only appear in the torch beam is:


And it runs per-pixel, so even if the object is big, only what is in the torch beam will be revealed.

Damn that node setup is neat! I’mma borrow it for some dust particles : 3

that is awesome sdfgeoff,

I am going to use it for packets of puzzle data :slight_smile:

Thanks sdfgeoff, that’s very helpful. I’ll try it out tonight.

Well - that’s working, and it’s looking very promising too. I thought it would be nice to add some blood splatters to the walls using the same method. At first I tried duplicating the corridor meshes with alternate texture files but they didn’t show properly. So, I’ve changed tack and tried blood streaks on alpha’d PNG files on cards just in front of the corridor wall geometry.

As you can see, this isn’t working. I can’t stop the light from illuminating the poly card the blood splat is on. Any ideas?

in the nodes, you need to have your alpha card always effecting alpha, for the card, while the illumination needs to mix into that somehow in a manner that adds to the alpha of the blood only.

maybe have a mix node between( full transparent / card transparent blood show)based on if illuminated by lamp or not?

You’ll need to do:

The multiply node is a math node set to type multiply.

I got a little further with this and modelled a proper version of the dead guy in the torch beam. Here he is:


There’s a build thread for him here:

https://blenderartists.org/forum/showthread.php?414048-Floaty-ghosty-torso-zombie-dude
I might have solved the blood splat alpha issue too. If it works I’ll post on here.

Well, here we are. The blood is showing properly and my new dude is happy in his new home.


I’ll create an animation for him next.

Attachments