Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / This is "Torch"ure

Author
Message
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 9th Jul 2006 19:43
Can anyone please help me and give me some ideas how to make a flashlight kind of effect in first person camera i've played about with it for hours but i just can't seem to get it right... i'm sure it's a simple thing that i'm missing...

btw i'm using DB pro if that helps any.

I can see from your smile, you're not here for the sunset.
General Reed
18
Years of Service
User Offline
Joined: 24th Feb 2006
Location:
Posted: 9th Jul 2006 20:15
Here is a link to do hl2 style flashlight, using shaders.
http://www.vector3r.com/FlashLight.zip
Here is a link to origonal post
http://vector3r.7.forumer.com/viewtopic.php?t=20

Hope this helps

-General Reed

AMD Athlon 64 3200+, 1GB ram, Geforce 6600 GTX, 250GB HDD
Vist www.scratchyrice-dev.co.uk
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 11th Jul 2006 16:32
hmm... when i run it i get nothing but a black screen... i assumed that the "Flashlight" was turned off so i tryed everything i could to turn it on but to no avail... i must be real dense or something... cuz it just ain't workin for me

I can see from your smile, you're not here for the sunset.
Daemon
18
Years of Service
User Offline
Joined: 16th Dec 2005
Location: Everywhere
Posted: 11th Jul 2006 19:15
I made a simple image memblock trick which sort of looks like a flashlight. Run this code and see what you think.



Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 12th Jul 2006 19:03
Ok i have a torch effect now HOWEVER i have encountered a further problem. I have used a SPOT LIGHT which follow the movements of the mouse and it reactes well to everything in the 3d scene EXCEPT for flat surfaces like walls and floors and i don't understand why, i have tried all kinds of light ranges i just don't understand why.
i'm not using VECTOR commands for the light, if that makes any difference but that being because i don't understand how they work or how to use them. i'm not sure if thats WHY it's not working... any help would be useful

I can see from your smile, you're not here for the sunset.
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 12th Jul 2006 19:08 Edited at: 12th Jul 2006 19:29
I am guessing that you are getting a nasty blocky effect around the outside of the light?

This is because the internal spot light commands use vertex shading (and you need per pixel lighting for a good effect) - this is why you need to use a shader to get the effect.

However, I'm with you, I can't get the above shader to work.

I know this question was answered not so long ago in the DBP board. I'll try and find the answer and post it here.

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Dream And Death
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: The circus! Juggling job, kids and DBPro
Posted: 12th Jul 2006 19:37
Oh dear! Having looked over the past answers on the DBP board, I've come to the conclusion that no-one has managed it yet :.(

"You get what everyone gets, you get a lifetime!" - Death, The Sandman Library

First you Dream, then you ... - Neil Gaiman, 2001
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 12th Jul 2006 23:28
Figured it out!!! it all depends how many polygons make up the surface of the object for example when i made the wall it was just on flat plain and the light didn't react to it... however i changed the plain to be on solid object divided into 70*100 polygons to make the one single object and the light reacts fine on it heh SORTED!!

I can see from your smile, you're not here for the sunset.
Euphoria
18
Years of Service
User Offline
Joined: 21st Feb 2006
Location: United Kingdom
Posted: 13th Jul 2006 14:02
surely dividing up a flat surface into 7000 polys isn't going to help performance
Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 13th Jul 2006 14:31
true but it doesn't HAVE to be that much... it just needs more than 1 polygon to react to is all i meant... you could make it 5*6 and it'd still work...

I can see from your smile, you're not here for the sunset.
RUCCUS
19
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 13th Jul 2006 17:42
Assumming you get your map to the usual 30-40k polycount lots of DB games have now, plus all of the other objects like characters and such, you'll be in the range of 50k polies. Now, even making each flat surface 2 polygons will doubleyour count to 100k polies. Definintely not a good method.

Levanthus
21
Years of Service
User Offline
Joined: 17th Apr 2003
Location: Cumbria, UK
Posted: 14th Jul 2006 23:28
well it's the only way i found of doing it OK!! i'm relativly new to this thing and i'm trying my best. give me a break.

I can see from your smile, you're not here for the sunset.

Login to post a reply

Server time is: 2024-11-27 15:52:32
Your offset time is: 2024-11-27 15:52:32