Ok, time to have some more fun with gideros: GIDEROS LUA SHADERS
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
So my goal has become to "code" a shader to have the outline of my character
Please
don't help me yet.
Relax cafe category
Comments
It works with lua already (but only in docking branch )
https://github.com/MultiPain/Gideros_ImGui/blob/952ddd90a3cb54b8bdc4b3b793d2ad303025c6bb/main.cpp#L10346
So, I can give it a try.
Likes: MoKaLux, hgy29, luyimoon
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?
Likes: MoKaLux
I have this old outline shader made by great mister rrraptor
This is my attempt but gideros doesn't like it and throws errors:
I tried to understand the other shaders as an example but I couldn't wrap my head around those, somebody please help meLikes: SinisterSoft
hgy29 you are so kind to us, I knew it since day 1 but this shader thing, you gave everything to make our lifes simpler. I trully respect the LOVE you put in gideros and its users (us). So thank you, thank you, thank you.
After starting afresh I realised I had everything at my disposal in the gideros samples
So I picked the shader example and it was using the same logic as previous gideros (which I was more used to) with minor tweaks. And, to my surprise, I had clear explanations of what was not working!!! (hgy29 super kindness in action):
1st attempt:
FragmentShader:
0(28) : error C0000: syntax error, unexpected '~', expecting ',' or ')' at token "~"
0(34) : error C1503: undefined variable "original"
0(36) : error C0000: syntax error, unexpected '}' at token "}"
2nd attempt:
FragmentShader:
0(28) : error C7011: implicit cast from "float" to "bool"
0(28) : error C1020: invalid operands to "=="
And the working result:
I wish you all the best, a special thought for our friend Oleg and his people, and my best wishes to you Nicolas (alias hgy29)
PS: this outline shader is the work of genius mister RRRAPTOR, THANK YOU!
Viva Gideros Luau, Peace &
Likes: SinisterSoft
Likes: SinisterSoft
Likes: MoKaLux, talis, hito9
There are those values
Can somebody point me in the right direction? Thank you for your help
3DShaders.lua
EDIT: https://wiki.gideros.rocks/index.php/Shader:setConstant
Likes: pie
Likes: MoKaLux
round round(x) Returns a value equal to the nearest integer to x.
https://wiki.gideros.rocks/index.php/Lua_Shader_Common_Functions
Some functions seem not implemented?
I tried with this code:
I tried with math.round but not working
Is there a work around please?
EDIT: looking into luashader.lua
Shaders have floor() and ceil(), so trunc(n)=floor(n) if n is positive or ceil(n) otherwise.
round(n) is same as floor(n+0.5) for n positive and ceil(n+0.5) for n negative.
But you can add bindings for trunc and floor in luashader.lua, for all three languages (GLSL,HLSL and MSL)
Likes: MoKaLux
https://godotshaders.com/shader/color-reduction-and-dither/#comment-1927
Gideros:
I think I got this cc0 one working as expected?
https://godotshaders.com/shader/256-colour-pixelation/
Gideros:
Viva Gideros