Skip to content

Commit 8ab9366

Browse files
committed
Add target emissive config parameter and document
1 parent b3c01eb commit 8ab9366

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

docs/experimentConfigReadme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ The following configuration is universal to all target types.
8383
* `visualSize` is a vector indicating the minimum ([0]) and maximum ([1]) visual size for the target (in deg)
8484
* `colors` is an array of 2 colors (max and min health) which are interpolated between based on target damage (note this setting overrides the experiment or session-level [`targetHealthColors`](general_config.md#target-rendering) setting). If unspecified the experiment/session level settings are used.
8585
* `gloss` is a `Color4` representing glossyness, the first 3 channels are RGB w/ alpha representing minimum reflection (F0). Set all channels to 0 or do not specify to disable glossy reflections (note this setting overrides the experiment or session-level [`targetGloss`](general_config.md#target-rendering) setting). If unspecified the experiment/session level settings are used.
86+
* `emissive` is an array of 2 colors (max and min health) which are interpolated between based on the target damage (note this setting overrides the experiment or session-level [`targetEmissive`](general_config.md#target-rendering) setting). If unspecified the experiment/session level settings are used.
8687
* `destSpace` the space for which the target is rendered (useful for non-destiantion based targets, "player" or "world")
8788
* `hitSound` is a filename for the sound to play when the target is hit but not destroyed (for no sound use an empty string).
8889
* `hitSoundVol` provides the volume (as a float) for the hit sound to be played at (default is `1.0`).

docs/general_config.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ These flags help control the behavior of click-to-photon monitoring in applicati
508508
|-----------------------|-----------------------|------------------------------------------------------------------------------------|
509509
|`targetHealthColors` |[`Color3`, `Color3`] | The max/min health colors for the target as an array of [`max color`, `min color`], if you do not want the target to change color as its health drops, set these values both to the same color |
510510
|`targetGloss` |`Color4` | The target glossy (reflection) value, first 3 channels are RGB w/ alpha representing minimum reflection (F0). Set all channels to 0 or do not specify to disable glossy reflections. This sets the glossy color for the reference target in addition to trial targets |
511+
|`targetEmissive` |[`Color4`, `Color4`] | The max/min health emissive colors for the target as an array of [`max color`, `min color`], if you do not want the target to change color as its health drops set the values both to the same color. If no value is specified a default of 0.7 * the target color is used to match historical behavior. |
511512
|`showReferenceTarget` |`bool` | Show a reference target to re-center the view between trials/sessions? |
512513
|`referenceTargetColor` |`Color3` | The color of the "reference" targets spawned between trials |
513514
|`referenceTargetSize` |m | The size of the "reference" targets spawned between trials |
@@ -542,6 +543,10 @@ These flags help control the behavior of click-to-photon monitoring in applicati
542543
"showReferenceTargetMissDecals" : true, // Show miss decals for reference targets
543544
"previewTargetColor" = Color3(0.5, 0.5, 0.5), // Use gray for preview targets (if they are shown)
544545
"targetGloss" = Color4(0.4f, 0.2f, 0.1f, 0.8f), // Use the target gloss behavior from FPSci v22.02.01 and earlier
546+
"targetEmissive" = [
547+
Color4(0, 0.7, 0, 1);
548+
Color4(0.7, 0, 0, 1);
549+
],
545550
```
546551

547552
### Target Health Bars

source/FpsConfig.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,6 +440,7 @@ void TargetViewConfig::load(FPSciAnyTableReader reader, int settingsVersion) {
440440
throw "Specified \"healthColors\" doesn't contain at least one Color3!";
441441
}
442442
reader.getIfPresent("targetGloss", gloss);
443+
reader.getIfPresent("targetEmissive", emissive);
443444
reader.getIfPresent("targetHealthBarColors", healthBarColors);
444445
reader.getIfPresent("showFloatingCombatText", showCombatText);
445446
reader.getIfPresent("floatingCombatTextSize", combatTextSize);

source/FpsConfig.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,13 @@ class FeedbackConfig {
192192
class TargetViewConfig {
193193
public:
194194
// Target color based on health
195-
Array<Color3> healthColors = { ///< Target start/end color (based on target health)
195+
Array<Color4> healthColors = { ///< Target start/end color (based on target health)
196196
Color3(0.0, 1.0, 0.0),
197197
Color3(1.0, 0.0, 0.0)
198198
};
199199

200-
Color4 gloss; ///< Target glossyness (alpha is F0 or minimum reflectivity, see G3D docs)
200+
Color4 gloss; ///< Target glossyness (alpha is F0 or minimum reflectivity, see G3D docs)
201+
Array<Color4> emissive; ///< Target emissive color
201202

202203
// Target health bars
203204
bool showHealthBars = false; ///< Display a target health bar?

source/TargetEntity.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ TargetConfig::TargetConfig(const Any& any) {
7575
reader.getIfPresent("destroyedSound", destroyedSound);
7676
reader.getIfPresent("destroyedSoundVol", destroyedSoundVol);
7777
reader.getIfPresent("colors", colors);
78+
reader.getIfPresent("emissive", emissive);
7879
hasGloss = reader.getIfPresent("gloss", gloss);
7980

8081
break;

source/TargetEntity.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ class TargetConfig : public ReferenceCountedObject {
8181
float destroyedSoundVol = 1.0f;
8282

8383
// Target color based on health
84-
Array<Color3> colors; ///< Target start/end color (based on target health)
84+
Array<Color4> colors; ///< Target start/end color (based on target health)
8585
Color4 gloss; ///< Target gloss (alpha is F0, see docs)
8686
bool hasGloss = false; ///< Target has gloss specified
87+
Array<Color4> emissive; ///< Target start/end emissive color (similar to colors above)
8788

8889
Any modelSpec = PARSE_ANY(ArticulatedModel::Specification{ ///< Basic model spec for target
8990
filename = "model/target/low_poly_sphere.obj";

0 commit comments

Comments
 (0)