Inside3D!
     

Flashlights?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Dec 19, 2008 6:50 pm    Post subject: Flashlights? Reply with quote

Okay; I've been looking around for how exactly flashlights are programmed. I'm not perfectly experienced in the subject matter, so I'm looking for some methods. So far, one that I've really liked would be Dementium: The Ward's flashlight. It's lightweight, looks good for a horror shooter, and would look great for what I'm trying to accomplish. On the other hand, you have something like Halo or Half-Life 2's flashlight. If somebody, at the least, could explain to me how Quake stores it's shadowing.. One thing I definitely do not want is a flashlight where it just spawns a light entity where the player is looking. Those look very undesirable for what I'm trying to accomplish. I believe I've seen a video of a Quake engine with a flashlight in the style of Doom 3, which would be acceptable. If somebody could share the knowledge with me? Thanks in advance.
Back to top
View user's profile Send private message
GiffE



Joined: 08 Oct 2006
Posts: 141
Location: USA, CT

PostPosted: Fri Dec 19, 2008 8:12 pm    Post subject: Reply with quote

http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight
_________________
http://www.giffe-bin.net/
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Dec 19, 2008 8:17 pm    Post subject: Reply with quote

GiffE wrote:
http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight


Notice how this is in "Engine Programming". I'm not looking to write QC or CSQC here.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Fri Dec 19, 2008 8:21 pm    Post subject: Reply with quote

Downsider wrote:
GiffE wrote:
http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight


Notice how this is in "Engine Programming". I'm not looking to write QC or CSQC here.


The Doom3 style flashlight yout are refering to was done in darkplaces by useing a realtime light with a cubemap. This requires some QC coding.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Dec 19, 2008 8:31 pm    Post subject: Reply with quote

MauveBib wrote:
Downsider wrote:
GiffE wrote:
http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight


Notice how this is in "Engine Programming". I'm not looking to write QC or CSQC here.


The Doom3 style flashlight yout are refering to was done in darkplaces by useing a realtime light with a cubemap. This requires some QC coding.


Oh, I thought you were actually trying to help me.
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Fri Dec 19, 2008 9:03 pm    Post subject: Reply with quote

Err... I was? You asked how the doom 3 style one worked, and I told you. How is that not helping?
_________________
Apathy Now!
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Fri Dec 19, 2008 9:39 pm    Post subject: Reply with quote

MauveBib wrote:
Err... I was? You asked how the doom 3 style one worked, and I told you. How is that not helping?


o_o I need to put it in the engine, that's why Razz

Thanks anyway, I don't mean to come across as an ass Smile
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Sat Dec 20, 2008 12:24 am    Post subject: Reply with quote

well first you'll need an engine with realtime lighting, and support for cubemaps. DP has both of these. You then create an entity whcih follows the player(most easily through QC, but possible to do through the engine if you're masocistic) to act as the light, to which the cubemap is applied. Five sides of the cube are fully black and the sixth has a white circle blending to black at the edges. This will give you a doom 3 style flashlight.

As to the details of coding the entity in the engine, I have no idea. It's a relatively easy QC job but if you insist on not doing it there I can be of no further assistance.

If you're talking about woring off the stock quake engine it's a huge task. You'd need to add realtime lighting for starters, which is a massive task.

Quake's standard lighting system is very basic, lightstyles are baked for each map at compile time, and blended over the textures. Getting a realistic flashlight from that lighting system is a very big job.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Sat Dec 20, 2008 12:52 am    Post subject: Reply with quote

I'm not looking for a realistic flashlight, really, I'm more looking for something in the style of Dementium: The Ward. I want to be able to.. "mask" over the shadows.
Back to top
View user's profile Send private message
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Sat Dec 20, 2008 7:51 am    Post subject: Reply with quote

MauveBib wrote:
well first you'll need an engine with realtime lighting, and support for cubemaps. DP has both of these. You then create an entity whcih follows the player(most easily through QC, but possible to do through the engine if you're masocistic) to act as the light, to which the cubemap is applied. Five sides of the cube are fully black and the sixth has a white circle blending to black at the edges. This will give you a doom 3 style flashlight.

As to the details of coding the entity in the engine, I have no idea. It's a relatively easy QC job but if you insist on not doing it there I can be of no further assistance.

If you're talking about woring off the stock quake engine it's a huge task. You'd need to add realtime lighting for starters, which is a massive task.

Quake's standard lighting system is very basic, lightstyles are baked for each map at compile time, and blended over the textures. Getting a realistic flashlight from that lighting system is a very big job.


I don't know anything about this topic but wanted to say thanks for this information so as my OpenGL understanding increases I'll have this on my "to learn" list.
Back to top
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Sat Dec 20, 2008 8:26 am    Post subject: Reply with quote

IIRC GLQuake didn't even support dynamic lights.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Sat Dec 20, 2008 9:02 am    Post subject: Reply with quote

Urre wrote:
IIRC GLQuake didn't even support dynamic lights.


It does, you just have to turn gl_flashblend off.
Back to top
View user's profile Send private message
GiffE



Joined: 08 Oct 2006
Posts: 141
Location: USA, CT

PostPosted: Sat Dec 20, 2008 11:34 am    Post subject: Reply with quote

Downsider wrote:
GiffE wrote:
http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight


Notice how this is in "Engine Programming". I'm not looking to write QC or CSQC here.


I understand that this is engine programming, however the video's you saw did it in QC using that method.
_________________
http://www.giffe-bin.net/
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Sat Dec 20, 2008 3:12 pm    Post subject: Reply with quote

Thanks for the replies, I came up with something satisfactory last night.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group