Hi there,
I'm having difficulty sampling from a 3d texture...
I've made a simple shader:
- Texture Object Node with Auto-Cast Mode set to "Locked To Texture 3D"
- World Position Node
- Texture Sampler Node. The Tex input is connected to the Tex output of the Texture Object, and the UV input is connected to the XYZ output of the World Position Node.
- RGBA output of the sampler is connected to the albedo channel of the surface shader.
When I try to compile this shader, I get the error:
Unable to cast from SAMPLER3D to SAMPLER2D. You might want to use a Texture Sample node and connect it to the 'Tex' port. Generating dummy data ( 0 )
And of course the shader doesn't work... If I look in the generated code, on the Tex3d line, instead of the sampler, there's a "0" (I'm guessing the dummy data), and if I replace that for the sampler (_Texture0"), it works fine.
Looking at the code where the error message is raised and backtracking, it seems the sampler node only accepts 2d textures, which seems weird (unless there's a texture sampler node for 3d somewhere I can't find)...
I've attached the shader in case it helps, and I'm running version 1.5.3_dev01
Can you help?
Thanks
Filipe
Sampling from 3d textures doesn't seem to work
-
Filipe Caseirito
- Posts: 4
- Joined: Mon May 14, 2018 3:33 pm
Sampling from 3d textures doesn't seem to work
- Attachments
-
- Test.zip
- (1.19 KiB) Downloaded 883 times
-
Filipe Caseirito
- Posts: 4
- Joined: Mon May 14, 2018 3:33 pm
Re: Sampling from 3d textures doesn't seem to work
Ah, forgot to mention, this is using Unity 2017.4.2f2
Filipe
Filipe
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Sampling from 3d textures doesn't seem to work
Hello Filipe, thank you for getting in touch and for reporting this issue.
I've just confirmed it on my side and have forwarded it to the developers for further investigation, I'll be sure to let you know as soon as we have any developments, thanks!
I've just confirmed it on my side and have forwarded it to the developers for further investigation, I'll be sure to let you know as soon as we have any developments, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
-
Filipe Caseirito
- Posts: 4
- Joined: Mon May 14, 2018 3:33 pm
Re: Sampling from 3d textures doesn't seem to work
Hi there!
Is there an ETA for this?
Best regards,
Filipe
Is there an ETA for this?
Best regards,
Filipe
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Sampling from 3d textures doesn't seem to work
Hey there! The issue is still under investigation by our developers, I'll be sure to let you know as a reply to this post as soon as they have any new developments regarding it.
Apologies for any inconvenience caused!
Apologies for any inconvenience caused!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Sampling from 3d textures doesn't seem to work
Hello Filipe, thank you for your patience!
We've just release a new version, currently available for download through our website, in which we've corrected the issue you've reported.
Please let us know if you come across any further issues, thanks!
We've just release a new version, currently available for download through our website, in which we've corrected the issue you've reported.
Please let us know if you come across any further issues, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
-
Filipe Caseirito
- Posts: 4
- Joined: Mon May 14, 2018 3:33 pm
Re: Sampling from 3d textures doesn't seem to work
Hi!
It seems the problem is fixed! Thanks!
Filipe
It seems the problem is fixed! Thanks!
Filipe
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Sampling from 3d textures doesn't seem to work
No problem, glad to be of assistance!
Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback. Every bit helps, your feedback is extremely valuable to us!
Feel free to get back in touch if you have further issues or questions, thanks!
Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback. Every bit helps, your feedback is extremely valuable to us!
Feel free to get back in touch if you have further issues or questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!