I wanted to try some shader effect, and even if I understood something by tinkering with already working shaders, I still don't get how to do some pretty basic stuff:
Since I managed to color moving relative portions of the screen at my pleasure, I was trying to draw a more "detailed" thing like a grid.
And here I noticed how much I miss having a print function to see what happens there:
My idea was that I could basically draw a black pixel when its x or y coordinate was even, but it seems that my condition is never triggered, and I guess that the issue is that fTexCoord.x and .y are relative values that go from 0 to 1, not "real" pixel coordinates.. but at the same time I think that I should have got at least a weird output instead of the source image..
function (vVertex,vColor,vTexCoord) : Shader
local vertex = hF4(vVertex,0.0,1.0)
function () : Shader
local frag=lF4(fColor)*texture2D(fTexture, fTexCoord)
if fTexCoord.x%2.0 ==0 or fTexCoord.y%2.0 == 0 then --when x/2 is even
frag.rgb=lF3(0.0,0.0,0.0) --this changes the pixel color
frag.rgb=lF3(frag.r,frag.g,frag.b) --this leaves the original pixel color
if (frag.a==0.0) then discard() end --discard transparent pixels