Introduction-to-touchdesigner icon indicating copy to clipboard operation
Introduction-to-touchdesigner copied to clipboard

GLSL - Error in TD 099 while solving particle system

Open jetXS opened this issue 7 years ago • 0 comments

In TD 099, during section 12.7.2, The following snippet cause errors:

// move point from object space to screen space and output to gl_Position
vec4 worldSpaceVert = TDDeform(newPosition);
vec4 camSpaceVert = uTDMat.cam * worldSpaceVert;
gl_Position = TDCamToProj(camSpaceVert);

TD 099 doesn't use uTDMat.cam anymore. it needs to be replaced by uTDMats[0].cam, as we have an array of cameras in TD 099. However, solving that is not enough, TDCamToProj() doesn't exist anymore.

What did the trick for me was to use:

gl_Position = TDWorldToProj(TDDeform(newPosition));

jetXS avatar Jan 25 '18 06:01 jetXS