Skip to content

Commit

Permalink
Fix exposeValue and mark as beta
Browse files Browse the repository at this point in the history
close #499
  • Loading branch information
t3kt committed Dec 29, 2021
1 parent 5ab8789 commit dc84da3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/operators/utility/exposeValue.glsl
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
bool THIS_check(ReturnT res, ContextT ctx) {
if (getStage() != THIS_RENDER_STAGE) return false;
#if defined(THIS_Onlyonsurfacehit) && defined(THIS_RETURN_TYPE_Sdf)
if (isNonHitSdf(res)) return false;
#ifdef RAYTK_SURF_DIST
// Not sure why this needs to be multiplied by 2, so this may be incorrect.
if (res.x > RAYTK_SURF_DIST * 2.) return false;
#else
if (res.x > 0.) return false;
#endif
#endif
return true;
}
Expand All @@ -10,7 +15,7 @@ ReturnT thismap(CoordT p, ContextT ctx) {
ReturnT res = inputOp1(p, ctx);
if (THIS_check(res, ctx)) {
#ifdef THIS_HAS_INPUT_valueField
inputOp2_ReturnT valRes = inputOp_valueField(p, ctx);
inputOp_valueField_ReturnT valRes = inputOp_valueField(p, ctx);
#else
ReturnT valRes = res;
#endif
Expand All @@ -21,8 +26,8 @@ ReturnT thismap(CoordT p, ContextT ctx) {
}
#elif defined(THIS_Valuesource_fieldvalue)
{
#if defined(THIS_RETURN_TYPE_vec4) || defined(THIS_RETURN_TYPE_float)
val = adaptAsVec4(res);
#if defined(inputOp_valueField_ReturnT) || defined(inputOp_valueField_ReturnT)
val = adaptAsVec4(valRes);
#else
#error fieldValueNotSupportedForReturnType
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/operators/utility/exposeValue.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"meta": {
"opStatus": "alpha",
"opStatus": "beta",
"opType": "raytk.operators.utility.exposeValue",
"opVersion": 2
"opVersion": 3
}
}
Binary file modified src/operators/utility/exposeValue.tox
Binary file not shown.
Binary file modified tests/testCases/operators/utility/exposeValue_test.tox
Binary file not shown.

0 comments on commit dc84da3

Please sign in to comment.