Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit aaef9b2

Browse files
Fix of rayDirection calculation
1 parent 9ed2318 commit aaef9b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎targets/touchDesigner.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ void main()
5252
// and Dual-Paraboloid rendering to work properly
5353
TDCheckDiscard();
5454
55-
// Raymarching
56-
vec3 rayOrigin = worldPos.xyz-sculptureCenter;
57-
vec3 rayDirection = getRayDirection();
55+
vec3 camPos = uTDMats[iVert.cameraIndex].camInverse[3].xyz;
56+
57+
// Raymarching
58+
vec3 rayOrigin = iVert.worldSpacePos.xyz - sculptureCenter;
59+
vec3 rayDirection = normalize(iVert.worldSpacePos.xyz-camPos);
5860
rayOrigin -= rayDirection*2.0;
5961
float t = intersect(rayOrigin, rayDirection, stepSize);
6062
depthTexture = t;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /