I see many example in shadertoy use texture
, but in the cocos2d-x, only texture2d
.
Does texture
use normalized coordinate and texture2d
doesn't?
Because when I use texture2d
, it returns wrong result.
texture2D
is the same as texture
, but it's used in the older versions of glsl.
Between glsl 120 and 130 they changed the function to texture
and made it accept every kind of samplers, not just a sampler2D
.
There's no difference between them, so the problem is probably in your code.
texture
), but when i apply it to the node, it renders wrong. And i realize that if i change the parameter for texture2d
as pixel coordinate - normalized coordinate, it works. You can see the question here: gamedev.stackexchange.com/questions/138333/…
\$\endgroup\$
Commented
Mar 9, 2017 at 7:28