I have an object with a material that emits its own light (using baked textures) and I have a spot lamp that lights my character and casts a shadow to the material, however, that material is also receiving light from my lamp, which I don’t want. I want my material to generate its own light, and simply use the lamp’s shadows to subtract from the light my material emits. Is this possible?
I’m not sure, I think you need to make your emitting material shadeless.
You can use the ‘Only Shadow’ option on the spotlight. Then just adjust the energy to make the shadows darker or lighter.
If you do want the spotlight to light other things then either do what Monster said or use different layers.
You can also enable emit, but the only way for it to really emit light, you need to add a light to the scene!
That removes the show completely.
This works for the ground material, but I need the spotlight to light my character. Not sure what you mean by using different layers, but the layer option didn’t seem to do anything in the game engine.
The material is an emit material, using a texture that was baked from rendered lighting. However that only really works for static items, like the level, and not for characters that move, so I still need dynamic lighting on my character.
I’m guessing what I need to be done might need python. Anybody have any ideas?
The best lighting scenario in my game is this
Texture Layer 1 = Base lighting, essentially just AO, other ambient light.
Texture Layer 2 = Main lighting. This gets added to the first layer. Shadows would subtract from this layer, and not Layer 1.
That would be the best case scenario, but I would be fine if the shadows were just subtracted from everything, if that’s the only way to do it.
For reference, I’m trying to make a Sonic game using an engine similar to Sonic Unleashed’s Hedgehog Engine, which heavily relies on baking. Here’s a sample image of my in-game character with the spotlight:
Just assume the floor is emitting a pre-rendered texture, as I’m not that far yet. The shadow should darken the already-lit floor, there shouldn’t be the circular light adding to the floor. However, the light on Sonic looks perfect.