Page 1 of 1

[Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 19:58
by Sires
Recently a friend from a server said that a good thing to minetest 0.5 would be to add glsl shaders by CSM, says him(I say that because I got near no idea how that stuff works, I just played a bit tweaking some values in the builtin shaders) that this would be easy since the shaders are only strings.
The functions suggested would be:
minetest.add_shader(here goes the glsl code)
minetest.add_value_to_shader(name, a var with the value)
and any other function related to making it work

I tried learning a lil bit about shaders and I see that combined with the fact that servers will be able to send CSMs to the client this could make some really interesting mods and using code kludges we could get even further, by example: maybe we want to make an "energy" flow passing from a block to another, I guess that the shader could detect this energy node and change its model to look like an energy flow. Thx by reading

/me starts imaginanting an acid trip shader in minetest, woah what a weird thing

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 20:02
by rubenwardy
Shaders will never be added to CSM, however server-sent shaders or client-provided shaders may be added

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 20:50
by Sires
rubenwardy wrote:Shaders will never be added to CSM, however server-sent shaders or client-provided shaders may be added

Would it be possible to use the value from the minetest world in the shaders? such as metadata(when allowed) or nodedef or other things?

Also, is there any issue open about that? Or even pull request

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 21:02
by sofar
There was some work by RBA to add node shaders (essentially sending shaders through lua to clients). This PR I believe is still around, so you could work off of that.

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 21:13
by Sires
Right now I'm scrolling in the 16 pages related to shaders.... maybe I could add a tag to filter by author lol
Edit: Can't find rba...
Edit2: Nvm I didn't realize who RBA was

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Fri Mar 23, 2018 21:32
by Sires
I think is found it: https://github.com/minetest/minetest/pull/3391
Is it this one? Also my c++ skills are terrible and I have no idea how minetest structure works
Also it's ~3 years old, later I'll see what I can do.

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Sun Apr 08, 2018 19:39
by Wuzzy
There was some work by RBA to add node shaders (essentially sending shaders through lua to clients). This PR I believe is still around, so you could work off of that.

If this trend continues, soon Minetest will be nothing but Lua. ;-)

Re: [Request for 0.5 or whatever version :)] Shaders in CSM?

PostPosted: Sun Apr 08, 2018 22:01
by Sires
Wuzzy wrote:
There was some work by RBA to add node shaders (essentially sending shaders through lua to clients). This PR I believe is still around, so you could work off of that.

If this trend continues, soon Minetest will be nothing but Lua. ;-)

What can I do? I'm not interested in c++ right now
It would take way too much time learning c++ and minetest's structure
My only hope is guess someone do it instead of me