-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
restructuring the code for customRender
see #1220
- Loading branch information
Showing
7 changed files
with
38 additions
and
65 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
void main() { | ||
#ifdef RAYTK_HAS_INIT | ||
init(); | ||
#endif | ||
initOutputs(); | ||
|
||
vec2 resolution = uTDOutputInfo.res.zw; | ||
vec2 fragCoord = vUV.st;//*resolution; | ||
fragCoord.x *= uTDOutputInfo.res.z/uTDOutputInfo.res.w; | ||
vec2 p = fragCoord*2. - vec2(1.); | ||
|
||
pushStage(RAYTK_STAGE_PRIMARY); | ||
|
||
Context ctx = createDefaultContext(); | ||
|
||
customMain(fragCoord, p, ctx); | ||
} |
25 changes: 0 additions & 25 deletions
25
src/operators/output/customRender_defaultBodyTemplate.glsl
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
void customMain(vec2 fragCoord, vec2 p, Context ctx) { | ||
vec4 res1 = fillToVec4(thismap(p, ctx)); | ||
#ifdef OUTPUT_COLOR | ||
colorOut = TDOutputSwizzle(res1); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
ReturnT thismap(CoordT p, ContextT ctx) { | ||
return inputOp1(p, ctx); | ||
ReturnT res; | ||
initDefVal(res); | ||
#ifdef THIS_HAS_INPUT_1 | ||
res = inputOp1(p, ctx); | ||
#endif | ||
return res; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters