Snow shader (and a cool tool) here!

Home Forums AR Sandbox Forum Snow shader (and a cool tool) here!

This topic contains 22 replies, has 11 voices, and was last updated by  ptokheim 3 months, 2 weeks ago.

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #101408

    INTPTT
    Participant

    I figured I’d share what we created so others could benefit. Modified the “Blue” line from the “SurfaceAddWaterColor” file to make a very appealing snow. We’re working on making it flow more “snow-like” and had success with the -ws variable, but it affects everything so we’re leaving it as it for now.

    You can download our Water, Lava and Snow shaders, as well as the shell scripts that call them, from this link. (Also included is our script that runs at boot to start the whole collection and make it go full screen. See tool used below..) Feel free to do what you’d like with them all, YMMV, use at your own risk, blah blah blah. Proper credit is always appreciated though. =)

    The swap between water/lava/snow can be done live and completely on-the-fly. We’ve mapped F1 to water, F2 to lava and F3 to snow using a shell script (included in the download above) and a nifty tool called xdotool. Basically, we link the mentioned F-num key using the integrated Keyboard Shortcuts in Linux Mint through xdotool to the corresponding shell script. It’s a thing of beauty!

    Now if we could only get that pesky toggle of pause topology to link to a key. (Very Verbose mode doesn’t even show what is happening. Oliver – any insight?)

    #101411

    billberet
    Participant

    Great Find, I’ll give it a try. I was looking for a way to simulate keyboard combo’s.
    your fullscreen script is just what I have, my only missing item was #Go Fullscreen
    🙂
    now I am complete, lol

    • This reply was modified 1 year, 11 months ago by  billberet.
    • This reply was modified 1 year, 11 months ago by  billberet.
    • This reply was modified 1 year, 11 months ago by  billberet.
    • This reply was modified 1 year, 11 months ago by  billberet.
    #101418

    INTPTT
    Participant

    Super simple and straight forward install of xdotools. Perfect solution for it too.

    • This reply was modified 1 year, 11 months ago by  INTPTT.
    #101430

    billberet
    Participant

    I tried your script they worked great, I can change from water snow and lava.
    I had a hard time making xdotool
    It kept failing (something about missing xtest), maybe I’m missing the prerequisites. What did you install for the prerequisites?

    so since I couldn’t do the MAKE, I did ‘apt install xdotool’
    I know it’s an old version but it works in the command line, the console goes full screen when I type the command.
    But when I put the command in the start script it doesn’t run.
    I tried different pause settings, still no luck. I think the console is going fullscreen, not the sandbox.
    cause when I close the sandbox, the console shows fullscreen before it closes

    any help you can provide is great!! I appreciate your time helping me.

    • This reply was modified 1 year, 11 months ago by  billberet.
    • This reply was modified 1 year, 11 months ago by  billberet.
    • This reply was modified 1 year, 11 months ago by  billberet.
    #101443

    Oliver Kreylos
    Moderator

    Please try the built-in way to make the Sandbox start in full-screen and let me know if that works.

    If SARndbox is the only Vrui application you use regularly, edit Vrui.cfg in ~/Vrui-3.1/etc, and find “section Window” inside “section Desktop”. Then change windowFullscreen false to windowFullscreen true.

    To do this on demand, create a new file, say Fullscreen.cfg, inside ~/Vrui-3.1/etc/, with the following contents:

    section Vrui
      section Desktop
        section Window
          windowFullscreen true
        endsection
      endsection
    endsection

    Then start SARndbox with the additional -mergeConfig Fullscreen.cfg command line parameter.

    Pausing topography updates via a button: This is a source code-level change, but it’s simple.

    In Sandbox.h, insert the line

    virtual void eventCallback(EventID eventId,Vrui::InputDevice::ButtonCallbackData* cbData);

    after the line

    virtual void display(GLContextData& contextData) const; (line 189)

    and save.

    In Sandbox.cpp, insert the line

    addEventTool("Pause Updates",0,0);

    after the line

    LocalWaterTool::initClass(*Vrui::getToolManager()); (line 436)

    Then insert the lines

    void Sandbox::eventCallback(Vrui::Application::EventID eventId,Vrui::InputDevice::ButtonCallbackData* cbData)
      {
      if(cbData->newButtonState)
        {
        pauseUpdates=!pauseUpdates;
        }
      }

    before line

    void Sandbox::initContext(GLContextData& contextData) const (line 1147)

    and save. Re-make the SARndbox application, and now you can bind an arbitrary button or key to the new “Pause Updates” tool. The same toggle button in the main menu will no longer reflect the current pause state, but oh well.

    #101444

    INTPTT
    Participant

    Fantastic information Oliver, thank you. We were following directions somewhere which said to use the keyboard shortcut, which worked great. Guess it depends on your distro. Linux Mint has been playing very nicely!

    QUESTION: In Sandbox.h, it appears the “replace this with this” information is the same. Could you confirm what you mean for us to put on line 189? Thank you.

    • This reply was modified 1 year, 11 months ago by  INTPTT.
    #101446

    Oliver Kreylos
    Moderator

    One reason I recommend Mate is that keyboard shortcuts work as expected. The other reason is that Mate doesn’t try to be smart, and just does what it’s told.

    I fixed the instructions above.

    #101447

    Jensen
    Participant

    are you putting a ./ infront of the script name?

    i would try putting the script in your home directory as well, then in the startup applications menu, in the command section put ./name-of-your-script.sh

    also might want to open up the script a text editor and make shure its directory tree matches yours.

    each line of the script is like a separate command in the terminal, after a little tweaking, im sure you can make it work, and even make it work better! 🙂 good luck

    #101448

    billberet
    Participant

    Thanks Oliver, Jensen!!!!
    i’ll be adding the fullscreen config as Oliver stated above.
    I have the lava,snow,water working thanks to Intptt.

    everything is coming along nicely now.
    thank god we have a strong community here, doing this on my own would be stressful.

    is there a way we can program kids to keep the sand IN the sandbox, that stuff is not cheap, lol !!!!!!

    #101453

    billberet
    Participant

    changes made, full screen start works perfectly.

    #101459

    INTPTT
    Participant

    Awesome on all counts. Jensen is who did most of the programming/tweaking on the one I posted.

    Oliver, we like your method of topology toggle better and will likely give it a go instead. (And we’ll be adding toxic waste too! Green button here we come…) I did hear back from Dave over at USBButtons.com and the cost isn’t as bad as I expected.

    We’ll be sure to share whatever we do. Greatly appreciate all the help!

    #102126

    Reik
    Participant

    Hi,

    Do I put al the files (.fs and .sh) in the share folder? Or do I have to put the .fs files somewhere else?

    Grt,
    Reik

    #102128

    BrooksideTechTeam
    Participant

    Great work guys! I added the scripts to the shader folder in the SARnbox folder, but I do not know where to put the .sh files and make them run withing the SARnbox program. I have no idea how to use the custom keyboard shortcuts tool either, so I’ve tried using the Mint shortcut program but had no luck. The fullscreen script did not work for me either since I’m running a different version of the software. If you guys could help me out, that’d be great! Thanks!

    #102713

    techsupport
    Participant

    Hello to everyone, can anyone please, (please !), explain from scratch how to put it all together (included the xdotool)? I’m new in linux and this is really cool but hard to understand for a Linux newbie (like me), a video like the one from Oliver installing linux would be fantastic.
    Thanks !

    #102826

    Kuma
    Participant

    Can anyone explain the steps of xdotool installation and using xdotool to create shortcut key for the shaders?

Viewing 15 posts - 1 through 15 (of 23 total)

You must be logged in to reply to this topic.

Comments are closed.