flat assembler
Message board for the users of flat assembler.
Index
> Projects and Ideas > So, I tried to make a vectorized mandelbrot Goto page 1, 2 Next |
Author |
|
typedef 16 Oct 2011, 04:39
what math algo were you using?
|
|||
16 Oct 2011, 04:39 |
|
Akujin 16 Oct 2011, 04:44
I like Vertex fractals.
_________________ CLI HLT |
|||||||||||
16 Oct 2011, 04:44 |
|
mindcooler 16 Oct 2011, 14:06
typedef wrote: what math algo were you using? Z=Z^2^6+Z0 Z0=position Haven't figured out why the borders are all fuzzy. _________________ This is a block of text that can be added to posts you make. |
|||
16 Oct 2011, 14:06 |
|
mindcooler 17 Oct 2011, 03:46
Wonder if it's some kind of precision artifacts. Seems like I'm losing 3/4 of the horizontal resolution at moderate iteration counts.
Here is an exe if you would like to play with it. Mouse X position controls the iteration count. http://files.sys5.se/fractal.exe _________________ This is a block of text that can be added to posts you make. |
|||
17 Oct 2011, 03:46 |
|
typedef 17 Oct 2011, 04:36
Damn,,,,I have epilepsy and I kinda got a seizure... *choking*
|
|||
17 Oct 2011, 04:36 |
|
Madis731 17 Oct 2011, 07:07
@mindcooler: You're probably just writing the pixels in wrong order. Just do a SHUFPD xmm0,xmm0,00011011b before MOVDQA [mem],xmm0.
There are many examples of vectorized fractals so don't say that its not suitable. You just need to be careful |
|||
17 Oct 2011, 07:07 |
|
mindcooler 17 Oct 2011, 15:06
Madis731 wrote: @mindcooler: You're probably just writing the pixels in wrong order. Just do a SHUFPD xmm0,xmm0,00011011b before MOVDQA [mem],xmm0. I tried flipping the pixels, but it only got fuzzier _________________ This is a block of text that can be added to posts you make. |
|||
17 Oct 2011, 15:06 |
|
Madis731 17 Oct 2011, 15:17
Then I guess the bug is elsewhere, but I think you also know what the next logical suggestion will be. The source?
|
|||
17 Oct 2011, 15:17 |
|
mindcooler 17 Oct 2011, 15:35
_________________ This is a block of text that can be added to posts you make. |
|||
17 Oct 2011, 15:35 |
|
Madis731 17 Oct 2011, 15:50
According to this: http://www.mathworks.com/moler/exm/chapters/mandelbrot.pdf (p.6 figure 13.4) you might have a problem with precision.
Have you heard about subpixel rendering or double resolution antialiasing, supersampling etc.? http://en.wikipedia.org/wiki/Spatial_anti-aliasing I think this is what's making this picture look awful. I made this little change in code and the blocks grew in size, but there were less holes: Code: shufps xmm5,xmm5,0 ;Make 4 neighboring pixels the same. movups dqword [edi],xmm5 |
|||
17 Oct 2011, 15:50 |
|
mindcooler 17 Oct 2011, 16:34
Weird thing is, the problem seems to be in just the x direction, as if the pixels are not continuous. I get full resolution in the y direction. I've checked the generated coordinates in a quad, and they line up perfectly.
You shouldn't need to resort to antialiasing to get down to pixel-sized chunks. There is probably some subtle problem with the vectorization in the iteration loop. I think if I were to make it scalar the problem would go away. _________________ This is a block of text that can be added to posts you make. |
|||
17 Oct 2011, 16:34 |
|
Madis731 17 Oct 2011, 16:58
Found it!
Code: .xloop: movaps xmm0,dqword [deltas] movss xmm1,[.r] shufps xmm1,xmm1,$00 addps xmm1,xmm0 ;You need this HERE! movaps xmm6,xmm1 movss xmm2,[.i] shufps xmm2,xmm2,$00 ;addps xmm1,xmm0 ;...but NOT here! movaps xmm7,xmm2 |
|||
17 Oct 2011, 16:58 |
|
Madis731 18 Oct 2011, 16:37
I tried optimizing a bit (11-14% on Core 2):
Code: .xloop: movaps xmm0,dqword [deltas] movss xmm1,[.r] shufps xmm1,xmm1,$00 addps xmm1,xmm0 movaps xmm6,xmm1 movss xmm2,[.i] shufps xmm2,xmm2,$00 movaps xmm7,xmm2 ;mov ebx,MAXITER mov ebx,[maxiter] movss xmm4,[.r] .iteration: movaps xmm3,xmm1 ;freeing xmm4 allows us to use it for [.r] mulps xmm1,xmm1 ;try to use full pipeline mulps xmm3,xmm2 mulps xmm2,xmm2 addps xmm3,xmm3 subps xmm1,xmm2 movaps xmm2,xmm3 addps xmm1,xmm6 addps xmm2,xmm7 movaps xmm5,xmm1 addps xmm5,xmm2 dec ebx jne .iteration cmpltps xmm5,dqword [bailout] movups dqword [edi],xmm5 addss xmm4,[.delta4] movss [.r],xmm4 add edi,16 dec edx jne .xloop movss xmm4,[.i] addss xmm4,[.delta] movss [.i],xmm4 |
|||
18 Oct 2011, 16:37 |
|
mindcooler 18 Oct 2011, 21:31
Madis731 wrote: Found it! Oh wow, that is amazing! I remember moving that line to the bottom of what I thought was the r calculation, obviously I moved it too far! _________________ This is a block of text that can be added to posts you make. |
|||
18 Oct 2011, 21:31 |
|
mindcooler 18 Oct 2011, 21:42
Madis731 wrote: I tried optimizing a bit (11-14% on Core 2): Nice, keeping it in the same place instead of moving it all over. As I'm new to SSE, I don't know much about pipelining, what should I keep in mind while doing SSE work? Now that it works properly I'm going to try to split it up into worker threads. I'm new to that too, so another adventure awaits _________________ This is a block of text that can be added to posts you make. |
|||
18 Oct 2011, 21:42 |
|
Madis731 19 Oct 2011, 08:52
http://agner.org/optimize/ - 2. optimizing_assembly.pdf
|
|||
19 Oct 2011, 08:52 |
|
mindcooler 19 Oct 2011, 21:47
Yes, I suppose I have to get acquainted with mr Agner someday
|
|||
19 Oct 2011, 21:47 |
|
f0dder 20 Oct 2011, 18:14
mindcooler wrote: Fractals are not really suitable to vectorize, but I thought I'd give it a try. Seems that there is something fishy about my result _________________ - carpe noctem |
|||
20 Oct 2011, 18:14 |
|
vid 20 Oct 2011, 19:00
refering to OP: can you zoom in such fractal? it might be an interestng animation
|
|||
20 Oct 2011, 19:00 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.