I am totally new to shaders and have been banging my head for several hours now. I followed the documentation from Corona, found some examples and even managed to create a simple image with shader.
My nightmare, however, started when I decided to use this specific shader ( which I found in another topic ) : https://goo.gl/kpaqiK
When I follow the tutorials from Corona to implement this shader I get a black rectangle and nothing happens in the simulator.
I suspect you just need to supply the CoronaVertexUserData fields. See here for info on that. Right now those will just be getting some default (or garbage, possibly), so you’ll wind up with something like 0 / 0 for the invAr and uv fields (maybe not even that, depending on the graphics driver).
In the shader playground, you can see up top where these are set. Just use those values (1 and 1) as your defaults. You don’t even need to change them from the calling code if you like the results.
Thank you for the answer, it really worked! I had problems with other shaders from the forum, as well, but most probably the issue was the same - I was missing the CoronaVertexUserData fields. I hope I’ll get better with these and be able to contribute with my own custom shaders soon.
I suspect you just need to supply the CoronaVertexUserData fields. See here for info on that. Right now those will just be getting some default (or garbage, possibly), so you’ll wind up with something like 0 / 0 for the invAr and uv fields (maybe not even that, depending on the graphics driver).
In the shader playground, you can see up top where these are set. Just use those values (1 and 1) as your defaults. You don’t even need to change them from the calling code if you like the results.
Thank you for the answer, it really worked! I had problems with other shaders from the forum, as well, but most probably the issue was the same - I was missing the CoronaVertexUserData fields. I hope I’ll get better with these and be able to contribute with my own custom shaders soon.