Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

Flashlights?

| Inside3d Forums Forum Index -> Engine Programming

View previous topic :: View next topic
Author | Message
--- | ---
Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Fri Dec 19, 2008 6:50 pm Post subject: Flashlights? |

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 |

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

Posted: Fri Dec 19, 2008 8:12 pm Post subject: |

http://forums.inside3d.com/viewtopic.php?t=820&highlight=flashlight _________________ http://www.giffe-bin.net/

Back to top |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Fri Dec 19, 2008 8:17 pm Post subject: |

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 |

MauveBib Joined: 04 Nov 2004 Posts: 602 |

Posted: Fri Dec 19, 2008 8:21 pm Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Fri Dec 19, 2008 8:31 pm Post subject: |

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 |

MauveBib Joined: 04 Nov 2004 Posts: 602 |

Posted: Fri Dec 19, 2008 9:03 pm Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Fri Dec 19, 2008 9:39 pm Post subject: |

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
Thanks anyway, I don't mean to come across as an ass

Back to top |

MauveBib Joined: 04 Nov 2004 Posts: 602 |

Posted: Sat Dec 20, 2008 12:24 am Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Sat Dec 20, 2008 12:52 am Post subject: |

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 |

Baker Joined: 14 Mar 2006 Posts: 1538 |

Posted: Sat Dec 20, 2008 7:51 am Post subject: |

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 |

Urre Joined: 05 Nov 2004 Posts: 1073 Location: Sweden |

Posted: Sat Dec 20, 2008 8:26 am Post subject: |

IIRC GLQuake didn't even support dynamic lights. _________________ Look out for Twigboy

Back to top |

metlslime Joined: 05 Feb 2008 Posts: 177 |

Posted: Sat Dec 20, 2008 9:02 am Post subject: |

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

It does, you just have to turn gl_flashblend off.

Back to top |

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

Posted: Sat Dec 20, 2008 11:34 am Post subject: |

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 |

Downsider Joined: 16 Sep 2008 Posts: 478 |

Posted: Sat Dec 20, 2008 3:12 pm Post subject: |

Thanks for the replies, I came up with something satisfactory last night.

Back to top |

Display posts from previous:

| 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