Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NODES] A custom scriptable GLSL effect #692

Open
unfa opened this issue Mar 26, 2019 · 10 comments
Open

[NODES] A custom scriptable GLSL effect #692

unfa opened this issue Mar 26, 2019 · 10 comments
Labels
Medium Priority Nodes/Compositing Usage of nodes for compositing

Comments

@unfa
Copy link
Contributor

unfa commented Mar 26, 2019

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
Copy link
Contributor

alcomposer commented Mar 26, 2019

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.

  • effect.frag
  • effect.vert
  • effect.xml

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
Copy link
Contributor

alcomposer commented Mar 26, 2019

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
Copy link
Contributor Author

unfa commented Mar 26, 2019

Thanks a lot!

@alcomposer
Copy link
Contributor

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
Copy link
Contributor

cgvirus commented Mar 26, 2019

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
Copy link
Contributor

cgvirus commented Mar 28, 2019

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

@frink
Copy link

frink commented Apr 1, 2019

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

@itsmattkc itsmattkc added Medium Priority Nodes/Compositing Usage of nodes for compositing labels Sep 13, 2020
@itsmattkc itsmattkc changed the title [FR] A custom scriptable GLSL effect [NODES] A custom scriptable GLSL effect Sep 13, 2020
@cgvirus
Copy link
Contributor

cgvirus commented Oct 3, 2020

@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
Copy link
Contributor

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
Copy link
Contributor

cgvirus commented Oct 3, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Medium Priority Nodes/Compositing Usage of nodes for compositing
Projects
None yet
Development

No branches or pull requests

5 participants