Skip to content

Commit

Permalink
Merge pull request #362 from NVlabs/SphereModels
Browse files Browse the repository at this point in the history
Add Sphere models
  • Loading branch information
bboudaoud-nv committed Apr 11, 2022
2 parents 8644344 + 0747512 commit d02265a
Show file tree
Hide file tree
Showing 9 changed files with 2,644 additions and 3 deletions.
518 changes: 518 additions & 0 deletions data-files/model/target/low_poly_sphere.obj

Large diffs are not rendered by default.

1,919 changes: 1,919 additions & 0 deletions data-files/model/target/mid_poly_sphere.obj

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions data-files/model/target/sphere.mtl
@@ -0,0 +1,26 @@
# Blender MTL File: 'None'
# Material Count: 1

newmtl icosahedron_default
Ns 10.000
Ni 1.500
d 1.000
Tr 0.000
Tf 1.000 1.000 1.000
illum 2
Ka 1.000 0.000 0.000
Kd 1.000 0.000 0.000
Ks 0.000 0.000 0.000
Ke 0.000 0.000 0.000

newmtl Silhouette
Ns 10.000
Ni 1.500
d 1.000
Tr 0.000
Tf 1.000 1.000 1.000
illum 2
Ka 0.000 0.000 0.000
Kd 0.000 0.000 0.000
Ks 0.000 0.000 0.000
Ke 0.000 0.000 0.000
113 changes: 113 additions & 0 deletions data-files/samples/spheres.Experiment.Any
@@ -0,0 +1,113 @@
{
description = "spheres";
frameRate = 120;
showHUD = true;
renderWeaponStatus = true;
cooldownMode = "ring";
cooldownColor = Color4(0.7,1.0,0.9,0.75);

weapon = {
id = "1hit";
firePeriod = 0.3;
damagePerSecond = 4;
autoFire = false;
};
sessions = (
{
id = "icosohedron";
description = "icosohedron";
trials = (
{
count = 20;
ids = ( "ico");
}
);

},
{
id = "lowpoly";
description = "low polygon";
trials = (
{
count = 20;
ids = ( "low");
}
);

},
{
id = "midpoly";
description = "mid polygon";
trials = (
{
count = 20;
ids = ( "mid", "mid");
}
);

},
{
id = "highpoly";
description = "high polygon";
trials = (
{
count = 20;
ids = ( "high", "high");
}
);

},
{
id = "mixedtypes";
description = "mixed types";
trials = (
{
count = 20;
ids = ( "ico", "low", "mid", "high");
},
);

},
);

targets = (
{
id = "ico";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/target.obj";
};
},
{
id = "low";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/low_poly_sphere.obj";
};
},
{
id = "mid";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/mid_poly_sphere.obj";
};
},
{
id = "high";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
// if you want to use the high polygon model, get it from here https://drive.google.com/file/d/1LvJaJUD3k7DR0taZYZ_9Y0PNVQDMdShM/view?usp=sharing
// modelSpec = ArticulatedModel::Specification{
// filename = "model/target/high_poly_sphere.obj";
// };
},
);

}
12 changes: 12 additions & 0 deletions data-files/samples/spheres.Status.Any
@@ -0,0 +1,12 @@
{
currentUser = "Sample User";
sessions = ( "mixedtypes", "icosohedron", "lowpoly", "midpoly", "highpoly");
settingsVersion = 1;
users = (
{
completedSessions = ( );
id = "Sample User";
sessions = ( "mixedtypes", "icosohedron", "lowpoly", "midpoly", "highpoly");
} );

}
48 changes: 48 additions & 0 deletions docs/experimentConfigReadme.md
Expand Up @@ -171,6 +171,54 @@ targets = [
],
```

#### Target model notes

Target models can get quite large in file size when they're highly detailed. As a result, we only include a handful of different model files with the FPSci repo and binary distributions. We have made a high quality sphere model available that you can [download from google drive here](https://drive.google.com/file/d/1LvJaJUD3k7DR0taZYZ_9Y0PNVQDMdShM/view?usp=sharing). Once you get that file (named `high_poly_sphere.obj`), you can place it in the `data-files/model/target/` directory or the `FPSci/model/target/` directory if using a binary distribution. We recommend scripting the download of this type of file if you are building an automated experiment build on FPSci. These files can then be used by targets as follows:

```
targets = (
{
id = "ico";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/target.obj";
};
},
{
id = "low";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/low_poly_sphere.obj";
};
},
{
id = "mid";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/mid_poly_sphere.obj";
};
},
{
// This one only works if you download the file from https://drive.google.com/file/d/1LvJaJUD3k7DR0taZYZ_9Y0PNVQDMdShM/view?usp=sharing
id = "high";
destSpace = "player";
speed = ( 0, 0 );
visualSize = ( 0.05, 0.05 );
modelSpec = ArticulatedModel::Specification{
filename = "model/target/high_poly_sphere.obj";
};
},
);
```

The above examples are borrowed from the Spheres experiment sample that is provided with FPSci. Feel free to try that out if you want to compare the target shapes in game.

## Target Paths (Using Destinations)
The `destinations` array within the target object overrides much of the default motion behavior in the target motion controls. Once a destinations array (including more than 2 destiantions) is specified all other motion parameters are considered unused. Once a `destinations` array is specified only the following fields from the [target configuration](#target-configuration) apply:

Expand Down
7 changes: 6 additions & 1 deletion scripts/package/fpsci_packager.sh
@@ -1,5 +1,5 @@
#!/bin/bash
# Autogenerated 2022 02 03 07:20:27
# Autogenerated 2022 04 11 17:27:44
mkdir -p dist/sound/
mkdir -p dist/shader/UniversalSurface/
mkdir -p dist/shader/UniversalMaterial/
Expand Down Expand Up @@ -52,13 +52,18 @@ cp ./data-files/samples/weapons.Status.Any dist/samples/
cp ./data-files/samples/weapons.Experiment.Any dist/samples/
cp ./data-files/samples/targets.Status.Any dist/samples/
cp ./data-files/samples/targets.Experiment.Any dist/samples/
cp ./data-files/samples/spheres.Status.Any dist/samples/
cp ./data-files/samples/spheres.Experiment.Any dist/samples/
cp ./data-files/samples/sample.User.Any dist/samples/
cp ./data-files/samples/sa2019_track.Status.Any dist/samples/
cp ./data-files/samples/sa2019_track.Experiment.Any dist/samples/
cp ./data-files/samples/sa2019_1hit.Status.Any dist/samples/
cp ./data-files/samples/sa2019_1hit.Experiment.Any dist/samples/
cp ./data-files/model/target/target.obj dist/model/target/
cp ./data-files/model/target/target.mtl dist/model/target/
cp ./data-files/model/target/sphere.mtl dist/model/target/
cp ./data-files/model/target/mid_poly_sphere.obj dist/model/target/
cp ./data-files/model/target/low_poly_sphere.obj dist/model/target/
cp ./data-files/model/sniper/sniper.obj dist/model/sniper/
cp ./data-files/model/sniper/sniper.mtl dist/model/sniper/
cp ./data-files/material/low-contrast-checker-huge-1024x1024.png dist/material/
Expand Down
2 changes: 1 addition & 1 deletion source/FpsConfig.h
Expand Up @@ -226,7 +226,7 @@ class TargetViewConfig {
float refTargetSize = 0.05f; ///< Size of the reference target
Color3 refTargetColor = Color3(1.0, 0.0, 0.0); ///< Default reference target color
Any refTargetModelSpec = PARSE_ANY(ArticulatedModel::Specification{ ///< Basic model spec for reference target
filename = "model/target/target.obj";
filename = "model/target/low_poly_sphere.obj";
cleanGeometrySettings = ArticulatedModel::CleanGeometrySettings{
allowVertexMerging = true;
forceComputeNormals = false;
Expand Down
2 changes: 1 addition & 1 deletion source/TargetEntity.h
Expand Up @@ -86,7 +86,7 @@ class TargetConfig : public ReferenceCountedObject {
bool hasGloss = false; ///< Target has gloss specified

Any modelSpec = PARSE_ANY(ArticulatedModel::Specification{ ///< Basic model spec for target
filename = "model/target/target.obj";
filename = "model/target/low_poly_sphere.obj";
cleanGeometrySettings = ArticulatedModel::CleanGeometrySettings{
allowVertexMerging = true;
forceComputeNormals = false;
Expand Down

0 comments on commit d02265a

Please sign in to comment.