Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation error in Boids with modern TD version #8

Open
drmbt opened this issue Jan 19, 2024 · 7 comments
Open

compilation error in Boids with modern TD version #8

drmbt opened this issue Jan 19, 2024 · 7 comments

Comments

@drmbt
Copy link

drmbt commented Jan 19, 2024

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?

@DBraun
Copy link
Owner

DBraun commented Jan 24, 2024

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.

@mickeyvanolst
Copy link

mickeyvanolst commented Mar 25, 2024

@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

@DBraun
Copy link
Owner

DBraun commented Apr 3, 2024

@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.

@DBraun
Copy link
Owner

DBraun commented Apr 3, 2024

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

@mickeyvanolst
Copy link

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.

@Max-Bax
Copy link

Max-Bax commented Jul 30, 2024

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

@DBraun
Copy link
Owner

DBraun commented Jul 31, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants