Shaders?

Started by wizard_wizzle (aka ZeldaHistorian), August 27, 2015, 11:57:20 PM

Previous topic - Next topic
Is there any information about what's currently available in the engine concerning shaders? I believe there was an experimental implementation, but I'm not sure if it was ever completed/tested/documented? If I can help in any way, I'm happy to do so!

I need to implement more advanced lighting in my game, and I'm getting to the point where I can't put it off much longer and need to come up with something. I would require multiple light points in an otherwise dark room, and thought shaders would be the only way to manage this. If anyone knows of another way, I would love to hear ideas! :)

I am looking forwards to seeing the feedback. I have some need of this also.


I have another idea to use multiple light points, only using Lua. But it could slow down a bit the game (and it will be much worse than using a shader). We could script this in one Lua file, doing as follows:

First, we create a main transparent surface, with the size of the screen/window. Then, for each pixel of the screen, we can create a surface of 1x1 pixels size and draw it in the main surface. We can use a list as a matrix to store all the "pixel surfaces". The rest of the code would be some functions to modify the transparence on each pixel surface (to make it more or less transparent, also modify the color, etc). This would allow to have torches iluminating some parts of dark rooms, and also to have several lights which are moving. This is just the overall idea.

Anyway, as I say, maybe this would be a bit of brute force that could slow down the game (too many surfaces?), although I'm not sure of this.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."

320 * 240 = 76800 surfaces, this would be terribly slow.
There will be a function set_pixel one day to modify a surface, for example to make a pixel transparent.

I was so curious that I tried the brute force idea. Only creating the surfaces makes the game impossible to play (terribly slow, no game is possible, as we thought), and drawing the pixel-surfaces just makes it even worse...  :'(

No hope until Christopho allows pixel modification in the engine.
"If you make people think they're thinking, they'll love you. But if you really make them think, they'll hate you."