DBraun / TouchDesigner_Shared

TouchDesigner toxes and small projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compilation error in Boids with modern TD version

drmbt opened this issue · comments

I've updated Cd to Color and that fixes the material, but can't seem to figure out the issue with sop_to_gradient_sdf_voxels

ERROR: /project1/Boids/sop_to_gradient_sdf_voxels/phong1GLSLPixel:129: 'mTD2DImageOutputs' : undeclared identifier

any tips to get that working in current TD stable?

I think that error can be ignored for now, as long as you see output in /project1/Boids/sop_to_gradient_sdf_voxels/renderselect1

Quoting from the wiki:

In the Render TOP you can allocate extra image outputs that can be accessed during rendering. These outputs are arbitrarily sized images that can be written and read from at any location (similar to the Compute shader workflow for the GLSL TOP), using imageStore() and imageLoad(). The images will automatically be declared for you inside of the shader, you should not declare them yourself (as you do for other uniforms). This is because there is a lot of extra decoration required for the image uniforms. Currently when compiling in the GLSL MAT itself your code will result in an error, since the images are not available there. However when you apply your MAT to a geometry and render it via the Render TOP, a new version of your shader will be included that has that image declared.

@drmbt are you sure you're able to bring the birds back by changing Cd to Color? I've resolved these errors and still no output.

I'm on 2023.11600

@mickeyvanolst yea that's what I'm observing too in 2023.11340. The MAT is compiling fine but I still don't see any birds.

Also, for those who want to use a new FBX file, I had to go to /project1/Boids/fbx_cached/MakeDeformCacheTexture/MakeDeformCacheTexture and update the function def initBonesMatChannels(self): so that it locks the BONES_MAT:

	def initBonesMatChannels(self):
		self.BONES_MAT = op('BONES_MAT')
		self.CAPT_PATH = op('CAPT_PATH')
		self.CAPT_DATA = op('CAPT_DATA')

		self.BONES_MAT.clear()
		self.BONES_MAT.lock = True  # <--- add this

		for i in range(1, self.CAPT_PATH.numRows):
                # rest of code omitted.

Then it's ok to unlock /project1/Boids/fbx_cached/MakeDeformCacheTexture/null1

thanks for taking a look @DBraun

Yes seems like the latest TD has some quirks :-/ also the error indicated atm due to imageWrite/imageLoad seems to be something they just didn't fix yet, even though the code works.

Hey, was a workaround ever found? I replaced all Cd occurrences in the code with Color but i'm still seeing zero boids

I haven't checked recently. I see there are recent changes to https://github.com/satoruhiga/TouchDesigner-ShaderBuilder which was used to create a starting point for the MAT. Maybe some of the recent changes in the past ~2 years could fix it?