Jump to content
The Dark Mod Forums

Light Origin vs Light Center


Springheel

Recommended Posts

Is anyone really clear on what the Light Center property does? Does it control the direction of the light without changing the boundaries? Can it be used to simulate pointlights?

Link to comment
Share on other sites

The light center essentially only moves where the shadows (and normals, etc.) come from. Most other entity properties deal with the origin (like particle effects, when to cull the entity behind a visportal, etc).

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

The useful property here is that you can create a custom volume shape and size (for example a volume that ONLY extends

into the room from a light against the wall) but the light appears to emanate from that light rather than the center of the

volume (room).

 

It would be cool if such properties could be adjusted in the prefab light entities as the current "realistic" volumes extend

outside the room to touch other polys. Though this can be mitigated by proper portalization and brush carving of course...

Edited by nbohr1more

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Is there a way to use them to make it look like a light is shinning more brightly down than up?

Link to comment
Share on other sites

Yep, that's a good example. I was thinking of a more practical place. Supposing a torch hides in a recessed area of a wall. If you don't move the light center out of that hollow, you'll get some just-plain-bad-looking shadows.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Yep, that's a good example. I was thinking of a more practical place. Supposing a torch hides in a recessed area of a wall. If you don't move the light center out of that hollow, you'll get some just-plain-bad-looking shadows.

Another example is having light bleed from the edges of windows. If you have the light radius part way into a wall, you can move the light center out just fair enough to get some realistic looking light bleed/bounce.

Link to comment
Share on other sites

here is an example picture to your first questions. And I can make you a basic map of your second questions if you like..?

Precisely this. It illuminates the exact same radius that you see in DR, but normals and shadows are cast from light_center instead of from the origin.

yay seuss crease touss dome in ouss nose tair

Link to comment
Share on other sites

Here is a little map I made with some examples of difference light center positions.

  1. the light center is close enough to the window to approximate RL scenario.
  2. I've then backed it of by one grid (at grid 4)
  3. I've then backed it of by two grids (at grid 4) etc.
  4. changed the light shader to a window image and a little ambient bounce to the inside edges
  5. same again but this time with wall/floor/ceiling bounce with the center for that light at floor level to approximate the reflected light off the floor.
  6. then the same again but with an outside window texture etc.

springlight.map.txt

Link to comment
Share on other sites

The problem I've had with adjusting the light center verses volume origin is that the particle flames for most lights are bound to the origin rather than the light center. I'll check D3W to see if you can bind things to the light center...

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

here is an example picture to your first questions.

 

Thats good to know, what I had to do to get the moon beam to work like that was to create a spot light on the top of your example window, and beam it 45º downwards to the floor, but that wouldnt work in all situations or window shapes, and it seems to me this method is a lot more confortable. Thanks!

Edited by RPGista
Link to comment
Share on other sites

The particle could be offset as well.

But that requires know the offset details of the light center, how would we figure out these numbers.

 

it seems to me this method is a lot more comfortable. Thanks!

LOL, it only dawned on me last night to try it this way! But as you say this is a much easier and more importantly "cleaner" way of doing it. :-D

Link to comment
Share on other sites

But that requires know the offset details of the light center, how would we figure out these numbers.

 

For the "streetlamps" I did it manually (look where the model origin is in DR, look where the light origin in DR is, subtract these to get the offset). These are lights where there is a model (a streetlamp" at the light origin, but for obvious reasons the light center needs to be offset.

 

E.g. the model origin is at the bottom of the streetlamp (so you can place it easily on the floor), but the light is 16 units up.

 

One problem with moving the light center is that the light radius stays the same and is centered around the light origin. Anything outside that light radius is not lit at all (which can be good or bad).

"The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950)

 

"Remember: If the game lets you do it, it's not cheating." -- Xarax

Link to comment
Share on other sites

I suppose this is more of a Dark Radiant ease of use issue.

 

From a scripting POV, I know you can instruct the light center to change on-the-fly (a trick Goliathvt used to make a moving sun\sky setup)

so I presume you could poll the location of light center and relocate the particles to that location.

 

Another neat trick that could be done is if the AI who carry torches had one bound light volume then when moving (waving?) the torch within that

volume simply changes the light center. It should have much less performance impact than relocating the whole volume and having to recalculate

the bounds each time (though this would still happen once the AI started walking, obviously). It should also look better...

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...