Git Product home page Git Product logo

twigl's Issues

High-resolution screenshot exporting

Would it be possible to get an image export button (perhaps under the dropdown menu in "Download") for exporting high-resolution screenshots? JPEG or PNG (which would be preferable). It could use the same resolution dialogue as with the GIFs and WebM, where you can type in any value you need (ideally up to 8k or so).

That would be perfect for my needs and would help a lot. If I'm dreaming big, I'd also ask for transparency on PNGs and a slider for time so that you can choose exactly when you want to take the screenshot. But I can totally understand if this is beyond the scope of the project. Just the ability to capture screenshots at any resolution will be more than enough.

Thanks!

Backbuffer is set to GL_NEAREST

This makes it impossible to do fluid sim, reaction diffusion.
Linear or mipmap would be a good option I think, maybe even setting to default Linear/mipmap.

Idea for saving a link to a long script

If the code is over 1200 symbols, it's not saving to bitly. I guess due to limitations of bitly. In this case undefined is saved to a clipboard.

What if go without bitly in this case? If the link can't be shortened, let's save it in full length, often it's not a problem.

Or maybe there's a sort of workaroud I'm not aware of?

Just yesterday we had a live coding session in our club and we had to code-golf to have the code saved :-)

Lygia support

Hi! Would you be interested on bringing support for lygia.xyz?

Using include macros like

#include "lygia/math/const.glsl"
#include "lygia/color/space.glsl"

it will help users to keep their code extra short.

There is several ways to full fill those dependencies, the easiest is through this functions that just fetch them for you https://lygia.xyz/resolve.js

You code editor can even autocomplete their functions using this request https://lygia.xyz/glsl.json

Defining functions in geekest mode

Hi there, this is a great project! I like the "geekest" mode, where you have a few extra helpers and definitions like snoise2D() available, and don't need to write the main() definition. However, this means you can't create/use helper functions. Since the calling code just wraps the main() definition before and adds a closing brace afterwards, it is actually possible to define functions after, like this (which compiles fine under geekest 300 es):

vec2 uv = (FC.xy - 0.5*r) / r.y * 1.;
for (int i = 0; i < 8; ++i) {
  uv = abs(uv) / dot(uv, uv) - 0.7 + sin(t*0.75) * 0.2;
  uv += snoise3D(vec3(uv * 0.2, 0.01*t)) * 0.25;
}
o.xyz = (1. - vec3(pow(length(uv), 0.25))) * hsv(sin(uv.x*PI + t),1.,1.) * 2.;
} // end of main()

float test(float x) {
  return x * 2.;
// Note: no closing brace because it's provided by the wrapper!

However, you can't call test(), because it's not declared before main(). Besides #define macros, is there no "hack" to allow you to define and call functions in geekest mode? Otherwise, could the helper methods (and FC) be also exposed in geeker mode? Basically, what I'd like would be a "geekest" mode that allows you to write the main() definition. Maybe the code could check if it finds a void main() in the code, and if so, doesn't wrap it.

Upgrade to WebGL 2

This one does not support bitwise operators and for(;i<70.;i++) loops.

Live coding suggestions

Thanks again for this project! Last night I used Twigl to to perform visuals, live coding from-scratch to accompany music in eight different mini-sessions (nine minutes each)... I usually use my own live coding environment, but it was a pleasure to work within the minimalism of Twigl. The only thing I really missed was some audio reactivity.

I think it's good if Twigl stays quite minimal (though of course, this is up to you). But I can think of a few things that might be interesting, to use it in a live coding (visuals) context:

  • support live audio reactivity. Doesn't need to be full set of frequency bins or a texture, or even three (high/mid/low) frequencies...even just a single volume uniform would be nice. With optional smoothing/filtering would be nice. I assume one can get the mic input from the browser?
  • (alternative solution) allow a way to send arbitrary values to Twigl, to be available as uniforms. Then, an external program (e.g. SuperCollider) could send audio info, or MIDI slider info, perhaps via OSC or something.
  • optionally allow the clock/time to continue even after recompilation of the shader, so it doesn't always reset back to zero. (With a button to reset it when desired).
  • optionally a scaling factor on the clock time, so you can adjust it to match musical tempo (approximately). The clock should continue forward as you adjust tempo (not just implemented in the shader as t * speedScale), so you can stop or slow down time (again, an added bonus would be to be able to set this time scale from an external place, e.g. using OSC).
  • a few more key shortcuts, e.g. one to toggle on and off the code display (a shortcut for the existing button).

I'm not saying these should be implemented, but I thought I'd mention these as things that would make it more useful for live coding visuals (for performance). But as I say, a big part of Twigl's attraction to me is its minimalism, so maybe adding too much would ruin that, and make things unnecessarily complicated. Sometimes simpler tools are better. And having constraints is good for creativity... (-;

beforeunloadでリロード事故を防ぎたい

コードを書いている途中にいつもの癖でCtrl+Rを押してしまうのですが、これをするとコードが失われてしまいます。
この挙動を beforeunload で防ぎたいです。

beforeunload は一箇所使われてはいますが、これはライブを視聴中の場合のコードでしょうか?
普通にコードを書いているときは発動しません。

window.addEventListener('beforeunload', (evt) => {

上のコードを加味すると、おそらく「コードが一度でも編集されたとき」または「配信を視聴中」に事故リロードを防ぎたそうですね。

Amazing. How to publish tweet?

Just want to say, this is awesome.

Curious as to how to publish from twigl.app to Twitter?

Or do people generate a link, download a gif, and publish manually?

Maybe we can add a button to one-click publish to Twitter.

[Feature request] GLSL code formatting feature

I like to look at the twigl code on Twitter.
However, much of that code is obfuscated to keep it short.
How about a formatting feature to make the obfuscated code easier to read?

I think js-beautify can be used to format the code.
https://github.com/beautify-web/js-beautify

The following is an implementation image.

before:
image

after:
image

I think js-beautify can be called as follows.

<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify-css.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.13.13/beautify-html.js"></script>
beautify.addEventListener('click', () => {
    const opts = {
        indent_size: 4
    };
    editor.setValue(js_beautify(editor.getValue(), opts));
}, false);

doc: what are o0, o1, b1 ? ( and more )

compare to what I see in some demos, the doc ( readme here ) doesn't seem to be complete ! ;-)
E.g. what are o0 and o1 ?
What is b1 ? ( sounds like binding, but I don't see texture binding info in the app ).

Also, I see most people not initializing variables. Is the environment safely doing it, or will this break shaders on some systems as it does on Shadertoy ?

thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.