When I introduced a new variable that’s passed from my intersection program to my shading programm, OptiX started throwing an error: Attribute “attributename” is referenced in a hit program but is not produced in attached intersection program".
I’ve declared the new variable for both programs, made sure that they are attributes and that the spelling of their attribute names is identical. Still I’m getting this message.
Because I thought this was fishy, I removed the new variable and checked what happened when I changed the name of an existing, previously working, attribute variable. I changed it both in the intersection program where it is set and in the shading program where it is read. Again, I get the same error.
I’ve regenerated the build folder in an attempt to force the compilers to get all files up to date. Still I get the same error.
It’s as if I’m stuck with an existing set of attribute variables, without the power to change or add them. That can’t be right.
What could I be missing here?
For the terminology below, rtDeclareVariable uses the arguments (, , attribute , );
The attributes are associated by the type and the user defined semantic only!
Means attribute names inside the intersection, closest hit, and any hit programs don’t need to match but for readability it’s recommended to do that.
I’ve not seen a problem with individually defined attribute variables so far if the type and semantic matched.
Without complete code I would guess you either have not renamed all occurrences of that attribute semantic (inside intersection, anyhit, and closesthit) or didn’t load all updated PTX files. (Latter should have been solved by your rebuild.)
When reporting issues please always specify at least the following system information:
OS version, installed GPU(s), display driver version, OptiX versions (major.minor.micro), CUDA toolkit version used to compile the PTX code.
By searching for the semantic throughout my whole solution instead of project, I found that my project was using a rogue intersection program from outside of my project.
This intersection program of course did not provide my new attributes, producing the error.
Thanks for your help, Detlef.