Jump to content
The Dark Mod Forums

Butting lights up against each other


SneaksieDave

Recommended Posts

Someone mentioned butting ambient lights up against each other recently, and it reminded me to try it out from long ago. Here are the results:

 

From lining ambientlightnfo (that's supposed to be no falloff) entities side by side:

post-58-128293903781_thumb.jpg

post-58-128293904934_thumb.jpg

Looks great in DR. In TDM, there's a pretty bad gap.

 

Bump the grid size down to 1 and try overlapping them:

post-58-128293905792_thumb.jpg

post-58-128293906389_thumb.jpg

Now there's an overlap in TDM.

 

Bump grid down to 0.5 and there's a smaller but still present issue. So you get the point.

 

I'm wondering if there's a way to address this better than settling for a thin line no matter what grid size you try? Maybe a keyword (or one that's missing) in the material causes this apparent rounding of the edges even in a NFO texture?

Link to comment
Share on other sites

What size are your lights? They don't grid snap, so if you have 2 10.2 unit wide lights you're gonna have to go REAL small on the grid to get them aligned.

 

I'd guess that's the issue as there is no falloff or anything else weird.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

What does the material definition look like for the NFO Light ?

If it has a "zeroclamp" in there, comment that out and see what you get then.

 

ZeroClamp causes the texture to not repeat outside of the 0-1 UV Range, and fills the area with black.

This can cause a small fuzzy border because of texture-filtering.

 

It's possible that you will get "sparklies" where the lights meet tho, because of rounding errors.

Link to comment
Share on other sites

Here's the def:

 

lights/ambientlightnfo
{
ambientLight

lightFalloffImage makeintensity( textures/lights/ambientlightnfo)

{
	forceHighQuality
	map textures/lights/ambientlightnfo_amb
	colored
	zeroClamp
}
}

 

Unfortunately it seems zeroclamp is essential. Without it, it gives that view aligned clip-into-everything rotating sprite effect:

post-58-12830006105_thumb.jpg

 

 

(Which oddly I had to use printscreen to capture because the screenshot command made this out of it:

post-58-128300064674_thumb.jpg

 

:huh: A path of gold! Err, silver! I wonder if that's ambient or HDR adversely affecting all screenshots.)

Link to comment
Share on other sites

Unfortunately it seems zeroclamp is essential. Without it, it gives that view aligned clip-into-everything rotating sprite effect:

 

Oops, yeah looks like it is.

 

Try putting the "nearest" keyword into the projection map stage of the NFO material.

 

That will disable bilinear filtering on the texture and use nearest filtering instead ( not recommended for most textures, but the NFO should have a fully white texture in this stage where there won't be any stepping visible ).

 

I tried it locally and it does produce a sharp edge on the light.

Link to comment
Share on other sites

I managed to align 2 lights of 256x256x256 size on the 1x1 grid with no visible gap this way.

 

But yeah, it's probably too fiddly in the end - and even has the potential risk of showing a gap if some graphics-card vendor decided that they should have some fancy new "nearest" filtering implemented which does things slightly differently - but thats just a guess.

Link to comment
Share on other sites

While I can see a difference in the edge (looks like no antialiasing with nearest) there remains the gap. Rats.

 

Just curious what you are trying to do here. What's the usage of this, maybe we can emulate it otherwise? Also, is the gap visible if the light-color is very dim?

"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

  • 3 weeks later...

I think I have a solution for this issue but my Gimp skills are holding back my progress so I thought I would share my thoughts:

 

Cross-fade edges.

 

Essentially have one side of the projection texture fade to black then fade back to white. Then another projection texture has the inverse fading on it's edge. Overlap the two patterns and it should be a close to seamless merge.

Obviously I don't have 1.03 to see if any artifacts pop-up ;)

 

 

(If I can workout the correct balance, I will post a pk4)

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

I think I see my own issue. The inverse images combine to become gray rather than white so the base color would need to be changed to gray... or one of the inverses would need to be a fractional (half?) intensity of the other so that the two would combine to as close to white as possible...

 

(I know that some optics website is out there with a perfect example and they are laughing at me for re-inventing the wheel :laugh: )

 

 

Hmmm.. maybe cross-fade to (grey) 888888 instead of (black) 000000 ...?

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

CrossyMcCrosso.JPG

 

Edit:

 

2nd attempt.

 

The attached file should work now (unless there are additional 1.03 caveats?)

 

 

Edit: 4th attempt

 

Another straight-edge version

zzz_crossfader_light.pk4.txt

zzz_better_straightcross.pk4.txt

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

I originally had a true cross-fade but realized that the hard-edge at the end of the ramp-up would still have the same alignment problems so I went for another ramp at the end. But a complex cross-fade might obscure the transition more by hiding the obvious line... Yeah, aligning would get crazy if it were too complex. At the very least it would have to be low contrast as possible so that you could fudge a bit.

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

Yes, that is probably the main area of concern. I just cooked up the other "mundane" usage scenario (excuse) a couple of days ago.

 

Mundane usage scenario:

 

Since the Brush optimizer goes for triangle optimization rather than light optimization, rather than fiddling with Brush cohesion you could break lights that are "too big" into smaller ones that are seamlessly connected.

 

Yeah, it's pretty dull but it's another valid performance optimization option. :)

 

I think the Strombine usage is pretty exciting though... :laugh:

 

 

Edit:

 

Here is my zaggy version. Will test soon...

zzz_cross_zaggy.pk4.txt

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

It worked! (At least on the wood floor)... I will have to test on a cleaner surface...

 

I will go back and try one last stab at the straight cross-fade but I think the "W" \ "M" zigg-zagg pattern is the optimal pattern to obscure the seam...

 

Now I just have to shrink the edge pattern a bit as it is currently over a quarter of the texture... :laugh:

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

    • Ansome

      Finally got my PC back from the shop after my SSD got corrupted a week ago and damaged my motherboard. Scary stuff, but thank goodness it happened right after two months of FM development instead of wiping all my work before I could release it. New SSD, repaired Motherboard and BIOS, and we're ready to start working on my second FM with some added version control in the cloud just to be safe!
      · 0 replies
    • Petike the Taffer  »  DeTeEff

      I've updated the articles for your FMs and your author category at the wiki. Your newer nickname (DeTeEff) now comes first, and the one in parentheses is your older nickname (Fieldmedic). Just to avoid confusing people who played your FMs years ago and remember your older nickname. I've added a wiki article for your latest FM, Who Watches the Watcher?, as part of my current updating efforts. Unless I overlooked something, you have five different FMs so far.
      · 0 replies
    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 4 replies
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
×
×
  • Create New...