Skip to content

Commit

Permalink
Test and fix isosurface/volume test (#236)
Browse files Browse the repository at this point in the history
* Fix isosurface test

* Fix isosurface material

* Fix hdri test

* Fix hdri direction test
  • Loading branch information
UX3D-haertl authored Oct 16, 2024
1 parent ed397f2 commit cacb2f9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
3 changes: 2 additions & 1 deletion cts/cts.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ def apply_to_scenes(func, anari_library, anari_device = None, anari_renderer = "
continue
else:
subtype = item["subtype"]
if anariObjectName == "geometry" and parsed_json["sceneParameters"]["geometrySubtype"] != None and subtype != parsed_json["sceneParameters"]["geometrySubtype"]:
if (anariObjectName == "geometry" and parsed_json["sceneParameters"]["geometrySubtype"] != None and
parsed_json["sceneParameters"]["geometrySubtype"] != "" and subtype != parsed_json["sceneParameters"]["geometrySubtype"]):
# If geometrySubtype is not the same as subtype ignore the generic anari object
continue
ctsType = ""
Expand Down
2 changes: 1 addition & 1 deletion cts/header/TextureGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class TextureGenerator
static std::vector<anari::math::float4> generateCheckerBoardNormalMap(
size_t resolution);

static std::vector<anari::math::float4> generateCheckerBoardHDR(
static std::vector<anari::math::float3> generateCheckerBoardHDR(
size_t resolution);

static anari::math::float3 convertColorToNormal(anari::math::float3 color);
Expand Down
6 changes: 3 additions & 3 deletions cts/src/TextureGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ std::vector<anari::math::float4> TextureGenerator::generateCheckerBoard(
return checkerBoard;
}

std::vector<anari::math::float4> TextureGenerator::generateCheckerBoardHDR(size_t resolution)
std::vector<anari::math::float3> TextureGenerator::generateCheckerBoardHDR(size_t resolution)
{
PrimitiveGenerator generator(0);
size_t counter = 0;
std::vector<anari::math::float4> checkerBoard(resolution * resolution);
std::vector<anari::math::float3> checkerBoard(resolution * resolution);
for (size_t i = 0; i < 8; ++i) {
size_t offset = resolution * i * resolution / 8;
if (i % 2 == 0) {
Expand All @@ -57,7 +57,7 @@ std::vector<anari::math::float4> TextureGenerator::generateCheckerBoardHDR(size_
for (size_t x = 0; x < resolution / 8; ++x) {
for (size_t y = 0; y < resolution / 8; ++y) {
checkerBoard[y + j * resolution / 8 + x * resolution + offset] =
anari::math::float4(color, 1.0f);
color;
}
}
++counter;
Expand Down
6 changes: 6 additions & 0 deletions cts/test_scenes/geometry/isosurface/isosurface.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
{
"subtype": "structuredRegular"
}
],
"material": [
{
"subtype": "matte",
"color": "color"
}
]
}
},
Expand Down
4 changes: 2 additions & 2 deletions cts/test_scenes/light/hdri.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
null,
[
0.0,
0.0,
-1.0
-1.0,
0.0
]
],
"/anari_objects/light/0/scale": [
Expand Down

0 comments on commit cacb2f9

Please sign in to comment.