Jump to content
The Dark Mod Forums

Parallel lights issue in 2.0/2.01: bizzaro effect


Bikerdude

Recommended Posts

I'm doing some work on one of the campaign maps and its using parallel lights with the "lights/tdmnofalloff" texture.

 

The issue is said lights are easily broken when it light radius intersected a vizportal, the effect is a some weird bizzaro non-light/shadow effect.

 

Doe anyone know of a work around for this as I would really prefer to keep the parallel lights as they are being used to cast moonlight.

Link to comment
Share on other sites

Are you sure you aren't seeing:

 

Posted by Greebo: Also, note that a parallel light will only light surfaces "matching" the direction of the "light vector"

(origin minus light_center). All other surfaces will stay completely unlit, therefore it should be combined with an ambient light to

achieve good lighting effects

http://wiki.thedarkmod.com/index.php?title=Light_Properties#Parallel_Light

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

No it's not the direction issue. I had this too with just one of my 10 exterior visportals. I spent hours tweaking things to try to get rid. It was the visportal that was closest to the light origin, and almost in the plane of the light's radius. When the portal was there and I was standing on a particular side of it, a sharp line of darkness would split the wall facing the light from top to bottom, and only half the wall would be lit. Strafing left or right would make that line tilt away from vertical, but it would always intersect the visportal plane. At the same time the light and shadow would blink on and off in the far corner of the map, again in the line of that vp.

 

Endless tweaks to the light and vp position were no use. Wrapping the whole building exterior in a single fs so there'd be something to cast shadows even when the brushes were culled didn't help. It worked perfectly without that one vp. I couldn't fix it. The thing I found with parallel lights is that you can't let the player see the edge of the bounding box, or look into one from outside or you get glitches. So one big light for a continuous exterior is needed. I ended up having to make an extra roofed-over bit so I could hide the transition between two different parallel lights in place of the original one.

Link to comment
Share on other sites

  • When the portal was there and I was standing on a particular side of it, a sharp line of darkness would split the wall facing the light from top to bottom.
  • So one big light for a continuous exterior is needed. I ended up having to make an extra roofed-over bit so I could hide the transition between two different parallel lights in place of the original one.

  • Exactly this.
  • I did have one bit light to begin with so will try this again, but when you guy refer to bounding box do you mean the light radious..?

Link to comment
Share on other sites

I mean the box you drag out in DR to set the boundaries of the light. I think that's the light radius.

 

To be clearer: the problem with the player looking into a parallel light from outside its box is that the parallel light's shadows will blink on and off as the player moves around. So to be avoided at all costs. The problem with the player seeing the edge of the box was actually a falloff problem. It doesn't cause shadows to glitch, it's just that I found my parallel lights had falloff at the very edges even though they're not supposed to. I'd not thought to apply the no fall off light texture like you have, so I dragged out all my parallel lights beyond the visible area (but ended up having to fix some overlaps with a script).

Link to comment
Share on other sites

  • 3 weeks later...

I'll resurrect this thread briefly for an update: I found another way to deal with this, one that didn't involve changing my visible geometry. Given that I had to add some extra indoor bits in the map above, which really didn't improve it, I ended up deciding I'd tried too many impossible things in my first map and started again with a fresh layout. I hit the problem again last night in my new map as soon as I put the portals into my largest exterior. After fixing it, I went back to the original map and found the same technique fixed the issue there too.

 

What I did to fix it: Added a caulk extension over the roof of the large exterior and put the large parallel light in that, then chopped up the original roof with the clipper tool to leave a small "trapdoor" over each exterior visleaf. I converted those small caulk trapdoors to visportals, and hey presto a glitch-free map with a single, uninterrupted moonlight shining everywhere. It sounds fiddly but only took 5 mins, so I went back to an old save of the previous glitching map and did it there too. It works there too. I then tried bricking up one of the trapdoors over a small visleaf, and right on cue, the shadows from the parallel light started glitching in that visleaf only.

 

That test was based on the observation that (in my new map at least) no matter where I moved the parallel light it would start to glitch when the player was 2 visleafs away. It didn't matter whether the VPs between that visleaf and the parallel light were open or not. So the above set up gives you a light that's never further away than 1 visleaf away. NB in my first map, the major glitch was only 1 visleaf away, so I'm not claiming to have this all figured out. The fix worked though.

 

I've not tested whether this can do anything to muck up my portalling or not. None of the new trapdoor portals gives a view of any other portal, and there's nothing in the ceiling box to be rendered, so hopefully not. The new portals are closed unless you have line of sight on one.

 

Plan B, if this one doesn't work out for some reason, is to try multiple cloned lights in alternate visleafs and switch between them in an instant when the player moves location. Since each will cover the entire exterior, the change shouldn't be noticeable.

Link to comment
Share on other sites

Sure, I'll set something up if it's still working tomorrow :)

 

I've taken it a bit further since. I added a lot more VPs in the area covered by that moonlight and whenever I got a shadow glitch I punched a hole in the caulk ceiling and made it a VP and it fixed it. Then I tried it with a neighbouring visleaf that was in a separate caulk cube in the void, connected to the first only by an interior location. I deleted its separate moonlight and punched a hole in its ceiling and connected it up with the main moonlight by a caulk tube that turned a corner, with a VP at the end. That worked too, and I have a second visleaf in the void fully flooded by the same light. Trees at the far end cast perfect shadows.

 

I've not seen any of those new VPs open unless the leaf below them would be open anyway. I'm now hoping I can have a single moonlight as big as my ambient_world. I just need to hook it up to all exterior visleafs. With luck I'll be able to dump *all* my location scripts that avoid overlaps by turning lights on and off. But I haven't yet checked whether it looks ok from multiple interior locations, which wouldn't be directly hooked up to the light box. These glitches depend precisely where the player is standing. One inch the wrong side of the wrong VP and the lighting can blink off, so there might be problems yet. FWIW the two views-from-inside so far work perfectly, but I haven't yet got any places where the player can stand and be looking out through 2 interior VPs, for example.

Link to comment
Share on other sites

I tried a test Interior that lets you see out through 3 VPs, and it worked but only after I applied the same fix: connect up a tube from any visleaf that needs moon shadows to the moonlight box. It's looking good so far, but a test/demo map will take time to set up and I'll save the effort till I've implemented it in a full map and found it works everywhere. @Biker: in the meantime if you want to see it I'll share the map I'm working on via PM.

 

What I've really been trying to achieve in all these moonlight discussions is dynamic moonlight that responds to clouds passing over the moon. I have that set up as of yesterday. I'll post a pic to the WIP thread in the hope that others' comments will help me improve it, or that it'll become a feature in more FMs. A real thief sneaking about a guarded yard on a moonlit night would be keeping an eye on the clouds for opportunities.

Edited by SteveL
Link to comment
Share on other sites

Ok, the weekend is here, so I'm sketching out a test map for both demos, one that'll let me test more stuff as well as expose it to others without sharing my WIP. It'll take me a few hours to make. I'd love to see more moonlight in TDM!

Link to comment
Share on other sites

I've done an extended version of the dynamic light test map that demos multiple visleafs across a map being flooded with single moonlight by the caulk. That works perfectly, so I'll be interested to see in anyone can break it :) I'll write that up and share it with a diagram a bit later, after seeing if I can fix the crash-on-start issue that doesn't happen when you start the map through the console.

 

@Biker: sent you the test map by PM for an early look since you want to see it.

 

UPDATE: Follow-up is in this post: http://forums.thedarkmod.com/topic/16046-dynamic-moonlight/page__view__findpost__p__339487

Edited by SteveL
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

    • 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
       
      · 2 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
    • Petike the Taffer

      Maybe a bit of advice ? In the FM series I'm preparing, the two main characters have the given names Toby and Agnes (it's the protagonist and deuteragonist, respectively), I've been toying with the idea of giving them family names as well, since many of the FM series have named protagonists who have surnames. Toby's from a family who were usually farriers, though he eventually wound up working as a cobbler (this serves as a daylight "front" for his night time thieving). Would it make sense if the man's popularly accepted family name was Farrier ? It's an existing, though less common English surname, and it directly refers to the profession practiced by his relatives. Your suggestions ?
      · 9 replies
×
×
  • Create New...