-
Notifications
You must be signed in to change notification settings - Fork 264
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
Feature Request: Slidable Values! #13
Comments
Hehe. I thought about implementing it when I saw the video. I'll have to do a proof of concept ;) |
There is this directly from him: Maybe it could be usable, not sure how much it would interfere with existing code highlighter. |
ohoh... i'm so distracted from work and tempted to implement this right now! (#'_') |
Okay, here's a poof of concept for the slider UI element!! It supports floats and integers. Mouse over the numbers then mouse move over the ballon slider.
I believe Codemirror already tokenize keywords and place them in divs. Now someone just need to place the ballons above the numbers =D |
here's my attempt an integration with codemirror in a glslsandbox branch. click on a number, the the slider would appear above it. i'm calling it a day, perhaps you might have a better way of integrating this :-) |
i fixed the parsing in glsl.js mode to take in a live link is at http://jabtunes.com/labs/graphics/glslslider/ |
That's a great start @zz85! Couple of comments:
Anyway I'm excited to see where this goes! |
great feedback, @emackey!
updated in git and http://jabtunes.com/labs/graphics/glslslider/ |
Hi @zz85, When you get a chance, pull the updates to the numberslider branch from my repo... emackey/glsl-sandbox@jfontan:master...emackey:numberslider I've done a few things. First I made it so you really have to click on the number to get the slider, because otherwise, values could change when just mousing around the screen. So you have to click to turn on the slider, and click again to accept the result, otherwise it will cancel out. Next, I made it so when the slider activates, it compiles your shader with a special hidden uniform in place of the constant you clicked. As you move the slider, the hidden uniform changes values interactively, without recompiling the shader. When you accept the new value, it removes the uniform and turns it back into the new constant. There are a couple remaining bugs I wonder if you could look at. Floating point numbers don't need to exist on both sides of the decimal point. Floats like "1." and ".5" are common in GLSL Sandbox, but they don't get properly recognized and they don't produce sliders. Also, single-digit integers also don't get recognized, although two-digit integers work fine. Also I'm having a Ruby issue, but I sent @jfontan a separate email about that one. Keep up the great work! |
Wow, that's awesome. One very minor nit though: the newly added static/js/numberslider.js doesn't end with a new-line, which will confuse some text-editors. |
@emackey you did the compiled uniform! very cool! :D i briefly tried the new behavior. i think that should be fine, i probably need to play more esp. with keyboard combinations to see if behavior is optimal. i'm still fiddling with the regex and token parsing to get that working. its a little nasty not having them to work as intended >.< |
patched the single integer, and the 'shorthand' floats. added bubble canceling behavior on keypress too. |
@emackey however, seems like number parsing is still causing a little frustrations
will have to look into it when i get a little more time :( |
spent some time today trying to tweak the number parsing. trying to modify the way the tokens are parsed in codemirror has been too painful, and i've attempted a new method. basically, from a click, search forward and backwards from the cursor to find where a potential number is. this would hopefully support hard to parse numbers, like
somehow i might have introduce some strange bugs - it requires double clicks at times to activate the slider :< its feels really close to a really usable and useful feature but at the same time i'm almost on the verge of giving up. maybe an extra eye could help... |
My home machine is having HD problems, so it will be a few days before I can look at this again, but it would be great to get it working someday. |
sure... perhaps its a good time to get a solid state harddisk too :) |
I would vote for something along the lines of http://vimeo.com/36579366 (skip to 4:10 but watch the entire thing if you have the time!)
=D
The text was updated successfully, but these errors were encountered: