Jump to content


Photo

Custom frob idea

frob shader

10 replies to this topic

#1 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 758 posts

Posted 16 July 2017 - 06:07 AM

*
POPULAR

Lately, I was fiddling with TDM frob shader, because often I find it too subtle for my taste. Don’t get me wrong, it works as intended, but it looks best in complete darkness. In more lit rooms, e.g. while putting out candles, it’s a bit hard to see whether you’re able to interact with an object or not. Modern games use Fresnel-based shader to achieve this, so an object gets a bright outline. This is very in-your-face and something more like the “atomic-blue frob” from Thief Deadly Shadows we all hated back in the day. That said, I think you can achieve some middle ground here.

 

I couldn’t get the proper fresnel program to work, since I’m not that good at shaders, but I don’t think I will need it. Instead, I created a “fake Fresnel” cubemap, which looks like this:

 

fres_back.png

 

You can easily make it in Gimp. It’s a 256 texture with radial gradient from black to white, and offset of 50, so the color transition starts further away from the center. If you just want an outline, use pure black as starting color. I wanted both some highlight and an outline, so I used RGB 32. Now you have to save it 6 times with _back, _down, _forward etc., so it gets recognized as a cubemap.

Then you have to go to your material definition and put this instead of standard frob code:

 // This is the code required for frob highlighting this texture
{
  if ( parm11 > 0 )
  maskcolor
  map makealpha (_white)
  alpha .2  // modify it as you wish
}
{
        if ( parm11 > 0 )
  blend gl_dst_alpha, gl_one
  maskalpha
  cameraCubeMap cubemap/path/here
  texgen  reflect
}

 

Cool thing is, you can tweak the cubemap intensity with alpha parameter, so you’ll get more consistent look when you need different values for e.g. wooden and glass objects (the latter typically require more visible frob). This effect also looks a bit different on .ase models and on brushes / func_statics made in DR, so you can tweak it to look the same across all materials and types of surfaces.

 

Small comparison:

 

Clipboard01.png


  • Bikerdude, HMart, jaxa and 2 others like this

#2 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 19016 posts

Posted 16 July 2017 - 08:28 AM

Ohh I see where your going, its like the frob we have seen in a lot of other games.

 

Also what the heck is that thing...?



#3 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 758 posts

Posted 16 July 2017 - 09:40 AM

Yup, this is more like Bioshock / Dishonored kind of frob, only not that super shiny. I don't have any interactive objects in my FM yet, so I use what I can ;) This is my electric lamp model. It's a good example of an object with high specularity. Notice that standard TDM frob highlights mostly the shiny parts, while contrast remains similar. Cubemap frob looks more like a layer put on top of the object, that's why it's more distinct.


  • Bikerdude likes this

#4 HMart

HMart

    Advanced Member

  • Member
  • PipPipPip
  • 568 posts

Posted 16 July 2017 - 08:18 PM

Nice done, not exaggerated like i like it, btw while editing the fhDoom engine, i found idsoftware played with item highlight for Doom 3, but disabled it for the final game, i was able to enable it again and it was just the case of changing a bool from false to true, i also found that the material shader for it is still in the game and it also uses a cubemap.

itemHighlightShell
{
   nonSolid
	{
     	    blend add
	    cubeMap	env/sheen
            texgen	reflect
	    rgb		parm4
	}
} 

Unfortunately, is a pulse based highlight (on and off) system so it looks to obvious and in your face, but was cool to find how they did it.  


Edited by HMart, 16 July 2017 - 08:19 PM.

  • Judith likes this

#5 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 819 posts

Posted 17 September 2017 - 09:27 PM

I couldn’t get the proper fresnel program to work

 

frob.vfp was designed to give a fresnel-like frob highlight, but it's unused because of a bug with TGA textures.

 

http://forums.thedar...ht/#entry174954

http://forums.thedar...es/#entry199639


Some things I'm repeatedly thinking about...

- louder scream when you're dying


#6 Bikerdude

Bikerdude

    Mod hero

  • Member
  • PipPipPipPipPip
  • 19016 posts

Posted 19 September 2017 - 06:00 AM

Now that we are open source can the issue Greebo mentioned un the second post be now looked at?

#7 NeonsStyle

NeonsStyle

    Advanced Member

  • Member
  • PipPipPip
  • 1266 posts

Posted 20 September 2017 - 09:10 AM

Sorry, but I really don't like it. One of the worst thing with T3 and T4 was the horrid frob glow.

 

TDMs frob is perfect, not too bright, not too dark. When you know what can be frobbed, it's perfectly easy, and it's something we enjoy learning

about the game; what is touchable and what isn't. Making it obvious just ruins that discovery.


I have a small YouTube channel making videos on a variety of games. Come and have look here:
 
https://www.youtube.com/c/NeonsStyleHD

 

Briarwood Manor - available here or in game

http://forums.thedar...2017-update-16/

 

 

 


#8 Judith

Judith

    Advanced Member

  • Member
  • PipPipPip
  • 758 posts

Posted 20 September 2017 - 11:17 AM

The default frob is far from perfect; it works well in the dark, but as I said above, finding what is frobable or extinguishing candles, in rooms which are better lit, can be a pain. This fake-fresnel frob is more pronounced and can be tweaked per material, so it's not so in your face, and it works more consistently.



#9 duzenko

duzenko

    Advanced Member

  • Active Developer
  • PipPipPip
  • 901 posts

Posted 22 September 2017 - 01:47 PM

My 5 cents.

I don't like how TDM handles frob now. Each frobable material has these two extra stages, and not only it makes loading a map slower (because of extra data parsing) but it also adds extra draw call when an entity is selected.

Instead I would propose to highlight the entity in the standard ambient shader by simple color add. (cubemap wrap, etc).

This way once changed in the GPU shader code it would apply to all materials.

It would also allow different. configurable frob visuals.



#10 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 36631 posts

Posted 22 September 2017 - 02:03 PM

We've had lots of proposals for alternate frobs over the years.  It really takes a test-map, or at least a video, to get a good sense of whether a proposal is preferable to what we already have.



#11 VanishedOne

VanishedOne

    Advanced Member

  • Member
  • PipPipPip
  • 819 posts

Posted 22 September 2017 - 02:30 PM

Slightly tweaked frobs per material aren't unknown: tdm_pagan_orb_glow adds some white twice, which gives the orb a bluish frob glow.
 
I remember finding the frob highlight of textures/darkmod/wood/panels/beam_brown_old too dark to see easily; had I needed to keep that entity frobable I'd probably have tweaked the material def.
 
(I wondered whether it was a deliberate choice not to give bc_doublebass_* materials frob highlights: a frobable double bass will have only the strings highlighted. Whether that's helpful visual language probably depends on whether one intends to have the frob play a sound or pick up the entity.)
 
So there's something to be said for being able to control the frob highlight on a per-material basis.
 
Edit: quoting this here before I forget it's there:
 

It blends in a portion of _white plus a portion of the diffuse. This is 99.9% effective but there were a few dark textures we had to boost that portion. I recall dark bottles were hard to see. The padlock also. [...] We may from time to time find a texture that needs adjusting. Fortunately its settable individually in every material.


Edited by VanishedOne, 07 November 2017 - 01:29 PM.

Some things I'm repeatedly thinking about...

- louder scream when you're dying




Reply to this topic



  



Also tagged with one or more of these keywords: frob, shader

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users