Jump to content
The Dark Mod Forums

[ 2.10 ] New Frob Shader


duzenko

Recommended Posts

I'm sorry to be ignorant about the topic. But to me the only annoyance is a lot of copy/pasted text in materials. And the fact that if mapper forgets to copy/paste it, then the object won't frob-hightlight even if it is frobable. I don't want to spend much time on it, tweaking it, fixing FMs, arguing with mappers, etc. Just wrap the mess and go away 😐

And I agree with @peter_spy that customization must be preserved. And the current system seems to work fine in this regard. And saving its behavior exactly has a major benefit that all the tweaks applied by authors to specific materials will continue to work as before.

The easiest solution would be to introduce FROB_MACRO(alpha, beta), which would simply be replaced with these if-s by engine on load (just like there is DECALMACRO). alpha and beta are the coefficients 0.15 and 0.40.

It is harder to add frob highlight by default to new materials and maintain custom-tweaked material at the same time.

  • Thanks 1
Link to comment
Share on other sites

10 hours ago, stgatilov said:

I'm sorry to be ignorant about the topic. But to me the only annoyance is a lot of copy/pasted text in materials. And the fact that if mapper forgets to copy/paste it, then the object won't frob-hightlight even if it is frobable. I don't want to spend much time on it, tweaking it, fixing FMs, arguing with mappers, etc. Just wrap the mess and go away 😐

And I agree with @peter_spy that customization must be preserved. And the current system seems to work fine in this regard. And saving its behavior exactly has a major benefit that all the tweaks applied by authors to specific materials will continue to work as before.

The easiest solution would be to introduce FROB_MACRO(alpha, beta), which would simply be replaced with these if-s by engine on load (just like there is DECALMACRO). alpha and beta are the coefficients 0.15 and 0.40.

It is harder to add frob highlight by default to new materials and maintain custom-tweaked material at the same time.

I don't get it. Why should the MAPPER decide how the frob highlight looks? It is basically a GUI-feature that communicates to the player whether an object can be interacted with or not. With regards to accessibility, it should totally be up to the PLAYER to pick a frob highlight that works well for them. Also, if frob highlight is changed, it should definitely be changed globally and not on a per-material level. Imagine one door having our old frob highlight and another having a new crazy TDS-like frob highlight. That would be totally unprofessional and every player would ask "WHY? Just Why?" 😄 Frob highlight is not something artistic, but a GUI-Feature that must be consistent.

The current frob highlight also has severe problems, as @peter_spy also said himself: In a bright scene you cannot (or just barely) see if an object is highlighted. That's the main reason, why we need a customizable new frob highlight. To my knowledge, there also have not been any customizations of the frob highlight other than making it brighter or darker, to account for this exact problem I just described.

Custom-Materials in FMs etc. can be handled by simply ignoring the frob highlight stage in all parsed material definitions. It can be identified via the parm11 reference.

  • Like 3
Link to comment
Share on other sites

I think a frob macro would be a good intermediary and seemingly time-efficient solution for making our material system more user-friendly. I'd still note that it should probably also include a reference to the diffusemap and maybe _white, in addition to alpha and beta values.

A more definitive, material-free solution that also addresses the visual problems with our existing system would be best, of course, but it's clear it's not straightforward.

As for mappers using custom frob highlights in existing missions, I'm not really aware of that having happened to date. IIRC peter_spy's custom Builder assets have some specialised frob highlights and they were used in a couple missions, i.e. Skulduggery 3.

Link to comment
Share on other sites

I too am rather skeptical of an ongoing need for per-material frob customisation, but ultimately I am not a mapper and if experienced mappers say they have needed it, I can't really contradict them.

Nevertheless, for the main bulk of materials which do not need per-material customisation, I don't understand what benefit a macro (which the material author must remember to manually include in every material he creates) provides over simply doing what the macro would do in the C++ code, automatically, for every material. This would not even prevent the use of customisations: the behaviour could be to implement the basic frob for all materials automatically, unless specifically overridden with a material stage or keyword (e.g. override_frob { ... }).

Link to comment
Share on other sites

1 hour ago, OrbWeaver said:

I too am rather skeptical of an ongoing need for per-material frob customisation, but ultimately I am not a mapper and if experienced mappers say they have needed it, I can't really contradict them.

Are there any mappers making that claim?  I can't think why that kind of support would be needed either, other than perhaps the ability to choose between two different pre-provided types of frob (if we decided one day to give loot objects a different type of frob effect).

Link to comment
Share on other sites

2 hours ago, OrbWeaver said:

Nevertheless, for the main bulk of materials which do not need per-material customisation, I don't understand what benefit a macro (which the material author must remember to manually include in every material he creates) provides over simply doing what the macro would do in the C++ code, automatically, for every material.

