Re: Player capable of get a flashlight in a room.

#5
There's a way to implement a working flashlight with Blitz3D, by rendering the diffuse and lightmaps on separate textures, blending a sprite with the lighting, and drawing the final result on the screen. I don't think it's worth the effort though, since it wouldn't look really good.

There might be a better way to do it but it wouldn't be worth implementing on a DirectX 7 engine.

Re: Player capable of get a flashlight in a room.

#6
juanjpro wrote:There's a way to implement a working flashlight with Blitz3D, by rendering the diffuse and lightmaps on separate textures, blending a sprite with the lighting, and drawing the final result on the screen. I don't think it's worth the effort though, since it wouldn't look really good.

There might be a better way to do it but it wouldn't be worth implementing on a DirectX 7 engine.
There is actually a WAY easier way, with no coding what-so-ever. Just paste a picture of a FPS flashlight on the bottom corner of the overlay in the texture files, and put a smaller white circle in the middle (Like a flashlight overlay) put black around it. Bam....it will not look good, but close.
Don't worry about your son, he will be sent to the deep dark depths in no time.

Re: Player capable of get a flashlight in a room.

#7
juanjpro wrote:There's a way to implement a working flashlight with Blitz3D, by rendering the diffuse and lightmaps on separate textures, blending a sprite with the lighting, and drawing the final result on the screen. I don't think it's worth the effort though, since it wouldn't look really good.

There might be a better way to do it but it wouldn't be worth implementing on a DirectX 7 engine.
Yeah, and personally I like the Super Night Vision Goggles better, since it can also show you the location of nearby SCPs, so I'm not too sure I'd like a flashlight.

Re: Player capable of get a flashlight in a room.

#9
Actually I made a FlashLight effect in B3D for my game, here are two screenshots (to show how it's working).
Spoiler
Image
FlashLight Off (Area dark)
Image
FlashLight On (Area brighter)
I made it as following:
  • I positioned a sprite with the flashlight-overlay-texture at the picked wall, where the player looks
  • The sprite will be scaled after how far the player is away from the wall (to get the illusion that a light would bright it up)
  • The Alpha value of the sprite depends on the distance (by the EntityAutoFade command, also for the illusion of the light)
  • The sprite has the FX-flags "Fullbright", "Alpha" and "Disable Fog" (to bright the scene up)
  • The EntityOrder of the sprite is -1 (it can also be smaller than -1, so it can't clip through walls)
  • The SpriteViewMode is set to face the sprite always to the camera (in order to draw the sprite in the direction to the player rather than attaching it to the surface)
Of course it's not 100% looking good, but it's better than just drawing the flashlight-overlay-texture onto the screen.
Image