View Issue Details

IDProjectCategoryView StatusLast Update
0005427The Dark ModGraphicspublic10.11.2021 04:17
ReporterSTiFU Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status assignedResolutionopen 
Product VersionTDM 2.08 
Target VersionTDM 2.10 
Summary0005427: Remove frob-highlight stages from materials
DescriptionCurrently, material stages are used to implement frob-highlight, which was a neccessity back when we didn't have access to the engine source-code.

This method has various drawbacks:
-Writing the frob-highlight stage is easily forgotten -> Errorprone
-Frob-Highlight stage can be incorrect -> Errorprone
-Obfuscates/clutters up material definition

Moving to a GLSL shader avoids these issues and also opens the door for different types of frob-Highlight, as the simple ambient increase also has its drawbacks (you cannot see the frob highlight well in strongly lit areas).
Additional InformationAfter moving frob highlight to GLSL, we should also remove the frob-highlight stage from all existing materials and change the wiki accordingly.
TagsNo tags attached.

Relationships

related to 0003122 closednbohr1more Add ambient and frobhighlight macros to the material parser 
related to 0004487 resolvedDragofer Plaster materials missing frob highlighting 
related to 0005428 new Add a different frob-highlight for loot objects to make them better distinguishable from junk 

Activities

nbohr1more

nbohr1more

30.11.2020 05:11

developer   ~0013050

If the current highlight behavior is retained during the move to GLSL, we should make sure that SSAO is multiplied
to the result. The current highlight overrides SSAO shading in most cases.
nbohr1more

nbohr1more

07.12.2020 18:25

developer   ~0013113

Last edited: 07.12.2020 21:43

Duzenko already did some work on this.

See the "r_newFrob" cvar and commits 8051, 8052

See also:

https://forums.thedarkmod.com/index.php?/topic/19915-208-new-frob-shader/
stgatilov

stgatilov

29.04.2021 12:00

administrator   ~0013933

Big burst of development (almost completely by Cabalistic):
  https://forums.thedarkmod.com/index.php?/topic/20878-new-frob-shader/

Frob-highlight outline was added in commits:
  r9290. Add Frob outline stage.
  r9291. Move gaussian blur shader to general utility shaders
  r9292. Migrate Bloom stage to fullscreen tri
  r9293. Migrate AO stage to fullscreen tri
I believe the first commit changes behavior, while all the rest are some refactoring.

For the development & testing period, the frob-outline is controlled by many cvars starting with "r_frobOutline".
Forum posts:
  https://forums.thedarkmod.com/index.php?/topic/20878-new-frob-shader/&do=findComment&comment=459046
  https://forums.thedarkmod.com/index.php?/topic/20878-new-frob-shader/&do=findComment&comment=459060

And one more minor commit:
  r9324. Frob outline is now full-white + disabled shader-based frob highlight.
stgatilov

stgatilov

30.09.2021 16:56

administrator   ~0014380

Picked up the torch, trying to make a bit less hacky depth-aware outline (and hopefully a bit more subtle).
In fact, I restored and slightly tweaked the older prototype which Cabalistic created.

First of all, let's draw outline for translucent surfaces.
  r9603. Do not drop translucent surfaces from render order, do not default diffuse map to white if not set explicitly.
Because we cannot rely on surface highlighting for them, it usually has no effect (no diffuse map or black map), see e.g. atdm:moveable_flask1.
As for the reason to default to black instead of white, check atdm:moveable_hourglass --- it gets full-white color otherwise.

Added code path for new outline:
  r9605. Restored and tweaked a purely geometrical outline under "r_frobOutline 2".

And improved the look of alpha-tested objects:
  r9607. Do not draw outline of an edge if its middle-point fails alpha-test.
See e.g. atdm:moveable_food_turnip or atdm:moveable_gear_metal_fancy.

Minor stuff:
  r9604. Forked frob_silhouette fragment shader into frob_flat and frob_modalpha.
  r9606. Fixed r_showTris with r_frobOutline 2.
stgatilov

stgatilov

02.10.2021 13:34

administrator   ~0014391

More changes:
  r9614. Support alpha-tested objects in image-based outline (r_frobOutline 1).
stgatilov

stgatilov

04.10.2021 13:04

administrator   ~0014395

Assigned to myself, because I'm still working on the outline.
And the end goal (deleting material stages) is still far away.
stgatilov

stgatilov

06.10.2021 06:18

administrator   ~0014413

Two more fixes for image-based outline.

I noticed that outline width was capped by edges extrusion, depending on resolution, so fixed it the right way:
  r9615. Use precise formula for extrusion radius for "r_frobOutline 1".

Also changed the way how pixels on extruded edges and alpha-failed parts are treated:
  r9623. Major refactoring of frob-highlight + changed depth-aware image-based outline.
stgatilov

stgatilov

10.11.2021 04:17

administrator   ~0014527

Quick switching between many modes of outline that we have:
  r9626. Added r_frobOutlinePreset command, set hard geometric outline as default.

Also fixed the problem of hard geometric outline with bloom:
  r9641. Added proper hard mode to geometric outline to avoid bloom sparklies due to overly high alpha.

Issue History

Date Modified Username Field Change
22.11.2020 11:24 STiFU New Issue
22.11.2020 12:08 STiFU Relationship added related to 0005428
30.11.2020 05:11 nbohr1more Note Added: 0013050
07.12.2020 18:25 nbohr1more Note Added: 0013113
07.12.2020 20:47 nbohr1more Relationship added related to 0003122
07.12.2020 21:43 nbohr1more Note Edited: 0013113
12.12.2020 04:37 stgatilov Target Version => TDM 2.10
19.01.2021 20:46 nbohr1more Relationship added related to 0004487
18.02.2021 15:42 stgatilov Assigned To => cabalistic
18.02.2021 15:42 stgatilov Status new => assigned
29.04.2021 11:52 stgatilov Summary Move Frob-Highlight to GLSL => Remove frob-highlight stages from materials
29.04.2021 12:00 stgatilov Note Added: 0013933
30.09.2021 16:56 stgatilov Note Added: 0014380
02.10.2021 13:34 stgatilov Note Added: 0014391
04.10.2021 12:09 nbohr1more Status assigned => feedback
04.10.2021 13:03 stgatilov Assigned To cabalistic => stgatilov
04.10.2021 13:03 stgatilov Status feedback => assigned
04.10.2021 13:04 stgatilov Note Added: 0014395
06.10.2021 06:18 stgatilov Note Added: 0014413
10.11.2021 04:17 stgatilov Note Added: 0014527