My main concern is shortening or eliminating the repetitive frob stages from every material, so both approaches would work. A macro would probably make it easier for mappers to modify default behaviour by just changing the numbers or the texture path, but I'd prefer to just have a wiki entry describing how to get custom behaviour.

 

1 hour ago, Springheel said:

I can't think why that kind of support would be needed either, other than perhaps the ability to choose between two different pre-provided types of frob (if we decided one day to give loot objects a different type of frob effect).

The default frob highlight is basic & generic, so I can imagine mappers wanting to get different effects the same way they would want a custom menu cursor or background. Really they should be able to add any kind of material-based effect they want - i.e. animated textures, pulsating intensity - using the same rules as the rest of the material system.

 

Perhaps the main issue why frob highlights have rarely been changed so far is that it could only be done on a per-material basis. This makes a global change to frob highlighting completely impractical. Perhaps the most mapper-friendly approach could be to implement default frob behaviour as an own material definition, which applies to to all materials by default and can easily be changed by a mapper. If a mapper wants multiple types of frob effects, it'd be good to allow him to make new frob materials and apply them either to materials or to entities (as spawnargs).

Link to comment
Share on other sites

7 minutes ago, STiFU said:

That would be the ultimate goal, yes!

https://bugs.thedarkmod.com/view.php?id=5428

Personally, I'd be interested in looking at new frob visuals...I don't think any kind of brightening effect is going to solve the problem of seeing the effect in bright rooms.  A subtle outline might be the way to go, and we could colour code it....white for regular objects and yellow for loot, for example.

Link to comment
Share on other sites

2 minutes ago, Springheel said:

Personally, I'd be interested in looking at new frob visuals...I don't think any kind of brightening effect is going to solve the problem of seeing the effect in bright rooms.  A subtle outline might be the way to go, and we could colour code it....white for regular objects and yellow for loot, for example.

Yes, that too, of course. I already outlied above how the current frob highlight is problematic.

Link to comment
Share on other sites

It is very subjective if you say that the frob is boring, i personally like it just fine.

You shouldnt give this to authors, go to the top floor and give it directly to players.

Make an option in the settings for different frob options.

I can say these things because critics of my work have spoken to me, about my frob highlight and so i decided to implement a setting row for the user, in the settings menu.

Can we have more scary Zombie Horror maps?

Link to comment
Share on other sites

Peter_spy just sent me a PM:

1 minute ago, peter_spy said:

I was about to reply to the thread but it was moved while I was writing.

I just wanted to say that I agree with your notion that maybe frob code should be taken away from mappers. I remember one mission using my Builder Compound assets, where mapper didn't bother to remove my custom frob, so there were two frob systems in place 😕 It was also weird that testers didn't report it.

I'd vote for that outline in the video I posted, that should work in most lighting scenarios. Just choose some light grey/ash white outline and lock it, something in RGB 192-224 should work nicely. Or, maybe let people change it via console command.

As a bonus, I'd leave an option to make your own frob code to those who know what they're doing, i.e.:

1) If there's no frob code in the material, use the default one.

2) If someone uses if ( parm11 > 0 ) clause in their stage, let it overrride the defaults. Or something like that.

You can copypaste all this in the frob thread if you want to :)

 

Link to comment
Share on other sites

11 hours ago, cabalistic said:

If no one else wants to, I could look into creating an outline effect for highlighted objects. Probably after 2.09, though, or as a "late" addition to the beta, at best.

You are really welcome.
As far as I understand, the outline effect cannot be implemented with a material shader alone, and requires some C++ support.

To be honest, I have a feeling that any type of single-color brightening will be hardly visible under some conditions.
Either mixed brightening + darkening or multi-color brightening is needed to cover all cases.

Link to comment
Share on other sites

13 hours ago, cabalistic said:

If no one else wants to, I could look into creating an outline effect for highlighted objects. Probably after 2.09, though, or as a "late" addition to the beta, at best.

As a first step, though', we should try to achieve feature parity between the material-hack and the new GLSL implementation, so we can finally get rid of that hack. That means 1) to create the same look as the one created by material defs and 2) make sure all attachments (hinges in screenshot) are also highlighted. @duzenko, did you maybe just forget about the attachments?

I would love to see a cvar for choosing from multiple frob highlights as there are some thief fans that don't like fancy frob highlights, so I would like to retain an option for them to keep the original frob highlight.

Something else to consider is a rather simple TDS-like frob highlight. It utilized the normalmap to add a blue-tint from the left side of the object. I know back in the days it got a lot of hate, but it actually worked well in many lighting situations. I can also see a mixed brightening and darkening with this approach, as @stgatilovsuggested.

Link to comment
Share on other sites

Oh, I have access to the thread again.

I'd suggest starting with something simple, and not considering all the possibilities that arise in our heads.

