I have no experience in low level programming, so I cant make own Shader because the documentation is very poor. (Needed the simplest blur effect on sprite)
Ive read about GLSL shaders, but in the Gideros shader documentation there are some things I cant find in Google.
Heres the documentation example:
local shader=Shader.new("vShader","fShader",0,
{
{name="vMatrix",type=Shader.CMATRIX,sys=Shader.SYS_WVP,vertex=true},
{name="fTexelSize",type=Shader.CFLOAT4,vertex=false},
{name="fRad",type=Shader.CINT,vertex=false},
},
{
{name="vVertex",type=Shader.DFLOAT,mult=3,slot=0,offset=0},
{name="vColor",type=Shader.DUBYTE,mult=4,slot=1,offset=0},
{name="vTexCoord",type=Shader.DFLOAT,mult=2,slot=2,offset=0},
});
vertex shader: (string) The path and name for the vertex shader without its extension
fragment shader: (string) The path and name for the fragment shader without its extension
flags: (number) A set of numerical flags or 0 if none
uniform descriptor: (table) An array of uniforms/constants descriptors
attribute descriptor: (table) An array of attributes descriptors |
Now the questions: what means
uniform descriptor and
attribute descriptor, didnt found in Google and no info in documentation at all. How do they should be set, and for what those params are responsible.
uniform descriptor:
{name="vMatrix",type=Shader.CMATRIX,sys=Shader.SYS_WVP,vertex=true}, |
name, type, sys, vertex - what they are do and what for ?
attribute descriptor:
{name="vVertex",type=Shader.DFLOAT,mult=3,slot=0,offset=0}, |
what does this params do ? and what for ?
Also I cant understand how many and wich descriptor table indexes are required to shader work properly ?
I ready to
pay for Skype lesson, better if it would be on Russian or with Russian speaker, because its not to easy for me undderstand such hard stuff on english. Please help me rise my skill !
Comments
http://giderosmobile.com/forum/discussion/6682/radial-blur-effect-class#Item_1
It has been acknowledged that there needs to be better documentation for shaders. Hopefully that will happen soon
http://hieroglyphe.net/gideros/Writing shaders for Gideros Mobile.pdf
By Master hgy29
In http://giderosmobile.com/forum/discussion/6137/vignette-shader/p1 thread
Enjoy your journey!
Likes: hgy29, pie, SinisterSoft
It depends on what you want to achieve, you actually can use it on your sprite directly, but bear in mind that in that case it won't affect children of the sprite (shader is applied to the sprite itself only).
That's why I used a rendertarget to first capture the whole sprite hierarchy then blur it.
Can you try your shader on Shape - gives me very glitchy result if Filled by one color, and no blur if filled with texture. (Works fine only if I use RT)
P.S. If shape has setLine style Gideros Player drops windows error. Next code wil produce error in v. 2016.10
Blur shader expects a texture and texture coordinates, and can be used in Bitmap, Pixel, some forms of Mesh and probably TileMap. It ought to work with Shape only if they are textured with no outline, and even in that case I am not sure that Shape sprite supplies the SYS_TEXTUREINFO values (which can be fixed).
Does this help understanding ?