Skip to content

Commit

Permalink
Ray caster also has ambient color and radiance
Browse files Browse the repository at this point in the history
  • Loading branch information
szellmann committed May 5, 2024
1 parent fab4b64 commit ce9b1b2
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
54 changes: 54 additions & 0 deletions VisionarayDeviceQueries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,54 @@ static const void * ANARI_RENDERER_raycast_heatMapScale_info(ANARIDataType param
default: return nullptr;
}
}
static const void * ANARI_RENDERER_raycast_ambientColor_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) {
(void)paramType;
switch(infoName) {
case 0: // required
if(infoType == ANARI_BOOL) {
return &anari_false;
} else {
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32_VEC3 && infoType == ANARI_FLOAT32_VEC3) {
static const float default_value[3] = {1.000000f, 1.000000f, 1.000000f};
return default_value;
} else {
return nullptr;
}
case 4: // description
{
static const char *description = "ambient light color (RGB)";
return description;
}
default: return nullptr;
}
}
static const void * ANARI_RENDERER_raycast_ambientRadiance_info(ANARIDataType paramType, int infoName, ANARIDataType infoType) {
(void)paramType;
switch(infoName) {
case 0: // required
if(infoType == ANARI_BOOL) {
return &anari_false;
} else {
return nullptr;
}
case 1: // default
if(paramType == ANARI_FLOAT32 && infoType == ANARI_FLOAT32) {
static const float default_value[1] = {0.200000f};
return default_value;
} else {
return nullptr;
}
case 4: // description
{
static const char *description = "ambient light intensity";
return description;
}
default: return nullptr;
}
}
static const void * ANARI_RENDERER_raycast_param_info(const char *paramName, ANARIDataType paramType, int infoName, ANARIDataType infoType) {
switch(param_hash(paramName)) {
case 61:
Expand All @@ -642,6 +690,10 @@ static const void * ANARI_RENDERER_raycast_param_info(const char *paramName, ANA
return ANARI_RENDERER_raycast_heatMapEnabled_info(paramType, infoName, infoType);
case 40:
return ANARI_RENDERER_raycast_heatMapScale_info(paramType, infoName, infoType);
case 2:
return ANARI_RENDERER_raycast_ambientColor_info(paramType, infoName, infoType);
case 3:
return ANARI_RENDERER_raycast_ambientRadiance_info(paramType, infoName, infoType);
default:
return nullptr;
}
Expand Down Expand Up @@ -10539,6 +10591,8 @@ static const void * ANARI_RENDERER_raycast_info(int infoName, ANARIDataType info
{"mode", ANARI_STRING},
{"heatMapEnabled", ANARI_BOOL},
{"heatMapScale", ANARI_FLOAT32},
{"ambientColor", ANARI_FLOAT32_VEC3},
{"ambientRadiance", ANARI_FLOAT32},
{0, ANARI_UNKNOWN}
};
return parameters;
Expand Down
22 changes: 22 additions & 0 deletions visionaray_device.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,28 @@
"tags": [],
"default": 0.1,
"description": "heat map scaling factor"
},
{
"name": "ambientColor",
"types": [
"ANARI_FLOAT32_VEC3"
],
"tags": [],
"default": [
1.0,
1.0,
1.0
],
"description": "ambient light color (RGB)"
},
{
"name": "ambientRadiance",
"types": [
"ANARI_FLOAT32"
],
"tags": [],
"default": 0.2,
"description": "ambient light intensity"
}
]
}
Expand Down

0 comments on commit ce9b1b2

Please sign in to comment.