Forum

Flashlights?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Flashlights?

Postby Downsider » Fri Dec 19, 2008 6:50 pm

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.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby GiffE » Fri Dec 19, 2008 8:12 pm

GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby Downsider » Fri Dec 19, 2008 8:17 pm

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.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby MauveBib » Fri Dec 19, 2008 8:21 pm

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!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby Downsider » Fri Dec 19, 2008 8:31 pm

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.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby MauveBib » Fri Dec 19, 2008 9:03 pm

Err... I was? You asked how the doom 3 style one worked, and I told you. How is that not helping?
Apathy Now!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby Downsider » Fri Dec 19, 2008 9:39 pm

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 :P

Thanks anyway, I don't mean to come across as an ass :)
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby MauveBib » Sat Dec 20, 2008 12:24 am

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!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby Downsider » Sat Dec 20, 2008 12:52 am

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.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am

Postby Baker » Sat Dec 20, 2008 7:51 am

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.
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Urre » Sat Dec 20, 2008 8:26 am

IIRC GLQuake didn't even support dynamic lights.
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby metlslime » Sat Dec 20, 2008 9:02 am

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


It does, you just have to turn gl_flashblend off.
metlslime
 
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Postby GiffE » Sat Dec 20, 2008 11:34 am

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.
GiffE
 
Posts: 170
Joined: Sun Oct 08, 2006 3:39 pm
Location: USA, CT

Postby Downsider » Sat Dec 20, 2008 3:12 pm

Thanks for the replies, I came up with something satisfactory last night.
User avatar
Downsider
 
Posts: 621
Joined: Tue Sep 16, 2008 1:35 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest