Shader on sprite not recognising sampler2d

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By YuleTide

I have been trying to add a sampler2d to my shader for a 2d sprite as per this documentation

which suggests it is valid but I get the error

error(3): Expected Datatype

here is the code

shader_type canvas_item;

uniform sampler2d NOISE_PATTERN;

void fragment(){

}

if I use something like int instead of sampler2d the int changes colour and is recongnised as a valid type byt sampler2d is not. Can anyone explain why this would be the case?

Did you try sampler2D (note, the capital D)?

jgodfrey | 2022-07-13 21:53

Thank you, my second embarrasing question posted here!

YuleTide | 2022-07-14 07:39

:bust_in_silhouette: Reply From: USBashka

The name of datatype is sampler2D with the capital D (as jgodfray says)

Thank you, managed to make a fool of myself with this question, thank you for your answer

YuleTide | 2022-07-14 07:39