Logo by mario837 - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. April 18, 2024, 07:03:22 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: WebGL for hosting GLSL  (Read 17523 times)
0 Members and 1 Guest are viewing this topic.
willvarfar
Explorer
****
Posts: 57


« on: July 19, 2012, 01:28:55 AM »

Here's a little skeleton file for anyone who finds it useful: https://gist.github.com/3139606

To run it, just right-click save-as the "raw" link and then view the file locally.

Or put it on a web server!

Feel free to use, abuse, extend, fix, share!

Put your own fractals in there, make it navigable etc.  The mandelbulb is just coloured by ray-marching steps which is hardly pretty, sorry.

As the heavy lifting of ray marching etc can be done in the GLSL shaders, we only need the tiniest of shims to host it in the browser.

Think how much space fractalforums would save if all the shared images were actually computed when displayed? wink
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: July 19, 2012, 09:15:33 AM »

that would be indeed a nice feature, to not render em on the host, than on the client, but consider it is a fairly new technique that is hardly to be assumed to be able to be rendered by anyone, and additionally i personally would love to render mandelbulb3d params directly in the browser ( with the possibility to modify params right from the point ) but this seems to be a real hard task, but would offer real fast pacing modification of existing params, but as well suitable for stealing colors/views/params ( although if public they are public ) hardest thing would be to match the formulas with current versions of the programs...
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #2 on: July 19, 2012, 03:52:20 PM »

I also have a simple 2D Mandelbrot / Julia viewer here, which all are welcome to change into other - perhaps more interesting - systems:
http://hvidtfeldts.net/WebGL/webgl.html

Not overly complicated, but it does take care of anti-alias and camera/key navigation, and shows how to create some sliders.

I've also created a WebGL version with emulated double precision, but it needs some quite specific hardware (no ANGLE, no Nvidia), more info here:
http://blog.hvidtfeldts.net/index.php/2012/07/double-precision-in-opengl-and-webgl/
Logged
LhoghoNurbs
Safarist
******
Posts: 90



WWW
« Reply #3 on: July 19, 2012, 03:59:48 PM »

Oh, I get "WebGL not supported by your browser" ... in Opera, Firefox, IE, and Chrome. So this looks like an issue with the GPU and the graphic card being unable to support any shading (old integrated Intel graphics card in my case, nothing fancy down there in it, I admit).

[this is a placeholder of a sad fractal emoticon]

But I like the idea! It is somehow relevant to some conceptual design work I did an year before joining the FractalForums... I need to dig in my archive to get that work and post it here.
Logged
willvarfar
Explorer
****
Posts: 57


« Reply #4 on: July 19, 2012, 06:39:58 PM »

Syntopia, that is a beautiful little 2D fractal page; I hadn't seen that before.  Will you be moving Fragmentarium to webGL any time soon? (  angel )

Regards Intel GPUs:

Yeah I know Chrome refuses to support webGL on Intel cards and that FF can be dicey.

I have a laptop with integrated Intel graphics too, and its a sad story.  I can run this kind of stuff from the native apps but distributing them is a pain.  Chrome Native Client, likewise the browser in general, doesn't work.

Other:

I've hosted the code on github so those with supported browsers and GPUs can just go to http://williame.github.com/Mandel_1/

What's a good way to compute a proper proportional epsilon?

« Last Edit: July 19, 2012, 06:44:22 PM by willvarfar » Logged
marius
Fractal Lover
**
Posts: 206


« Reply #5 on: July 19, 2012, 08:06:31 PM »


What's a good way to compute a proper proportional epsilon?


epsilon being MinimumDistance? Think of it as of on-screen projected pixel error, so proportion along distance.

Code:
if (distance < MinimumDistance * totalDistance) break;
Logged
willvarfar
Explorer
****
Posts: 57


« Reply #6 on: July 19, 2012, 09:08:45 PM »

Yes, but I was wondering about how to calculate it?  I can imagine unprojecting the points 0,0,-1 an 1/w,1/h,-1 and then taking half the distance between them and multiply sqrt(0.5).  But is it quite ok to (wrongly) assume all rays equally long (so we compute it in vertex shader?

Maybe theres just a simple shortcut?
Logged
marius
Fractal Lover
**
Posts: 206


« Reply #7 on: July 19, 2012, 09:42:23 PM »

Yes, but I was wondering about how to calculate it?  I can imagine unprojecting the points 0,0,-1 an 1/w,1/h,-1 and then taking half the distance between them and multiply sqrt(0.5).  But is it quite ok to (wrongly) assume all rays equally long (so we compute it in vertex shader?

Maybe theres just a simple shortcut?

Note it is fixed for a given field-of-view and screen resolution, so it is barely relevant how hard / expensive it is to compute?
Lots of programs keep it as user-definable parameter ('detail'); for boxplorer2 I compute it, based on field-of-view and resolution.
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #8 on: July 19, 2012, 11:02:36 PM »

Syntopia, that is a beautiful little 2D fractal page; I hadn't seen that before.  Will you be moving Fragmentarium to webGL any time soon? (  angel )
Thanks.

I actually want to write a WebGL exporter for Fragmentarium, but my initial experiments were somewhat discouraging - the subtle differences between GLSL ES and Desktop GLSL makes it very tricky to automatically reuse code - especially loops are more restricted in WebGL. I also encountered a couple of errors in the ANGLE layer, that converts GLSL to HLSL on Windows (it should be said, that Google was quite quick to fix the one I reported).

But I think I'll do an exporter anyway, even though it probably will require manual post-editing to work.
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #9 on: July 20, 2012, 11:44:14 AM »

it would be great to have kalis "swimming fish" included in a webpage ... lol, perhaps i would even make some kind of fishing game out of it then wink
totally crazy moving things over your screen, and you have to shoot them, and they surely vary params wink
Logged

---

divide and conquer - iterate and rule - chaos is No random!
willvarfar
Explorer
****
Posts: 57


« Reply #10 on: July 20, 2012, 01:53:47 PM »

A few friends have said nothing shows for them; webGL is still early days but, within a half-year I think, will be widely supported and the most viable distribution platform for graphics software.

Yeah I struggle to use OpenGLES - complained before - but it seems you can do pretty much everything equiv, if you push past over bumps.

I have ideas for cone-marching on the GPU; will have to see how it helps or hinders performance...

Conventional wisdom from you experienced artisted wanted: What are the fastest types of 3D fractal to render and what are the fastest reasonable ways to colour and light them?
Logged
subblue
Conqueror
*******
Posts: 116



WWW
« Reply #11 on: July 20, 2012, 02:43:50 PM »

Willvarfar, I'm working on quite an in depth WebGL 3D fractal explorer 'Fractal Lab'.
I showed an alpha version at a conference talk I did a couple of months ago and
someone filmed a few minutes when I was demoing it:

<a href="http://www.youtube.com/v/xVnk_UV8hII&rel=1&fs=1&hd=1" target="_blank">http://www.youtube.com/v/xVnk_UV8hII&rel=1&fs=1&hd=1</a>

WebGL adds a whole layer of complications and restrictions, which is quite a headache with such a new implementation - especially when the GLSL shaders are pushing the limits of what most average graphics cards are capable of.
However, I have been getting some reasonable results directly in the browser, some of which you can see here: http://www.flickr.com/photos/subblue/

It's still a side project at the moment as I finish up another massive project, but I have big ambitions for it and am hoping to have a beta version ready reasonably soon....  wink
Logged

www.subblue.com - a blog exploring mathematical and generative graphics
A Noniem
Alien
***
Posts: 38


« Reply #12 on: July 23, 2012, 04:29:34 PM »

I did a little paper on WebGL once which was quite fun. I'm not really familiar with regular OpenGL, but I am with OpenCL and HLSL and compared to those OpenGL ES which WebGL uses it is much more restrictive. I ran into the same problems as Syntopia reported. Loops are more restrictive and ANGLE not being completely compatible with OpenGL ES. I tested my mandelbrot demo in Chrome and when I ran it with Opera Beta which uses an OpenGL backend I got errors about the loop which worked fine with Chrome (which uses ANGLE). It was very cool to see the same mandelbrot demo running on Firefox/Chrome/Opera on Windows, Firefox on Linux and it even worked on Android (with firefox)

Despite being a fan of WebGL I won't recommend it to create 3d fractals (even though subblue's demo looks pretty cool), it's just a bit too restrictive and especially when the shaders get more complex you have to test and debug them with different browsers, mainly because of the ANGLE vs OpenGL (vs OpenGL ES if you want it on mobile devices as well) backend thing.

This is the link to the demo and you can find the paper there as well
http://www.students.science.uu.nl/~3685632/example.html
« Last Edit: July 23, 2012, 04:37:28 PM by A Noniem » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #13 on: July 23, 2012, 04:33:24 PM »

@subblue WHEN WILL IT BE FINISHED AND RELEASED ??!?! WILL IT BE FREE ?!?!?
Logged

---

divide and conquer - iterate and rule - chaos is No random!
subblue
Conqueror
*******
Posts: 116



WWW
« Reply #14 on: July 23, 2012, 07:14:46 PM »

Despite being a fan of WebGL I won't recommend it to create 3d fractals (even though subblue's demo looks pretty cool), it's just a bit too restrictive and especially when the shaders get more complex you have to test and debug them with different browsers, mainly because of the ANGLE vs OpenGL (vs OpenGL ES if you want it on mobile devices as well) backend thing.
The OpenGL emulation via ANGLE is a big issue at the moment with fractal shaders. The only real option for Windows users is to run Firefox with the native OpenGL config option set. But with native OpenGL support (default on OSX, I've not tested on Linux yet..) it is very usable and I've been getting some very compelling results.

Browser technology is advancing faster than ever. This is an interesting post from last year about the limitations of WebGL: http://codeflow.org/entries/2011/sep/11/webgl-and-html5-challenges-for-the-future/
One of the points, floating-point texture support, is already implemented now in Firefox and Chrome, something I heavily rely upon. Now if we could only have multiple render targets...

@cKleinhuis: It'll be ready when it's ready... wink I'm putting a lot of effort into the user interface and interactivity aspects (often getting between 30-60fps interactive speeds on my 2009 iMac). It's also aimed as a creative tool for users with no programming or mathematical background (so won't have the open-ended flexibility of an app like Fragmentarium) but is more something you explore visually.

At the moment the plan is for it to be free to try out (so you check that your system/browser is capable of running it), and then there will be a paid account version (at a very affordable app-style price) where you can save/share presets and render high-res images... but all that could well change wink
Logged

www.subblue.com - a blog exploring mathematical and generative graphics
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
GLSL based GPU raytracer Mandelbulb Implementation cbuchner1 2 18512 Last post April 28, 2011, 07:04:56 PM
by visual.bermarte
Web Hosting? General Discussion « 1 2 » HPDZ 21 7566 Last post August 22, 2011, 11:29:35 PM
by ker2x
WebGL Programming ker2x 5 4463 Last post August 25, 2011, 10:33:17 PM
by David Makin
GLSL Sandbox & WebGL Playground Fractal Website of the Month Syntopia 0 10238 Last post December 10, 2011, 12:13:20 PM
by Syntopia
webgl mandelbulb Let's collaborate on something! MrMike 2 2694 Last post December 14, 2011, 08:37:17 PM
by marius

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.209 seconds with 24 queries. (Pretty URLs adds 0.012s, 2q)