Get textureSize in a shader

Hi!

Is there a way to get the textureSize in a shader?

Did you try this: https://www.opengl.org/sdk/docs/man/html/textureSize.xhtml
Did it not work?

I always pass the texture size as shader constants, but that’s just because I did not know about textureSize, which I found when googling based on your post. So thanks! :smile:

No, I can’t get it to work. :smile:

I saw your link and also checked this out
https://www.khronos.org/opengles/sdk/docs/man31/html/textureSize.xhtml

What version of opengl is it that Defold is using?

I am a super beginner when it comes to shaders so I could easily do it wrong! An example would be a big help if you have one :slight_smile: