Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE


MoKaLuxMoKaLux Member
edited November 2020 in Relax cafe
Ok, time to have some more fun with gideros: GIDEROS LUA SHADERS B)

I am playing around to see what I can understand from the gideros lua shader demo.

I have mixed two shaders wave + bloom and I see that I can get the outline of the character already :smile:

So my goal has become to "code" a shader to have the outline of my character :wink:

Please don't help me yet.

Relax cafe category

Likes: hgy29

my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
+1 -1 (+1 / -0 )Share on Facebook


  • MoKaLuxMoKaLux Member
    edited April 5
    still trying to understand shaders :#
    For normal shaders (glsl for example), I need 2 files: 1 for the vertex shader and 1 for the fragment shader. Then we pass them to Shader.new(...).

    For lua shaders, we must include (or link to) Gideros\Library\luashader files in our projects. Then we write our vertex shader and our fragment shader in lua. Then lua shaders calls Shader.new(...).

    Is that correct? I am trying to sort out shaders in the wiki :*

    PS: there is a typo in luashader.lua?
    function Shader.lua(vf,ff,opt,uniforms,attrs,varying,funcs,const,debug)
    	local lang=Shader.getShaderLanguage()
    	local mtd=Shader["lua_"..lang]
    	assert(mtd,"Language not supported: "..lang)
    	local _vshader,_fshader=mtd(vf,ff,opt,uniforms,attrs,varying,funcs or {},const)
    	if funcs then for _,fg in ipairs(funcs) do fg.code=nil end end
    	if debug then print("VSHADER_CODE:\n".._vshader) print("FSHADER_CODE:\n".._fshader) end
    	if not vdebug then return Shader.new(_vshader,_fshader,Shader.FLAG_FROM_CODE|opt,uniforms,attrs) end
    vdebug is never declared?
    my growING GIDEROS github repositories: https://github.com/mokalux?tab=repositories
  • hgy29hgy29 Maintainer
    Oops, a left-over of a debug. The whole condition should be removed.

    Likes: MoKaLux

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.