Jump to content
The Dark Mod Forums

Recommended Posts

Posted (edited)
On 1/16/2024 at 5:25 AM, snatcher said:

I am bringing this here.

From the instructions in ModDB:

Rename tdm_base01.pk4 in your darkmod directory to tdm_base01.pk4.old

Wouldn't it be better to offer this as a "z" (zzz or whatever) mod? It could have it's own z_fresnel_mod.pk4 name.

renaming it to z_fresnel_mod.pk4 seems to work without issues, and also avoids the (to me) undesirable shuffling of the original tdm_base01.pk4 back and forth from the backup whenever the mod is enabled/disabled by Generic Mod Enabler.

4buaIGM.jpeg

disabled in St Alban 1

9I9ro2p.jpeg

vs enabled in St Alban 1, so it's clearly working.

EDIT: when renamed to z_fresnel_mod.kp4, it loads after and thus conflicts with @snatcher's Core Essentials due to the presence of default.cfg in the mod root which overrides Snatcher's loot count assignment (F3). i can't see any reason for a default.cfg file to be included in the fresnel mod, so it should probably be removed.

there are likely to be other mod conflicts with this z_ load order, since it's a complete copy/paste of the entire contents of the default tdm_base01.pk4, plus @nbohr1more's edits.

the ideal solution would be to package it in aaa_fresnel_mod.pk4 (so that it loads after the default game data, but before all other mods, which I think is the intention), *and* only include the files that are changed by the mod, which would then cleanly override the defaults.

hope this isn't too much work :)

Edited by speedwaystar
  • Like 1
  • Thanks 1
Posted (edited)
On 10/16/2025 at 1:51 PM, speedwaystar said:

hope this isn't too much work :)

Just a heads-up, imgur isn’t accessible in the Uk.

Edited by Bikerdude
  • Confused 1
  • Sad 1

bhm_banner.jpg

Posted
On 10/16/2025 at 2:51 PM, speedwaystar said:

EDIT: when renamed to z_fresnel_mod.kp4, it loads after and thus conflicts with @snatcher's Core Essentials due to the presence of default.cfg in the mod root which overrides Snatcher's loot count assignment (F3). i can't see any reason for a default.cfg file to be included in the fresnel mod, so it should probably be removed.

there are likely to be other mod conflicts with this z_ load order, since it's a complete copy/paste of the entire contents of the default tdm_base01.pk4, plus @nbohr1more's edits.

Indeed.

A z_fresnel_mod.pk4 would only require the two files with @nbohr1more's edits:

  • glprogs\tdm_interaction.glsl
  • glprogs\stages\interaction\interaction.ambient.fs.glsl

@speedwaystar, *.pk4 are zips with a pk4 extension. Open the pk4, delete everything except these two files and you will have your simplified fresnel mod.

  • Thanks 2

TDM Modpack

Posted

I'll update the Moddb page soonish.

I wanted to keep the files in their original pack file so that modders would know where to get the glprogs data.

( And so the removal \ tdm_installer process is seamless for trouble-shooting. )

  • Like 1

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...)

  • 5 months later...
Posted

There used to be code for that but it was removed.

With the current material system, there is no way to query light direction so you can only approximate the effect by hard-coding the shading direction based on the player camera view. 

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...)

Posted
18 minutes ago, nbohr1more said:

With the current material system, there is no way to query light direction so you can only approximate the effect by hard-coding the shading direction based on the player camera view.

But it can't be used per material?

The whole point of Fresnel effect is that it's view dependent.

 

It's only a model...

Posted

Fresnel is really a form of specular, which is also really a form of reflection. If you want it to properly blend into the ambient lighting you need some way to approximate light \ scene input.

A good fresnel effect which uses world lighting would either need light direction attributes or cubemaps.

For the latter, you could use:
 

The problem is we don't have a world cubemap / probe system so you need to manually create a lot of cubemaps.

Yes, you can create a fresnel effect that just does a subtle view angle based brightening without these inputs.

I don't know how much better that would look than just using a generic cubemap faked specular effect.

Also, any time you hard code brightening in a material effect it will look like it's glowing in some contexts.

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...)

Posted

@nbohr1more I was thinking more about using fresnel as a factor / mask in materials. For example changing intensity of mirror reflections based on angle, like in the video above. Or masking one stage of material. Being able to modify intensity of cubemap reflections inside materials would be useful.

  • Like 1

It's only a model...

  • 2 months later...
Posted
On 3/28/2026 at 4:47 PM, nbohr1more said:

Fresnel is really a form of specular

Specular reflection is simply a mirror reflection where light bounces off of surface in an organized way. As opposed to diffuse reflection where light scatters in random directions, e.g. white wall.

Fresnel effect is a modification of a reflectivity based on a viewing angle.

 

It's only a model...

Posted

To add to that. In old graphic engines like id tech 4 specularity of a material is interacting solely with direct lights from lamp objects. If you want to make a proper mirror, you have to use a completely different technique that's not connected to specularity factor at all. This is of course not how real world works were there is no distinction between direct light coming from the sun or a lamp, and an indirect light bouncing off of a wall or other objects. All reflections as well as shadows are just photons bouncing around.

On top of that, you can see that specular reflections in Darkmod have the same strength no matter what angle you look at - hence there's no fresnel effect.

 

It's only a model...

Posted

I take it back. In previous video specularity of the material was high. With intensity set to 0.1 there might actually be a slight difference based on the grazing angle.

 

 

It's only a model...

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

    • JackFarmer

      I will NOT return to Discord. Who wants to try something new?
       
      · 12 replies
    • JackFarmer

      I do not understand why Gilmour/Waters trash the "Atom Heart Mother" album and wish for that "all existing copies get dumped".
      I think it is a great recording. Is there something wrong inside my twisted little brain?
      · 3 replies
    • revelator

      Asus ROG strix x570-E gaming ryzen 3700x 32 gb ram radeon RX9070XT 10 tb ssd space (all full)
      · 5 replies
    • The Black Arrow

      I was playing Doom 3, and I learned how to edit maps text-by-text, this should help me a lot with finding secrets and locations I hope.
      That is, if I feel sneaky and greedy...Which I always do, can't get enough 100% a mission.
      · 3 replies
    • datiswous

      So on a regular basis I try to start building something in Darkradiant but very quickly I loose interest and give up.
      I tend to
      create a room, position an ai in it (or first ai, then room, probably better) put a light in it Put some stuff in it test the room in tdm Now I had this new idea:
      Start of with a gigantic room. To skip the importance of sealing for the time being and to think broader than one room. Then just use ground without wall, just to visualise the structure of the level.  Then just use prefab walls and other elements (arches, etc.). Just building area's that aren't enclosed. I can always close them at a later point. Maybe this is all very logical from a mappers perspective, but tdm is the first game where I have done any kind of real mapping and I always stop at the start. It just takes too long to make something exciting.
      I want to build something at some point, because over time I accumulated lots of ideas.
      · 21 replies
×
×
  • Create New...