Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
Press 'n' key to advance step by step

### Step 1
- Scale to 1m
### Step 2
- AntiqueCamera.glb Model is visible
- ![](./ExpectedImage_00000.png)
### Step 2
### Step 3
- Clean up after test
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
Press 'n' key to advance step by step

### Step 1
- Scale to 1m
### Step 2
- AntiqueCamera.gltf Model is visible
- ![](./ExpectedImage_00000.png)
### Step 2
### Step 3
- Clean up after test
2 changes: 1 addition & 1 deletion tests/content/entity/zone/zoneEffects/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
Press 'n' key to advance step by step

### Step 1
- Setup object, zones and markers
- Setup object and zones
### Step 2
- Setup avatar
### Step 3
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions tests/engine/render/effect/ambientocclusion/hbao/default/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') {
PATH_TO_THE_REPO_PATH_UTILS_FILE = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js";
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
nitpick = createNitpick(Script.resolvePath("."));
}

nitpick.perform("HBAO - default", Script.resolvePath("."), "primary", function(testType) {
Script.include("../../setup.js?raw=true")

var createdEntities;
nitpick.addStep("Setup", function () {
createdEntities = setup(nitpick.getOriginFrame());
configureAO("horizonBased", true);
});
nitpick.addStepSnapshot("Show default HBAO effect");

nitpick.addStep("Clean up after test", function () {
for (var i = 0; i < createdEntities.length; i++) {
Entities.deleteEntity(createdEntities[i]);
}
finalize();
});

nitpick.runTest(testType);
});
16 changes: 16 additions & 0 deletions tests/engine/render/effect/ambientocclusion/hbao/default/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# HBAO - default
## Run this script URL: [Manual](./test.js?raw=true) [Auto](./testAuto.js?raw=true)(from menu/Edit/Open and Run scripts from URL...).

## Preconditions
- In an empty region of a domain with editing rights.

## Steps
Press 'n' key to advance step by step

### Step 1
- Setup
### Step 2
- Show default HBAO effect
- ![](./ExpectedImage_00000.png)
### Step 3
- Clean up after test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') PATH_TO_THE_REPO_PATH_UTILS_FILE = 'https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js';
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
var nitpick = createNitpick(Script.resolvePath('.'));

nitpick.enableAuto();

Script.include('./test.js?raw=true');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions tests/engine/render/effect/ambientocclusion/hbao/high/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') {
PATH_TO_THE_REPO_PATH_UTILS_FILE = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js";
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
nitpick = createNitpick(Script.resolvePath("."));
}

nitpick.perform("HBAO - high", Script.resolvePath("."), "primary", function(testType) {
Script.include("../../setup.js?raw=true")

var createdEntities;
nitpick.addStep("Setup", function () {
createdEntities = setup(nitpick.getOriginFrame());
configureAO("horizonBased", true);
configureAO("resolutionLevel", 1);
configureAO("hbaoRadius", 1.0);
configureAO("hbaoNumSamples", 3);
});
nitpick.addStepSnapshot("Show high quality HBAO effect");

nitpick.addStep("Clean up after test", function () {
for (var i = 0; i < createdEntities.length; i++) {
Entities.deleteEntity(createdEntities[i]);
}
finalize();
});

nitpick.runTest(testType);
});
16 changes: 16 additions & 0 deletions tests/engine/render/effect/ambientocclusion/hbao/high/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# HBAO - high
## Run this script URL: [Manual](./test.js?raw=true) [Auto](./testAuto.js?raw=true)(from menu/Edit/Open and Run scripts from URL...).

## Preconditions
- In an empty region of a domain with editing rights.

## Steps
Press 'n' key to advance step by step

### Step 1
- Setup
### Step 2
- Show high quality HBAO effect
- ![](./ExpectedImage_00000.png)
### Step 3
- Clean up after test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') PATH_TO_THE_REPO_PATH_UTILS_FILE = 'https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js';
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
var nitpick = createNitpick(Script.resolvePath('.'));

nitpick.enableAuto();

Script.include('./test.js?raw=true');
24 changes: 24 additions & 0 deletions tests/engine/render/effect/ambientocclusion/hbao/testRecursive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// This is an automatically generated file, created by nitpick
PATH_TO_THE_REPO_PATH_UTILS_FILE = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js";
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);

if (typeof depth === 'undefined') {
depth = 0;
nitpick = createNitpick(Script.resolvePath("."));
testsRootPath = nitpick.getTestsRootPath();

nitpick.enableRecursive();
nitpick.enableAuto();
} else {
depth++
}

