olive-editor / olive

Free open-source non-linear video editor
https://olivevideoeditor.org/
GNU General Public License v3.0
8.22k stars 556 forks source link

[NODES] A custom scriptable GLSL effect #692

Open unfa opened 5 years ago

unfa commented 5 years ago

I thought I'd be nice to have a "Custom" video effect that'd expose an editable shader text that the user could experiment with seeing immediate visual effects. It could be great for also exchanging effects on forums or prototyping effects for Olive.

Providing a basic "no-op" template would be also nice.

What do you think?

alcomposer commented 5 years ago

This usability is partly already in Olive. You would need to make an XML file pointing to your shader code. There are examples in: olive/effects/shaders.

If you are not wanting to change anything from the vert simply use the xml to point to common.vert. (as many effects are simply fragment shaders).

At this point if a user had a custom effect (an effect.frag & effect.xml- using common.vert in Olive) it would be easy to share that online, as Olive updates the list each time it runs.

Only thing that doesn't exist is an editor. But considering how many good GLSL editors are out there (and even in the browser) is this really needed? Obviously Olive could enable editing of Shaders in a TextEditor panel. But I don't know if it would make it any easier to create shaders.

alcomposer commented 5 years ago

Here is an example of sharing a GLSL Olive effect, un-zip it and place both files in the effects/shaders directory. Then start Olive, no need to do anything else. The effect will be in the Render section of effects.

I used the HSB Wheel shader found at: https://thebookofshaders.com/06/

wheel_test.zip

unfa commented 5 years ago

Thanks a lot!

alcomposer commented 5 years ago

However there would be one reason to have a basic text editor in Olive, due to the internal use of scene referred values, the output of shaders could be different. However a user could edit shaders while Olive is running, and update the shader in Olive when the code has changed.

cgvirus commented 5 years ago

AWESOME! Finally an editor that can save the world! This is going to be one of the most advance editor in near future. Thanks @alcomposer and @unfa for the heads up!

cgvirus commented 5 years ago

Just made a pull request for some glitch effect. Let's see how things go! I love this app.

frink commented 5 years ago

Is this a dupe of: #586 ? At the very least it's closely related.

cgvirus commented 4 years ago

@itsmattkc Hi, I was investigating the current pipeline of node creation in 0.2 yesterday and it seems we now need to compile nodes within C. Will the previous pipeline going to be integrated? Thanks.

itsmattkc commented 4 years ago

Not exactly. The point of nodes is that (when there are more of them implemented), effects can be wholly constructed in-app. For easy sharing, node chains created in Olive can simply be copied and pasted to/from text (which you can experiment with now). Finally, there will be a GLSL shader node as described in this issue if you need to write shader code, which will obviously be included when copying/pasting nodes to/from text.

cgvirus commented 4 years ago

This is super nice! Just tested copy pasting. Excited to see the GLSL node soon! Thanks!