New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Real Time Mandelbulb

2»

Comments

  • w23w23 Posts: 9
    I had a thought the other day about optimising the rendering of these ray marchers.
    ...

    For my VR Jam game I used kind of a "deferred raymarching":
    1) Only 256x256 rays are traced, not one per every of 1280x800 pixels (although for my game contents it would be possible)
    2) And only a half (or so I remember, it is a variable) of them gets updated every frame.
    Ray intersections coordinates and color get stored into point cloud and then rendered as GL_POINTS.
    This way I'm able to run the game on a rather cut version of GeForce 220 that I have at my workplace with not very comfortable but rather playable fps of 20 and up.

    There's also a huge room for speeding things up. First thing that I would optimize out is float textures that I used for simplicity and that are not actually required at all.
    My very short VR Jam entry: Abrupt End
  • LindblumLindblum Posts: 127
    The Boxplorer demos are great! Most of them ran with painful framerates though, so I had to lower the iteration counts by altering the default.cfg files.
  • obzenobzen Posts: 713
    Nexus 6
    I started making progress on a C++ ShaderToy viewer.

    It's a bit crummy (a basic C++ app), but here goes.

    What I'm missing atm is the eye IPD (getting my matrices in a twist), and modding the each shaders' rays computation to match the free-roaming camera (only Leizex and Volcanic are done atm). It's a pretty trivial process most of the time.
    DK1 FREAK...Ntbt8Ya.gif
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Here's another take on a Rift Shadertoy: https://github.com/jimbo00000/RiftRay

    There are resolution and FOV adjustments to control framerates, Hydra and gamepad controls.

    Remember: If you plan to distribute any other user's shaders, please make sure there's clear credits, not only in the source code but somewhere in the app as well. For instance, in RiftRay I'm repackaging the beautiful work of:

    gltracy
    Kali
    iq
    David Hoskins
    eiffie
    ESpitz
    mu6k
    fb39ca4
    Reinder Nijhoff
    mattz
    srtuss
    Rrrola
    BoyC
    WAHa_06x36
  • unphasableunphasable Posts: 12
    This is great. I've been making fractals all week with Mandelbulb. Cant wait till my dk2 arrives so I can port them to DK2. I've settled with scooting back and crossing my eyes for now to get a stereoscopic effect
  • PeelingPeeling Posts: 77
    Out of curiosity: why do people talk about crossing their eyes to look at rift content? I always 'look through' the screen to get the correct image in front of each eye...
  • FluffyFreakFluffyFreak Posts: 22
    Brain Burst
    Yeah the crossing the eyes thing I do not understand.
    Or do you mean that you don't have any dev kit yet so you're having to do that?
  • PeelingPeeling Posts: 77
    Yeah the crossing the eyes thing I do not understand.
    Or do you mean that you don't have any dev kit yet so you're having to do that?
    No: that's what I'm talking about. To see rift content in 3d without a rift you look 'through' the screen; if you go cross-eyed your eyes are looking at the wrong images.
  • WormSlayerWormSlayer Posts: 50
    Hiro Protagonist
    Sorry to necro this thread, but I can haz DK2 fractals? :D
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Here you go - https://github.com/jimbo00000/RiftRay/releases/tag/2.0

    Tap once after (the rather lengthy) app start to dismiss the HSW and recenter your view. Then just look and tap to choose a shader, tap again to return. Hydra and gamepad work as well.

    Watch out, the ones with motion get pretty intense!
  • opampopamp Posts: 326
    Hiro Protagonist
    Unfortunatley the adaptive scaling seems a bit extreme for me as soon as I tap into the first scene the screen percentage drops to down to about 30%. Think Ill have ago at removing this feature and compiling myself.

    What I could make from the Gallery and the lego bricks afterwards looks very cool though.
    DK2. Phenom 2 x4 4.2GHz,Asrock Extreme 3 970,8GB DDR3 1600, R9 270x 1180/1400.
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Have a look at the DynamicallyScaleFBO() function, at line 102 in main_include.cpp: https://github.com/jimbo00000/RiftRay/blob/master/src/main_include.cpp

    There's a clause there to drop resolution to minimum if the instantaneous frame rate ever drops below 45(i.e. a frame takes more than 1/45 of a second to render). This does often get tripped on a change in program or bound texture as things get cached up the first time around. You could try a less dramatic drop in resolution or just delete the clause entirely - the design philosophy was that anything is better than dropping frames.
  • CubicleNinjasCubicleNinjas Posts: 200
    Art3mis
    I was hoping someone would make this. Thank you!

    After downloading it though...honestly, I can't even figure out how to run it. Is it PC only? :oops:

    You should definitely release on share. This sort of thing would be very popular for first time VR demo uses.
  • TsarpfTsarpf Posts: 2
    NerveGear
    I tried to build the library myself, but fighting with the dependencies bored me out before I managed to get them all in there. Any hope you could add a switch or something to disable the automatic resolution dropping? Or set a minimum? The resolution it drops to is pretty over(under?)kill, since you cannot make anything out of that soup.

    I might try again with the libraries tomorrow if I remember though.
  • TsarpfTsarpf Posts: 2
    NerveGear
    Ha! Got it working. Copypasted way too many absolute pathes here and here though :D

    But oh man, this is what I got the rift for. I wanted to see what my own shadertoys looked like with it. Nice library, cheers!
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    This is really cool, but how do non-Programmers fix the SUPER-low resolution issue? I've been toughing it out at what appears to be 320x200 resolution. I would love to see it at something higher.
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    I've added a couple of features in the latest release to address that: https://github.com/jimbo00000/RiftRay/releases/tag/2.0.2

    First, I've adjusted the target frame rate to just under the DK2's display rate to yield better results with VSync on. Second, dynamic FBO scaling can be turned off by editing the included RiftRay.cfg file, or by editing the FBO size manually with the F5-F8 keys a la jherico's Shadertoy VR: http://www.reddit.com/r/oculus/comments/2q0ard/new_build_of_shadertoy_vr/. Adjusting cinemascope factor with page up/page down is also an option.

    Give the new build a try with the dynamic scaling on(default with included .cfg file), and if it still looks too blurry, hit F8 a few times. At that point you'll be in manual, so be ready to hit F5 when you start dropping frames.
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    Amazing stuff! Will it automatically grab new shaders off the website, or is it just the ones you've hand picked?

    As for the Dynamic resolution, that doesn't work very well. On my Radeon card it always dumps down to SUPER-LOW, or what I imagine is the lowest setting it absolutely can. Bumping it up in rez does not effect the framerate at all, at least in the menus, so I have to imagine it's one of those Anti-Radeon bugs that seem to plague so much Rift demos. I'm guessing GeForce handles OpenGL, or whatever's being used in these demos, better then Radeon. Usually forcing it to use DirectX is the solution to get around alot of these bugs. I didn't even know there were words on those menu images until you added the forced increase to the resolution.

    But the controls for resolution and screen cropping are working great. I think Oculus would prefer to have simpler controls for demos, so this might not get you on the main page, but I found it no problem with tweak and mess with. And the shaders look AMAZING! Almost all of them work perfectly. There are 2 or 3 that aren't responding to positional tracking. One of them was that landscape with the snake-like growths coming out of it. I can't recall what the others were.

    Also, all of the joystick input seems to be off. I've been trying to control it with an Xbox controller and it seems like the button layout is scrambled.

    I can't help but to wonder though. The performance from Boxplorer was far better at full resolution (at least on the DK1). Well this Shader website collection is really cool, I think it's more aimed for real-time editing for websites, and lacks the full performance possible if it was more dedicated to handling fractals. Your time might be better spent getting Boxplorer up and running with the DK2 and developing some kind of interpreter for the Shaders to make them work with it. I'm not too sure what's involved behind-the-scenes, so that's just a suggestion.
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Hi Max, thanks for the detailed feedback!
    Amazing stuff! Will it automatically grab new shaders off the website, or is it just the ones you've hand picked?
    Shaders are hand-picked and manually ported. There is a small HOWTO doc on this in the repo: https://github.com/jimbo00000/RiftRay/blob/master/doc/ShaderPorting.md
    As for the Dynamic resolution, that doesn't work very well. On my Radeon card it always dumps down to SUPER-LOW, or what I imagine is the lowest setting it absolutely can. Bumping it up in rez does not effect the framerate at all, at least in the menus, so I have to imagine it's one of those Anti-Radeon bugs that seem to plague so much Rift demos. I'm guessing GeForce handles OpenGL, or whatever's being used in these demos, better then Radeon. Usually forcing it to use DirectX is the solution to get around alot of these bugs. I didn't even know there were words on those menu images until you added the forced increase to the resolution.
    FBO scaling appears to work as designed on my Radeon HD6670, except for some instability below 60 fps where the app seems to drop a frame every second or two, kicking the resolution way down to compensate. I'm not sure if it's AMD's OpenGL handling per se that's causing the problem, but switching to DX is not an option here. If you're inclined to try out different forced vsync settings in the Catalyst control panel, I'd be interested to hear if there's any difference. F9, F10 and F11 are supposed to toggle vsync from within the app, but I have found support for this to be hit-or-miss.
    But the controls for resolution and screen cropping are working great. I think Oculus would prefer to have simpler controls for demos, so this might not get you on the main page, but I found it no problem with tweak and mess with.
    I would love to hear your ideas for simpler controls. At one point I had the mouse wheel controlling resolution which was nice and easy. If you have any recommendations, I'll get them in there.
    There are 2 or 3 that aren't responding to positional tracking. One of them was that landscape with the snake-like growths coming out of it. I can't recall what the others were.
    Good eye on the positional tracking. Two notable shadertoys lacking it are terrain_tubes and voxel_edges, both of which have a headScale of >1. I will look into this.
    Also, all of the joystick input seems to be off. I've been trying to control it with an Xbox controller and it seems like the button layout is scrambled.
    You've convinced me. I finally broke down and ordered the Xbox controller. Expect an update in a few days.
    I can't help but to wonder though. The performance from Boxplorer was far better at full resolution (at least on the DK1). Well this Shader website collection is really cool, I think it's more aimed for real-time editing for websites, and lacks the full performance possible if it was more dedicated to handling fractals. Your time might be better spent getting Boxplorer up and running with the DK2 and developing some kind of interpreter for the Shaders to make them work with it. I'm not too sure what's involved behind-the-scenes, so that's just a suggestion.
    This is surprising - do you remember any specific shaders that were faster in Boxplorer? I wouldn't expect any significant differences in performance between the two apps as the vast majority of the work they're doing is in fragment shader and GPU-bound. The only way to get around this(that I know of) and increase fps is to render fewer pixels.

    Also consider that the DK1 demanded less than half the render bandwidth of the DK2 ([email protected] = 61MPx/sec, [email protected] = 155MPx/sec).
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    All of the Boxplorer demos except for the bug walking around seemed to run at 30 to 70+ FPS at full DK1 resolution. I know the DK1 is alot lower resolution then the DK2, but it was still higher then settings I'm comfortable with on this demo. The Reflectiods, running with full reflections, ran at faster, at a higher rez then your Reflectiods, without reflections. It actually ran so fast, I could barely believe my computer produces those images. Quite mind blowing! There were controls in Boxplorer for altering Reflectiod in real time, and the no matter how convoluted I managed to get the landscape, it always kept at least 40fps. A little choppy sometimes, but never unusably slow.

    As for the controls, the Xbox controller is utterly bristling with buttons, so any of those might do. I'd suggest throwing a cheat-sheet using the Start button so people always know what button does what.

    But I would suggest scrapping the automatic resolution changer, in favor of using the controller. Make a clear statement on the starting screen, maybe off to the side, that users can change the performance using the controller. Since the starting menu screen is the most important, and always runs well, definitely force it to run at a high starting resolution. Without the main menu, the whole experience becomes very difficult.

    Back to the subject of controls, a few of those fractal shaders can be easily altered by changing a few numbers, correct? How about allowing some facet of the controller to slide those numbers up and down, like Boxplorer allowed with Reflectiod? Real-time altering of fractals is AMAZING! If the users can alter just 2 or 3 parameters with a few button presses, I'm sure they'll spend hours seeing what kind of results they can get. I know I did!
  • RoryLaneLutterRoryLaneLutter Posts: 27
    Brain Burst
    > jimbo00000

    Thank you for that. That is one of the coolest things I've ever seen.
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    As for the controls, the Xbox controller is utterly bristling with buttons, so any of those might do. I'd suggest throwing a cheat-sheet using the Start button so people always know what button does what.

    But I would suggest scrapping the automatic resolution changer, in favor of using the controller. Make a clear statement on the starting screen, maybe off to the side, that users can change the performance using the controller. Since the starting menu screen is the most important, and always runs well, definitely force it to run at a high starting resolution. Without the main menu, the whole experience becomes very difficult.

    I just put up a new build with proper Xbox controller support: [2.0.3](https://github.com/jimbo00000/RiftRay/releases/tag/2.0.3) Cheat sheet is a good idea, I will get on that. If you haven't modified RiftRay.cfg, FBO scaling should default to full res. Come to think of it, a direct cfg file option might be nice there.
    All of the Boxplorer demos except for the bug walking around seemed to run at 30 to 70+ FPS at full DK1 resolution. I know the DK1 is alot lower resolution then the DK2, but it was still higher then settings I'm comfortable with on this demo. The Reflectiods, running with full reflections, ran at faster, at a higher rez then your Reflectiods, without reflections. It actually ran so fast, I could barely believe my computer produces those images. Quite mind blowing! There were controls in Boxplorer for altering Reflectiod in real time, and the no matter how convoluted I managed to get the landscape, it always kept at least 40fps. A little choppy sometimes, but never unusably slow.

    Back to the subject of controls, a few of those fractal shaders can be easily altered by changing a few numbers, correct? How about allowing some facet of the controller to slide those numbers up and down, like Boxplorer allowed with Reflectiod? Real-time altering of fractals is AMAZING! If the users can alter just 2 or 3 parameters with a few button presses, I'm sure they'll spend hours seeing what kind of results they can get. I know I did!

    This is... a really great idea. :D Stay tuned!
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Real-time altering of fractals is AMAZING!

    Got it working - you're right, it is pretty awesome :D



    Only a few variables are exposed in the included shaders, but if you have a text editor you can hack in as many as you'd like. Just add a uniform variable and a matching comment establishing the range and increment.

    Download here: https://github.com/jimbo00000/RiftRay/releases/tag/2.1
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    Cool, a new version!

    I like what I'm seeing, it's looking very polished. I do have an issue though with the Xbox controller layout though. Well your setup is inventive, I would recommend sticking to the industry standard. By using a standard layout you can insure people are able to instantly jump in and control your application with ease. It's hard to beat years of learned experience. ;)

    Here's an example from Guns Of Icarus:

    attachment.php?attachmentid=4222&d=1346153982

    As you can see, movement is handled by Left Joystick, well rotation, both left/right and up/down, are managed by the Right Joystick.

    More nuanced controls and interface are handled by the directional pad, since it's harder to access well using a 1st person shooter-grip. I would suggest moving the Screen resolution and Screen cropping to the Directional Pad. Use Right and Left for the resolution and up and down for the screen cropping. That should make instant sense to users.

    The XYAB should be used for other actions. Since the A and B buttons are usually used for Jump and Crouch, I'd suggest using the A for rising up, and B for lowering directly down. The X button is often used for selections and entering vehicles, so you might want to use that for controlling the TweakBar. In that manner, I think the Y button would work best for bringing up, and dismissing, the Tweakbar.

    Since the Start and Back buttons are considered to be very critical but not often used controls, I'd suggest using Start button for selecting a level *and* exiting a level. You could use the back button to bring up the Exit Application screen, with X being used, again, to select Yes or No.

    The Trigger buttons are good as they are. Their analog nature is good for controlling speed.

    Could one of the Shoulder Buttons be re-purposed to reset the screen orientation? That's a very critical function. I know it's in the Tweakbar, but it's so important, it should have it's own button.

    Also there's the matter of checking to see if the Xbox controller has been turned on *after* the program loads. Xbox controllers tend to timeout to save battery power, so it's not uncommon for people to activate them after a game or app has loaded. Can you check to see if the Xbox controller is present, even if it's not currently active?

    As far as adjusting the Resolution and Screen Cropping, it's best not to use Analog controls for those because it's the kind of function that's easiest to understand and control with stepped controls. You want to be able to carefully cycle though those settings, one button press at a time, and not too fast, as it's easy to overshoot the best setting for your machine. Using the joystick, I found it difficult to pinpoint that sweet spot. If you do switch those settings over to the directional pad, I'd suggest changing the settings one step for every directional pad press, instead of just allowing people to quickly cycle through those settings by holding down the button. Again it's just so easy to shoot right by the best settings.

    I love the Tweakbar, btw! It's always great to see floating controls in virtual space. It makes VR feel like an extension of the desktop, instead of shallow and video-gamey. One downside of the Tweakbar though is that the Cheatsheet can't be moved or dismissed. This means that alot of good desktop space is unavailable because of it. The Cheatsheet is great, but I'd suggest a button on the sheet to minimize it down to a little button that says "View Controls".

    Are sliders possible on the Tweakbar? I know you can use the that circle drag thing, that works ok. But sliders are more immediate and easier to visualize.

    The Animated Icon button works great! You should use that as a default, it's very helpful to understand what world I'm about to load up. The Perspective icon button though doesn't seem to work with most icons. I imagine it would be hard to tweak every button so the perspective works correctly. It might be a lost cause.

    It also looks like the shader Voxel Edges doesn't work with the Tweakbar. I think it's the scale involved. I love that shader and it's sense of scale, but it doesn't cooperate with the Tweakbar at all. It hurts my eyes to look at it.

    That's all of my thoughts on the latest build so far. I hope some of them are helpful. Thanks for all of your hard work!
  • jimbo00000jimbo00000 Posts: 55
    Hiro Protagonist
    Thanks again, Max. I was working off the much older standard of 1.2 Solitaire. :)

    Good ideas. I think I addressed just about all of them in the latest (2.1.1):https://github.com/jimbo00000/RiftRay/releases/tag/2.1.1

    Let me know how you like it!

    XboxControllerLayout.png
  • OculusOpticianOculusOptician Posts: 253
    Brain Burst
    Amazing to see how fractals have evolved since the Mandelbulb, the first 3D fractal was discovered in 2009. Fractals are a signature experience for the future of VR.

    Here's some fantastic sources of information regarding fractals if your thinking of developing in this direction:
    http://vimeo.com/juliushorsthuis/videos
    http://www.skytopia.com/project/fractal/mandelbulb.html
    http://mandelbulb.com/3d-fractal-art-mandelmorphs/
    http://www.newscientist.com/article/dn18171-the-mandelbulb-first-true-3d-image-of-famous-fractal.html#.VNnejy6WyUk

    TED Talk with Benoit Mandelbrot - The father of fractal geometry.
    https://www.youtube.com/watch?v=ay8OMOsf6AQ
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    This is REALLY nice! At this point, if you wanted to call it a day on this project and move on to something else, you could consider it a complete success. It's very user friendly and packed full of useful features.

    But... if you wanted to polish this diamond up even further, there are a couple of things you could do.

    #1. The virtual desktop for the interactive menus is a bit cramped. Having the regular menus and the tweak menus, along with the unmovable cheat sheet for the controls, means pushing around alot of menu screen to keep what you need visible. Is there anyway to expand that space?

    #2. Those circular dials you use to control values are cool, but is it possible to swap in slidebars? People are more familiar with them. Also, in my experience with them, I find using the circle adds a bit of neck cramps and nausea when used. Fast head movements to the side, especially when the background is moving in a certain direction, tends to induce motion sickness.

    #3. Back to the virtual desktop, is there someway to minimize the cheat sheet when it's not needed? Maybe clicking on it causes it to shrink down to 1/10th it's normal size, and clicking again causes it to expand.

    #4. I can see the cheat sheet is on a different wall then the menus, so what about bringing those two walls together and treating the cheat sheet like just another window? If nothing else, we could at least push the cheat sheet off the side edge of the screen when not needed.

    Anyways, these are just some minor tweaks that might help make the experience a bit more polished. It's still good as it is now. It even looks like Voxel Edges is cooperating with the menus now. There's so much to dive into viewing and tweaking. I just want to see more and more of these shaders. They are AMAZING! The fractal ones in particular, with their alien landscapes, are just mind blowing.


    On an unrelated note, if you ever feel inclined to make a dead-simple fractal explorer for the general public, there could be a big market for it. Something people could fly through in a little helicopter, or grapple hook and climb around. I don't know if you can generate collisions from just visual information, but imagine if you could control your body's scale, viewing the world from a giant down to a speck of dust. Walk through those hallways, climb those hills, dive into those chrome pools of mercury.

    And picture some more simplified, but more indepth "God Controls", for changing the world before you jump back in to explore it. Boxplorer allowed over half a dozen ways to modify Reflectiods alone, which created some AMAZING landscapes. Here's a video I made after one productive tweaking session:


    This video was all real-time generated, using little camera paths you could set in the program. Picture walking around in that, as either an ant or a titan.
  • MaxSMoke777MaxSMoke777 Posts: 86
    Hiro Protagonist
    This is also a video I generated from simply tweaking Reflectiods in Boxplorer. Imagine swinging your way around this landscape with two grappling hooks:



    More then a few people have broken the boundary of turning fractals from 2D objects, into 3D objects. But to my knowledge, nobody has yet figured out how to generate real-time collisions based on them. I think it's possible...

    If you think of the fractals as objects that reflect light, why not use that same information to reflect bodies? You don't generate a collision model for the entire structure at once, but instead generate collision for whatever is around the bodies you're tracking as they move, real-time. You only need to track what's immediately around each object, just a tiny bit of space, very low-rez information. The computer generates that collision as needed, discarding it as needed. So the player can see for miles, but unless they walk over that ground, or throw a rock at that hill, only the ground under their feet really exists. It's like Infinite Collision generation.
2»
Sign In or Register to comment.