Script.include(testsRootPath + "engine/render/effect/ambientocclusion/hbao/high/test.js");
Script.include(testsRootPath + "engine/render/effect/ambientocclusion/hbao/default/test.js");

if (depth > 0) {
depth--;
} else {
nitpick.runRecursive();
}

165 changes: 165 additions & 0 deletions tests/engine/render/effect/ambientocclusion/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
// Ambient occlusion test setup

// To use this script, include it and execute it,
// the script will create the correct zone and objects and move the Avatar and return the list of entities in an array.
// Example:
// var entities = setup();
//
// The models are loaded from the "MODEL_DIR_URL" located on github where we store all our test models

var assetsRootPath = nitpick.getAssetsRootPath();
var MODEL_DIR_URL = assetsRootPath + "models/material_matrix_models/fbx/blender/";

var MODEL_NAME_SUFFIX = ".fbx";

var MODEL_SCALE = 1.0;
var LIFETIME = 120;

var aoConfig;
var aoConfig_sc;
var lightingModel_sc;

var obscuranceEnabled_sc;
var originalParameters = {};
var originalParameters_sc = {};

var previousSkeletonURL;
var previousScale;

configureAO = function(parameter, value) {
if (originalParameters[parameter] == null) {
originalParameters[parameter] = aoConfig[parameter];
}
if (originalParameters_sc[parameter] == null) {
originalParameters_sc[parameter] = aoConfig_sc[parameter];
}
aoConfig[parameter] = value;
aoConfig_sc[parameter] = value;
}

setup = function (originFrame) {
var entities = []

aoConfig = Render.getConfig("RenderMainView.AmbientOcclusion");
aoConfig_sc = Render.getConfig("SecondaryCameraJob.AmbientOcclusion");
lightingModel_sc = Render.getConfig("SecondaryCameraJob.LightingModel");

configureAO("enabled", true);
obscuranceEnabled_sc = lightingModel_sc.enableObscurance;
obscuranceEnabled_sc = true;

Script.include(nitpick.getUtilsRootPath() + "test_stage.js")

// Use a specific avatar. This is needed because we want the avatar's height to be fixed.
previousSkeletonURL = MyAvatar.skeletonModelURL;
MyAvatar.skeletonModelURL = "https://highfidelity.com/api/v1/commerce/entity_edition/813addb9-b985-49c8-9912-36fdbb57e04a.fst?certificate_id=MEUCIQDgYR2%2BOrCh5HXeHCm%2BkR0a2JniEO%2BY4y9tbApxCAPo4wIgXZEQdI4cQc%2FstAcr9tFT9k4k%2Fbuj3ufB1aB4W0tjIJc%3D";

previousScale = MyAvatar.scale;
MyAvatar.scale = 1.0;
MyAvatar.setEnableMeshVisible(true);

// Wait for skeleton to load (for now - only in test mode)
if (typeof Test !== 'undefined') {
Test.waitIdle();
}

// Set Avatar to T-pose
for (var i = 0; i < MyAvatar.getJointNames().length; ++i) {
MyAvatar.setJointData(i, MyAvatar.getDefaultJointRotation(i), MyAvatar.getDefaultJointTranslation(i));
}

// Set orientation to 0
MyAvatar.orientation = Quat.fromVec3Degrees({x: 0.0, y: 0.0, z: 0.0 });
var orientation = MyAvatar.orientation;

var initData = {
flags : {
hasKeyLight: true,
hasAmbientLight: true,
hasLocalLights: false
},
originFrame: nitpick.getOriginFrame()
};
entities = setupStage(initData);

var right = Quat.getRight(orientation);
var up = Quat.getUp(orientation);
var forward = Quat.getForward(orientation);
var center = Vec3.sum(originFrame, Vec3.multiply(6.0, forward));
var white = { blue: 210, green: 210, red: 210 };

entities.push( Entities.addEntity({
type: 'Box',
name: 'Box1',
shape: 'Cube',
dimensions: { x: 5.0, y: 4.0, z: 1.0 },
position: Vec3.sum(center, Vec3.sum(Vec3.multiply(1.5, right), Vec3.sum(Vec3.multiply(1.0, up), Vec3.multiply(3.0, forward)))),
rotation: Quat.multiply(orientation, Quat.fromVec3Degrees({x:-30, y:-25, z:0})),
color: white,
lifetime: LIFETIME,
}) );

entities.push( Entities.addEntity({
type: 'Box',
name: 'Box2',
shape: 'Cube',
dimensions: { x: 3.0, y: 3.0, z: 0.1 },
position: Vec3.sum(center, Vec3.sum(Vec3.multiply(0.1, up), Vec3.multiply(-1.5, right))),
rotation: Quat.multiply(orientation, Quat.fromVec3Degrees({x:80, y:15, z:0})),
color: white,
lifetime: LIFETIME,
}) );

var i;
var PICKET_COUNT = 23;
for (i=0 ; i<PICKET_COUNT ; i++) {
entities.push( Entities.addEntity({
type: 'Box',
name: 'Small Boxes',
shape: 'Cube',
dimensions: { x: 0.03, y: 1.5, z: 0.5 },
position: Vec3.sum(center, Vec3.sum(Vec3.sum(Vec3.multiply(-1.0, up), Vec3.multiply(1.0 + (i-(PICKET_COUNT-1)/2)*0.075, right)), Vec3.multiply(-0.5, forward))),
color: white,
lifetime: LIFETIME,
}) );
}

var url = MODEL_DIR_URL + "hifi_albedoM_ao" + MODEL_NAME_SUFFIX;

center = Vec3.sum(center, Vec3.multiply(-0.1, up));
entities.push( Entities.addEntity({
type: "Model",
modelURL: url,
name: "Opaque",
position: Vec3.sum(center, Vec3.sum(Vec3.multiply(-0.5, up), Vec3.multiply(-1.0, right))),
rotation: orientation,
dimensions: {x:MODEL_SCALE, y:MODEL_SCALE, z:MODEL_SCALE},
lifetime: LIFETIME,
}) );

url = MODEL_DIR_URL + "hifi_opacityV_albedoM_ao" + MODEL_NAME_SUFFIX;
entities.push( Entities.addEntity({
type: "Model",
modelURL: url,
name: "Transparent",
position: Vec3.sum(center, Vec3.sum(Vec3.multiply(-0.5, up), Vec3.multiply(-2.0, right))),
rotation: orientation,
dimensions: {x:MODEL_SCALE, y:MODEL_SCALE, z:MODEL_SCALE},
lifetime: LIFETIME,
}) );

return entities;
}

