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

    • 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.
      · 2 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
    • nbohr1more

      Looks like the "Reverse April Fools" releases were too well hidden. Darkfate still hasn't acknowledge all the new releases. Did you play any of the new April Fools missions?
      · 5 replies
×
×
  • Create New...