Skip to content

Commit

Permalink
added applyTransform
Browse files Browse the repository at this point in the history
simplified version of transformSequence.
see #1019
  • Loading branch information
t3kt committed Nov 1, 2023
1 parent 8b5f145 commit df9cd79
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/operators/filter/applyTransform.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
void THIS_transform(inout vec4 q, CoordT p, inout ContextT ctx) {
if (IS_FALSE(THIS_Enable)) return;
q = adaptAsVec4(inputOp_transform(THIS_asCoordT(q), ctx));
}

ReturnT thismap(CoordT p, ContextT ctx) {
if (IS_FALSE(THIS_Enable)) { return inputOp1(p, ctx); }
vec4 q;
ReturnT res;
APPLY_TO_TARGET();
return res;
}
Binary file added src/operators/filter/applyTransform.tox
Binary file not shown.
57 changes: 57 additions & 0 deletions src/operators/filter/applyTransform.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
!rop
meta: !meta
opType: raytk.operators.filter.applyTransform
opVersion: '0'
opStatus: beta
opDef: !def
enable: !expr
expr: op('..').par.Enable
useRuntimeBypass: true
typeSpec: !ropTypes
coordType: !coordT
Allcoordtype: true
contextType: !contextT
Allcontexttype: true
returnType: !returnT
Allreturntype: true
function: !text
file: src/operators/filter/applyTransform.glsl
name: function
displayCategory: Transform
inputs:
- !input
Variables: '*'
Variableinputs: '*'
Required: true
coordType: !coordT
Allcoordtype: true
contextType: !contextT
Allcontexttype: !expr
expr: op('targetInfo')[1, 'contextType'] == '*'
Contexttypematerialcontext: !expr
expr: op('targetInfo')[1, 'contextType'] == 'MaterialContext'
returnType: !returnT
Allreturntype: !expr
expr: op('targetInfo')[1, 'returnType'] == '*'
Returntypesdf: !expr
expr: op('targetInfo')[1, 'returnType'] == 'Sdf'
Returntypevec4: !expr
expr: op('targetInfo')[1, 'returnType'] == 'vec4'
- !input
Localalias: transform
Variables: '*'
Required: true
coordType: !coordT
Allcoordtype: true
contextType: !contextT
Allcontexttype: true
returnType: !returnT
Returntypevec4: true
elements:
- !opElement
name: transformTarget
elementType: transformTarget
params:
Targetparam: Target
Applyfunction: THIS_transform
Bodycodeplaceholder: APPLY_TO_TARGET();
Binary file modified src/operators/filter/index.tox
Binary file not shown.
Binary file modified src/operators/filter/transformSequence.tox
Binary file not shown.
1 change: 1 addition & 0 deletions src/operators/filter/transformSequence.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ opDef: !def
evaluate: true
evalOpts: !evalOpts
excludeFirstRow: true
keywords: apply
displayCategory: Transform
multiInput: !multiInput
Minimuminputs: 1
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit df9cd79

Please sign in to comment.