finalize = function() {
MyAvatar.skeletonModelURL = previousSkeletonURL;
MyAvatar.scale = previousScale;

for(var parameter in Object.keys(originalParameters)){
aoConfig[parameter] = originalParameters[parameter];
}
for(var parameter in Object.keys(originalParameters_sc)){
aoConfig_sc[parameter] = originalParameters_sc[parameter];
}
lightingModel_sc.enableObscurance = obscuranceEnabled_sc;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions tests/engine/render/effect/ambientocclusion/ssao/default/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') {
PATH_TO_THE_REPO_PATH_UTILS_FILE = "https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js";
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
nitpick = createNitpick(Script.resolvePath("."));
}

nitpick.perform("SSAO - default", Script.resolvePath("."), "primary", function(testType) {
Script.include("../../setup.js?raw=true")

var createdEntities;
nitpick.addStep("Setup", function () {
createdEntities = setup(nitpick.getOriginFrame());
configureAO("horizonBased", false);
});
nitpick.addStepSnapshot("Show default SSAO effect");

nitpick.addStep("Clean up after test", function () {
for (var i = 0; i < createdEntities.length; i++) {
Entities.deleteEntity(createdEntities[i]);
}
finalize();
});

nitpick.runTest(testType);
});
16 changes: 16 additions & 0 deletions tests/engine/render/effect/ambientocclusion/ssao/default/test.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SSAO - default
## Run this script URL: [Manual](./test.js?raw=true) [Auto](./testAuto.js?raw=true)(from menu/Edit/Open and Run scripts from URL...).

## Preconditions
- In an empty region of a domain with editing rights.

## Steps
Press 'n' key to advance step by step

### Step 1
- Setup
### Step 2
- Show default SSAO effect
- ![](./ExpectedImage_00000.png)
### Step 3
- Clean up after test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (typeof PATH_TO_THE_REPO_PATH_UTILS_FILE === 'undefined') PATH_TO_THE_REPO_PATH_UTILS_FILE = 'https://raw.githubusercontent.com/highfidelity/hifi_tests/master/tests/utils/branchUtils.js';
Script.include(PATH_TO_THE_REPO_PATH_UTILS_FILE);
var nitpick = createNitpick(Script.resolvePath('.'));

nitpick.enableAuto();

Script.include('./test.js?raw=true');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading