Explore the wonders of floating point precision errors.
All mouse controlled, you can even change the render resolution for screenshots .
http://www.iquilezles.org/www/articles/ ... smooth.htm
GLSL Mandelbrot
GLSL Mandelbrot
- Attachments
-
- Mandelbrot GLSL.love
- V.4
- (3.15 KiB) Downloaded 220 times
Last edited by GijsB on Thu Feb 02, 2017 1:24 pm, edited 6 times in total.
Re: GLSL Mandelbrot
Amazingly enough it runs pretty deep before it breaks down.
Re: GLSL Mandelbrot
Very cool. I take it it's single precision, right? It would be nice if it zoomed towards the mouse instead of using keys, à la Xaos.
Is there any reason why some mini-Mandelbrots are blue instead of black?
Is there any reason why some mini-Mandelbrots are blue instead of black?
Re: GLSL Mandelbrot
I take it that has to do with smoothing function edge cases; messing around with maximum number of iterations produces a lot of glitches of this sort.
Re: GLSL Mandelbrot
This is correct, however I don't understand the actual mechanics myself. If you want to get rid the of blue mini-brots change the iterations to 200, for example :raidho36 wrote:I take it that has to do with smoothing function edge cases; messing around with maximum number of iterations produces a lot of glitches of this sort.pgimeno wrote:Very cool. I take it it's single precision, right? It would be nice if it zoomed towards the mouse instead of using keys, à la Xaos.
Is there any reason why some mini-Mandelbrots are blue instead of black?
- Attachments
-
- Mandelbrot GLSL.love
- (1.36 KiB) Downloaded 186 times
- zorg
- Party member
- Posts: 3468
- Joined: Thu Dec 13, 2012 2:55 pm
- Location: Absurdistan, Hungary
- Contact:
Re: GLSL Mandelbrot
viewtopic.php?f=14&t=83267
Just gonna leave this here as well, to compare and whatnot
Just gonna leave this here as well, to compare and whatnot
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Re: GLSL Mandelbrot
Thanks for the clarification on the mini-Mandelbrot colour.
I said:
Just insert this before setting the new zoom on click:
I said:
And here's a function to do that:pgimeno wrote:It would be nice if it zoomed towards the mouse instead of using keys, à la Xaos.
Code: Select all
local function PanTowardMouse(oldzoom, newzoom)
local mx, my = love.mouse.getPosition()
-- Transform mouse coords to unzoomed graphic axes
mx = (mx * 2 - Width) * 1.5 / Height
my = (my * 2 - Height) * 1.5 / Height
-- Calculate new centre so that the mouse remains in the same place
Pan.x = Pan.x + mx * oldzoom - mx * newzoom
Pan.y = Pan.y + my * oldzoom - my * newzoom
end
Code: Select all
PanTowardMouse(Zoom, Zoom/ZoomSpeed) -- (before Zoom = Zoom/ZoomSpeed)
...
PanTowardMouse(Zoom, Zoom*ZoomSpeed) -- (before Zoom = Zoom*ZoomSpeed)
Re: GLSL Mandelbrot
Great! Thanks, added it!pgimeno wrote:Thanks for the clarification on the mini-Mandelbrot colour.
I said:And here's a function to do that:pgimeno wrote:It would be nice if it zoomed towards the mouse instead of using keys, à la Xaos.
Just insert this before setting the new zoom on click:Code: Select all
local function PanTowardMouse(oldzoom, newzoom) local mx, my = love.mouse.getPosition() -- Transform mouse coords to unzoomed graphic axes mx = (mx * 2 - Width) * 1.5 / Height my = (my * 2 - Height) * 1.5 / Height -- Calculate new centre so that the mouse remains in the same place Pan.x = Pan.x + mx * oldzoom - mx * newzoom Pan.y = Pan.y + my * oldzoom - my * newzoom end
Code: Select all
PanTowardMouse(Zoom, Zoom/ZoomSpeed) -- (before Zoom = Zoom/ZoomSpeed) ... PanTowardMouse(Zoom, Zoom*ZoomSpeed) -- (before Zoom = Zoom*ZoomSpeed)
- Attachments
-
- Mandelbrot GLSL.love
- (1.89 KiB) Downloaded 174 times
Re: GLSL Mandelbrot
Added my GUI library, you can now change the render resolution for screenshots
- Attachments
-
- Mandelbrot GLSL.love
- V.4
- (3.15 KiB) Downloaded 170 times
Who is online
Users browsing this forum: No registered users and 6 guests