Walking in darkness - Helping the player

Avatar
beecake
484 Posts
Posted Jan 20, 2014
Hi.

I'm looking for a way to parent a source of light to the player, so that it looks like the player is emitting a small amount of light.
This is so that the player can move around in darkness.

I tried the light_dynamic but it seems like it is working more like a spotlight than a ball of light, like the normal Light-entity.
Also, the light_dynamic is for some reason only lighting 1 square at a time, which looks a little weird.

Any suggestions? I heard something about someone who had a glowing cube. I'm looking for the same thing. This time it's just the player who's glowing.

Is it possible?

Advertisement
Registered users don’t see ads! Register now!
Avatar
Arachnaphob
412 Posts
Posted Jan 20, 2014
Replied 17 minutes later
Maybe a few dim projected textures with shadows disabled around the player would work.
Avatar
Gemarakup
1,183 Posts
Posted Jan 20, 2014
Replied 18 minutes later
A glowing cube is because of the cube itself with some values. No lights.
Avatar
beecake
484 Posts
Posted Jan 20, 2014
Replied 9 minutes later

Arachnaphob wrote:
Maybe a few dim projected textures with shadows disabled around the player would work.

Well, you can only have 1 env_projected_texture enabled at a time, and I'm already using them to cast some wicked shadows.

It's not supposed to look like a flashlight though. It's supposed to be "The range of the players visibility".

yishbarr wrote:
A glowing cube is because of the cube itself with some values. No lights.

Ah. So that's how... Hmm, I wonder if it's possible to do it to the player in a different way...

Avatar
Arachnaphob
412 Posts
Posted Jan 20, 2014
Replied 22 minutes later

beecake wrote:
Arachnaphob wrote:

Maybe a few dim projected textures with shadows disabled around the player would work.

Well, you can only have 1 env_projected_texture enabled at a time, and I'm already using them to cast some wicked shadows.

It's not supposed to look like a flashlight though. It's supposed to be "The range of the players visibility".

From my experiences, you can have multiple enabled, but you can only have one with shadows. If you arrange a few pointing in all directions and set their FarZ really close, it may get what you want.

Avatar
CamBen
973 Posts
Posted Jan 20, 2014
Replied 3 minutes later
If the map is really dark, you can fake it by using a fog entity with a very close range and a color of black.
Avatar
beecake
484 Posts
Posted Jan 20, 2014
Replied 12 minutes later

Arachnaphob wrote:
beecake wrote:

Arachnaphob wrote:

Maybe a few dim projected textures with shadows disabled around the player would work.

Well, you can only have 1 env_projected_texture enabled at a time, and I'm already using them to cast some wicked shadows.

It's not supposed to look like a flashlight though. It's supposed to be "The range of the players visibility".

From my experiences, you can have multiple enabled, but you can only have one with shadows. If you arrange a few pointing in all directions and set their FarZ really close, it may get what you want.

That's worth the try. I'll see what I can make from it, and maybe return :smile: Thanks.

CamBen wrote:
If the map is really dark, you can fake it by using a fog entity with a very close range and a color of black.

It could work, but would only fit in corridors. I'm having large rooms that are pretty lit too... If the fog was there you'd not be able to see very far :smile: But great suggestion!

Avatar
beecake
484 Posts
Posted Jan 21, 2014
Replied 23 hours later
Sorry for the double post.
It seems like it's impossible to have more than one env_projectedtexture enabled at a time. Even though shadows are disabled.

Does anybody else have a suggestion?

Avatar
Skotty
671 Posts
Posted Jan 22, 2014
Replied 18 hours later
Invert the fog. Set its density to about 0.1 and then tell it to cast from 129 to 128 or something like that.
Avatar
beecake
484 Posts
Posted Jan 22, 2014
Replied 16 minutes later

Skotty wrote:
Invert the fog. Set its density to about 0.1 and then tell it to cast from 129 to 128 or something like that.

Woah... So the fog works as a ball of light around the player?
That would be awesome!

Avatar
beecake
484 Posts
Posted Jan 22, 2014
Replied 5 hours later
(Sorry for double post again... I should wait with the replying)

You idea works, at some parts.
I'm getting an ok cool effect with something that looks like it's lit around me.
Problem is when it complete darkness around me. Then I'm only able to see the one color the fog is.

Is there a way to blend the fog-color more out?

Also, would it be possible instead of having darkness then making the whole map lit, but very dim.
I tried using a light_environment but it's really cheap and static opbjects don't look very good in it. Everything else was lit up pretty well when I tweaked the entity, but the static objects were a problem. Anything else I could try that works the same way?

Avatar
Skotty
671 Posts
Posted Jan 23, 2014
Replied 20 hours later
You could try to put some lights with constant 1 everywhere and a light brightness value of 1.
Avatar
User
630 Posts
Posted Jan 23, 2014
Replied 59 minutes later

Skotty wrote:
You could try to put some lights with constant 1 everywhere and a light brightness value of 1.

Wouldnt do only one light entity with constant 10000; brightness 1 do the same?

Avatar
beecake
484 Posts
Posted Jan 23, 2014
Replied 25 minutes later
I tried it and the problem is that this light is casting shadows. So it's lighter where it's placed, than somewhere else.
Advertisement
Registered users don’t see ads! Register now!
Avatar
FelixGriffin
2,680 Posts
Posted Jan 23, 2014
Replied 3 hours later

TheTobbell wrote:
Skotty wrote:

You could try to put some lights with constant 1 everywhere and a light brightness value of 1.

Wouldnt do only one light entity with constant 10000; brightness 1 do the same?

If the quadratic, linear, and constant are used precisely the way the documentation says, that would be the same as constant 1 but 10000 times brighter.