First off, a simple color outline. That kind of thing is used in Dishonored for example, and it looks decent in all lighting conditions. If that's not enough, then you can worry about the next steps. From what @cabalistictold me, the video example I provided is a post-process effect, so that may solve the problem of different lighting setups.

Edited by peter_spy
Link to comment
Share on other sites

2 hours ago, STiFU said:

As a first step, though', we should try to achieve feature parity between the material-hack and the new GLSL implementation, so we can finally get rid of that hack. That means 1) to create the same look as the one created by material defs and 2) make sure all attachments (hinges in screenshot) are also highlighted. @duzenko, did you maybe just forget about the attachments?

It's one of those alpha bugs, things that get fixed after someone notices and reports it

  • Like 1
Link to comment
Share on other sites

Quote

there are some thief fans that don't like fancy frob highlights,

 

I think that's true for the majority of players, Thief and TDM. 

  • Like 1
Link to comment
Share on other sites

  • 3 months later...

Looping back on this, if the frob code gets booted we need to find something that works in a variety of lighting situations and material values (dark - light).

I am against color coding anything simply because it could be a nightmare to manage what objects do what . I think keeping in line with classic thief is the way to go with some solution for darker materials (which dont show up very well in the current scheme).

EDIT: The current prototype highlight looks nice IMO but is a bit too strong. We shouldn't go full white but maybe 25-50 percent. Another option would be to add a custom setting that allows players to pick how strong of a highlight they want.

Untitled-1.thumb.jpg.57459ecabd6ba1b74271ac73ee4b5dd2.jpg
 

  • Like 2
Link to comment
Share on other sites

Can it just brighten the item like classic Thief and then  subtly outline it?  The thing that turns me off about what I'm seeing is that we're back to solid colors overlaid on items as they were in Deadly Shadows.  In the early days of the Mod I figured out the whole material stage brightening to replicate classic Thief and it was then improved / modified over the years but of course all those material shaders are a pain.

My only request is to please not go the TDS style route.  I think the outlines as springheel suggested would be nice.

Link to comment
Share on other sites

If the normals are accessible to the shader (I think they are stored globally), then creating a frob shader hilighting the outlines should be doable by identifying areas where said normals change strongly. This approach may fail with compareable round objects. Another approach would be to utilize the depth image, which could be troublesome with compareable small objects, though. A third approach would be to combine those two, which may fail with small round objects :D

A post processing of the above effect might also work. Strengthen the effect if not all surroundings are affected and dimish it otherwise.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I guess I'm going against the grain here but I think the image @kingsal posted looks great. It seems that the effect is already aware of the normals — it definitely looks like it is outlining the object, giving less highlight to faces which point directly towards the camera while increasing the effect on edges which face away. Perhaps if people feel it is too strong, the "effect gradient" could be adjusted so that there was even less highlighting in the middle of the object?

  • Like 2
Link to comment
Share on other sites

Here is  a modified version of the fresnel :frob.fs
- Tighten the fresnel up a bit
- Reduced the overall brightness of the object but increased the fresnel brightness.

There's still a lot of problems with normals blowing out and alpha textures, but we might be able to fix that. The fresnel with a subtle outline could work really well (assuming someone has the time to make the outline shader) :)

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

I had a question regarding the implementation of the frob outline as it is in the dev builds. I know it is deemed unfinished so my question is is there going to be a highlighting function also implemented or is the system going to change per object? Certain things, well mostly one thing, like the combination locks, don't function as intended with an outline system. The dials are only visible with a highlighting system. I really love how the outline looks even in its unfinished state. I can very quickly see if an item is selected even in rather well lit situations. So far this seems to be the only downside. Screenshots in the spoiler showing more clearly what I am referencing...

Spoiler

This is how we all know the combination locks to look and function...

qZaoKYQ.jpg

This is how they look with just the outline as it is currently implemented...

O0TcspT.jpg

And this is how things look with both outline and highlight. Functional at least, I suppose...

oI3MjWH.jpg

 

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

      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
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
    • Ansome

      Well then, it's been about a week since I released my first FM and I must say that I was very pleasantly surprised by its reception. I had expected half as much interest in my short little FM as I received and even less when it came to positive feedback, but I am glad that the aspects of my mission that I put the most heart into were often the most appreciated. It was also delightful to read plenty of honest criticism and helpful feedback, as I've already been given plenty of useful pointers on improving my brushwork, level design, and gameplay difficulty.
      I've gotten back into the groove of chipping away at my reading and game list, as well as the endless FM catalogue here, but I may very well try my hand at the 15th anniversary contest should it materialize. That is assuming my eyes are ready for a few more months of Dark Radiant's bright interface while burning the midnight oil, of course!
      · 4 replies
×
×
  • Create New...