Creating a light source in a model?

How does I do that?

What I’m trying to do is make a weapon light for a weapon model. I want to use it in a game and I want it to actually work to light up the environment. So how would I go about making a texture that emits light, particularly for a .nif export?

I believe what your referring to is dynamic lighting? If so, there is a script written my Martinsh on this forum(and his youtube) that shows an example of dynamic lighting used in the BGE. I think it is just experimental though because as far as I know, It has not been implemented into the official build of the BGE( yet :eyebrowlift:)

Unreal Engine 4, Cry Engine 3, Frostbite 3 and Forgelight are right now the only game engine that supports “real” dynamic lighting. Tell us which game-engine your using, and Ill tell you if you can have real dynamic lighting, or your going to have to fake it with a script.

I’m making the model for Fallout 3 so I believe that’s Gambryo? or… Havok I think is the physics engine.

And as a matter of fact I’m not worried about making the weapon light functional for lighting the environment right now. Right now all I want to accomplish is making it look a like it’s glowing bright like a light. The game has a piece of standard equipment that has a light that the player can turn on/off using the TAB key (it’s called the PipBoy, it’s a wrist mounted computer), so ultimately I plan on stealing whatever code they used to accomplish that and applying it to the weapon light if possible so the player can actually turn it off and on along with the piplight and it will provide additional very bright focused light in the direction the gun is aimed. That’s my plan but like I said right now I’m just trying to figure out how to make the model look like a light.

So one of the first things I did was import the PipBoy model to Blender to check it out. It has an object above the light up screen which is just a transparent object colored with a shader and textured with a light effect .DDS file. In game the end result of it is that it appears as a glowing light sort of haze effect that fades as it eminates away from the actual PipBoy.

I tried cut and pasting it onto the weapon model I’m making which kind of almost works, except I haven’t deleted the link to the shader so the light is green (I want white), it’s the wrong shape, and it doesn’t have the code to behave like an actual light source so the environment around it isn’t actually lit. But it looks like it’s glowing so it looks like the light is turned on kind of?

The other thing I tried was making an object myself from scratch but I can’t seem to figure out how to map the alpha so it looks transparent, and when I even try to apply alpha I get an export error when I try to export the .nif, and although I textured the object using the same light effect .DDS from the game files it does not appear to glow at all in game.

So here’s some screens…


This is the shader. I need to figure out how to unpack these from the game files and edit them.



And here’s a visual of the alpha, the shape fades from nearly opaque where it would normal be just above the screen to almost invisible at the edges…

Here’s the export error I keep getting whenever I try to export a material with alpha


And here’s the light as I cut and pasted/edited scale and orientation from the pipboy model to my weapon light model. Using NifSkope.


[ATTACH=CONFIG]280856[/ATTACH]

As you can see the light on the weapon doesn’t actually light anything up so I’m missing something. But it does appear to be glowing its self, so that’s what I’m more concerned with figuring out right now. How to achieve that effect (and the alpha) in my own model without cut/pasting…

[ATTACH=CONFIG]280854[/ATTACH]