Hey guys, I am having a bit of an issue with a shader and wanted to see if anyone has found a way around this issue…
I have several array attribute, which I want to pass to a shader to do some operations. So far I have tried:
- just a straight up bind VOP to bring in the array attribute. Does not seem to work ):
- bring the array as a joined string, then split in the shader into a string array. Hacky, but could work. Works great on string arrays, but I cannot seem to find a way to convert strings to floats or ints for numerical arrays ):
So I am wondering if:
- anyone knows how to import array attributes into a shader?
- anyone knows of a way to convert strings to numericals?
- anyone knows of a way that I am not thinking of?
super thanks in advance if you can help me!
passing array attributes to a shader
2473 6 1- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- tamte
- Member
- 8449 posts
- Joined: July 2007
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
ok time to rephrase my question:
I want to pass N amounts of UVsets to the shader, and I want, on a per sample basis, pick which UVSet I am using. what I have noticed:
- Shading Layer Param does not allow you to use a variable or bound attribute to control the shading layer
- I cannot import array attributes
- I cannot use strings as they cannot be brought in by vertex since they cannot interpolate
has anyone ever brought in an arbitrary number of UVsets into a shader and switched which UVset a sample uses?
Alternatively:
- has anyone implemented a UV project from camera VOP node, similar to the UV Texture SOP? Unfortunately the UV Project VOP only does cylindrical, polar, and orto ):
my eternal thanks…
I want to pass N amounts of UVsets to the shader, and I want, on a per sample basis, pick which UVSet I am using. what I have noticed:
- Shading Layer Param does not allow you to use a variable or bound attribute to control the shading layer
- I cannot import array attributes
- I cannot use strings as they cannot be brought in by vertex since they cannot interpolate
has anyone ever brought in an arbitrary number of UVsets into a shader and switched which UVset a sample uses?
Alternatively:
- has anyone implemented a UV project from camera VOP node, similar to the UV Texture SOP? Unfortunately the UV Project VOP only does cylindrical, polar, and orto ):
my eternal thanks…
-G
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
ok found a way around the issue where I bring my cameras info in the shader as string arrays, then split them to calculate my projection UVs. Cool.. BUT…
now atof() does not seem to want to return my floats ): it either seems to return 0 or -1 when trying to pass my single split string off the array. Would love to be able to see why this is happening, but print does not seem to be printing anything to console either during a render…
now atof() does not seem to want to return my floats ): it either seems to return 0 or -1 when trying to pass my single split string off the array. Would love to be able to see why this is happening, but print does not seem to be printing anything to console either during a render…
-G
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
-
- Quick Links