FAST TorchLight
Blitz3D Forums/Blitz3D Programming/FAST TorchLight
| ||
this isn't truely a torch, im just trying to make something work, i've posted this code and someone could build on it? this should work on ALL scenes! no matter what tho its a very poor attempt to make a doom3 torch light tho http://www.neochrome.co.uk/fhr.rar ![]() there is a video clip of this too http://www.neochrome.co.uk/fstdemo.mpg the video clip rins at 25 FPS, using fraps, do know that the frame rate on THIS computer reaches 400+ FPS 1024 x 768, 32 Bit depth i release this code free to use! if anyone can improve on this tho, i would like your updates ;) this is probably my first every (semi usefull) demo this doesn't DO shadows as of yet. THAT one hasn't light-bulbed me yet im working on something for that tho |
| ||
That is d**n clever. What did you use to make the BSP world? And does it work with non-BSP i.e. .3DS or .B3D rooms? |
| ||
i should imagine so! im using GTKRadient for BSP im told that there arn't any issues with licencing anyways now. but i see no reason for this to be limited to BSP just a few tweeks on the code... have you tried to code for your self? this is highly experimental i dont know if it will work on other graphics, im assuming i've used the very basics of blitz to achieve this tho. not quite Doom3 but it could be usefull? |
| ||
Fast but looks like a sniper rifle scope. I would use texture projection instead. |
| ||
very good! you see: you dont need a stencil buffer for that. also stenciled torch light would be slow and hard-edged. so a texture would do it much better... you even managed the correct blending... i know that i didnt... but i would try this instead ![]() (this texture is from farCry) |
| ||
It has to take the shape of the surface it's projected on like in Half-Life which has texture projection I think. |
| ||
@Devils. actually i haven't quite optimised the code i've used 2 textures.. one in white and one in black i've included them in the Rar file. if you wish i could send you the original photoshop format? |
| ||
hm, since i dont know anything about BSP, i cant work on this... but my blending looks weird.![]() in half-life the flashlight works as follows: a texture UV coordinate in the lightmap image is picked and the lightmap image is getting white at this place. no decal engine, no overlay! |
| ||
ah i see how that works! you are not projecting anything on a map-overlay! you just position a "flashlight" sprite in front of the camera... well, thats why it looks like a scope :) |
| ||
:) and that's why it doesn't take the shape of the surface it's reflected. It may be used as a night vision goggle with goggle sprite shape and greenish color IMO. |
| ||
as i say, its not a very good copy lol its designed to give you guys something to work on? |
| ||
I was reading Devil childs comments about bleending textures. I presume he was talking about subtracting from the shadows in lightmaps with a tourch texture. I did a lil project about this a while ago (is it the same method?) but it removes shadows from the lightmap using 3 layers of rendering and blending them together to get a single image... not the fastes thing in the world, but it works. (Apparently there are much better ways of doing it... but "hey", i'm simple =P ) here's my post: http://www.blitzbasic.co.nz/Community/posts.php?topic=67347#751986 no media included... if you are intrested, just Email me, I'll post you a demo with source :) Hope that helps someone. |
| ||
I experimented a little with scaling the sprite in order to give a more realistic spot light effect, rather then the "rifle scope" effect, and this is what I came up with: Before the main loop put: EntityPickMode world%,2 pivot = CreatePivot() And during the main loop put: EntityPick cam, 10000 PositionEntity pivot, PickedX(), PickedY(), PickedZ() ScaleSprite spot, 0.5 / (EntityDistance(cam,pivot) / 500), 0.5 / (EntityDistance(cam,pivot) / 500) |
| ||
earok. are you using the code i supplied? |
| ||
Hello, Sorry to dig up this old post but i am curious about the torchlight effect Neocrome has achieved. Does anybody has the file "fhr.rar" to try the demo please ? Thanks, |
| ||
I've found two 'torch' examples I had tucked away. You can download them at: http://www.tla-data.co.uk/download/blitz/spotlight.zip http://www.tla-data.co.uk/download/blitz/torch.zip |
| ||
I just got a bit confused. I thought Neochrome was that guy who a couple of years ago had "gone fishing". Turns out that was Nebula. As you were. Last edited 2012 |
| ||
John B.>> Thanks for the file :) Edit : i am not sure i understand what it does, i am studying it. Last edited 2012 |