Welcome to Fractal Forums

Fractal Software => bug reporting => Topic started by: DarkBeam on July 22, 2012, 07:29:44 PM




Title: Buggy reflects on this parameter
Post by: DarkBeam on July 22, 2012, 07:29:44 PM
I found a bad reflects look on this parameter I made while testing my new Columns. It's a pity because the fractal looks very good. The normals look okay to me here. Nothing can explain why it refuses to work?

Older versions had the same problem. Until I tried with 1.7.9.3 - it renders perfectly reflects! :)

THE DIFFERENCE;

In 1793 reflects are a bit noisy, but look realistic.

In newer builds, they look not as good. Some ugly lines appear here & there.

I am sure Jesse will kill this hidden bug. :D


Mandelbulb3Dv17{
Y....kR/...o5...C....2....ECe6JKcNZwzmJrAI2BzU8EYDn0XtwJuzfbVRxWMoJuzK8PLFihtUtj
................................aCDmR82/H.2........A.tE................UF/2..i1F
...s./....UV/.../M.0/.....Ug/...L.....E4......hD6swgRCnD/.......O.sC0dkpXm1....w
z.....kD12../..........wz..................................u1....y1...sD...../..
.z1...sDYHv9mplJbw9lvWIaypr9zET.Td5a7eijuyfEEYvCrtX9I7FBqA7wyMxMyiQgKCnDxdsY7g8W
jwXoz9TNbuo7z2HWmNZ5SDij......oW0.........UaNalD.6....sD.2E.....................
.............cNaNu1...sD....zU/Sv4.ishP.MZri/UTSv4.auhP.sgri/UxSv4......C....k1.
.....MEUZz1.......E/.cndy0.U..6.P....w/...kE..../0...U4...EI....K/...Q2t....SF52
...U.W1KE8llci6IsU3YBSAe9065oYmzzzSi..U3WVk8Msyj/s7WBjcyFz1.njoEKIOpzoI7dwjQgk0.
.2aTJQKInz9.7aKD/n2tz.EZoLCJoDzj/EU0.wzzz1...........s/........./.........E.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1....................................DwP1.yVV/.Z1Uro20.s544zHq5SHH6.UTM
MwTrdsBBV..yVVlzDtWro20.s544zjp9SHH6.UTMMwzhmsBBV..yVVlzJQXro20.s544zj0FSHH6.UTM
Mwzv3/DwP1.yVV/....cU08czz/cU08cyz1cU08cxz3cU08c................................
E....I....E.....I....o....UMjVLG4B3......................................sU1....
/6U./2....UaNaNaNaNiz.......Uk6E.......6A0YNaNaNaNa..dNaNaNaBizj................
.....cNaNaNaNKzD..............................zD..........2.....................
.....................2.....3....B....AqPgJLPiBLG4B3.Z75.........................
....C.....U.....0....cNaNaNaNavD........Ez1........wz........UzD................
........................Ez1........4./........zD........6.2.....................
................................/....E/...E0....o7LMiBbNj7LP7NoI................
..............U/4MU.06..........................................................
.............O3E...................wz.........zD................................
..........................................E.....I....o....UMjVLG4B3.............
.........................sU1..../6U./2....UaNaNaNaNizUNaNaNaNqzD........yzXNaNaN
aNa../.......UzjaNaNaNaNwz9..........cNaNaNaNKzD...................wz.........zD
..........2..........................................2.....3....7....EbQVtqQaxaQ
hZYFH/..............................4MU/06U................................OaNaN
aNetz0..........................................................................
................................................................}

(http://img14.imagefra.me/s57m/kriptokapi/f0ni_17d_u6bci.jpg) (http://i.imagefra.me/da7j6wwj)[/URL]


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 23, 2012, 09:49:01 AM
Nice params for testing, i think i was successful:

http://www.fractalforums.com/index.php?action=downloads;sa=view;down=43 (http://www.fractalforums.com/index.php?action=downloads;sa=view;down=43)

(Version 1.8.2)

Added also your Columns formula  :peacock:


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 23, 2012, 10:19:05 AM
WOW that was fast! Excellent my friend! :beer: :beer: :beer:

But too bad, there was another "ugly pixels" issue that is still here in the new update (sorry for not telling before! :'( )
If the (visible) light is too close to the borders or outside the temple, strange things happen!
And too I noticed that pos lights are ignored in the navi (probably it's intentional? :dink: )

Thanks again. :beer:

Mandelbulb3Dv18{
b....kR/...o5...C....2....ECe6JKcNZwzmJrAI2BzU8EYDn0XtwJuzfbVRxWMoJuzK8PLFihtUtj
................................aCDmR82/H.2........A.tE................UF/2...wD
...s./....UV/.../M.0/.....Ug/...L.....E4......hD6swgRCnD/.......O.sC0dkpXm1....w
z.....kD12../..........wz..................................u1....y1...sD...../..
.z1...sDYHv9mplJbw9lvWIaypr9zET.Td5a7eijuyfEEYvCrtX9I7FBqA7wyMxMyiQgKCnDxdsY7g8W
jwXoz9TNbuo7z2HWmNZ5SDij......oW0.........UaNalD.6....sD.2E.....................
................./2...sD....z.rbp9.2UKj.k0Ox0.Jcp9.wVKj.E8Ox0.ncp9......C....k1.
.....AQxcz1.......E/.cndy0.U..6.P....w/...kE..../0...U4...EI....K/...Q2t....SF52
...U.W1KE8llci6IsU3YBSAe9061oYmzzzSi..k//ABbW7zj4Ym3.pNOZz1.ypkfgB0xzqI7dwjQgk0.
.2aTJQKInz9.7aKD/n2tz.EZoLCJoDzj/EU0.wzzz1...........s/........./.........E.2c..
zzzz.............0...................2./8.kzzzD............8....................
/EU0.wzzz1....................................DwP1.yVV/.Z1Uro20.s544zHq5SHH6.UTM
MwTrdsBBV..yVVlzDtWro20.s544zjp9SHH6.UTMMwzhmsBBV..yVVlzJQXro20.s544zj0FSHH6.UTM
Mwzv3/DwP1.yVV/....cU08czz/cU08cyz1cU08cxz3cU08c................................
E....I....E.....I....o....UMjVLG4B3......................................sU1....
/6U./2....UaNaNaNaNiz.......Uk6E.......6A0YNaNaNaNa..dNaNaNaBizj................
.....cNaNaNaNKzD..............................zD..........2.....................
.....................2.....3....B....AqPgJLPiBLG4B3.Z75.........................
....C.....U.....0....cNaNaNaNavD........Ez1........wz........UzD................
........................Ez1........4./........zD........6.2.....................
................................/....E/...E0....o7LMiBbNj7LP7NoI................
..............U/4MU.06..........................................................
.............O3E...................wz.........zD................................
..........................................E.....I....o....UMjVLG4B3.............
.........................sU1..../6U./2....UaNaNaNaNizUNaNaNaNqzD........yzXNaNaN
aNa../.......UzjaNaNaNaNwz9..........cNaNaNaNKzD...................wz.........zD
..........2..........................................2.....3....7....EbQVtqQaxaQ
hZYFH/..............................4MU/06U................................OaNaN
aNetz0..........................................................................
................................................................}

(http://img13.imagefra.me/s57n/kriptokapi/ffo6_fa4_u6bci.jpg) (http://i.imagefra.me/8f3j6xjs)


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 23, 2012, 12:16:12 PM
Looks like the light attracts mosquitoes   rofl2


Oh boy...


Add:
Fixed now, was related to the high Zend (farplane) value... but i have not changed the version number, just download again  :gum:


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 23, 2012, 04:19:46 PM
Oh, awesome again. :D Now, if I can, I would like to add this parameter to the built-in ones as a prize for your patience! :beer: Going to upload! :)


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 23, 2012, 09:37:32 PM
Oh, awesome again. :D Now, if I can, I would like to add this parameter to the built-in ones as a prize for your patience! :beer: Going to upload! :)

Very nice parameters, i like the mood of it!

We could try to speedup the gnarlyIFS a lot by calculating the gnarl-iters only if you are close to the surface like i did in the heightmapIFS...


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 24, 2012, 06:15:31 PM
I applied your tip to; Gnarly, Gnarly2, 3, Ducks, they speeded up by 5x in normal conditions (perspective view in a 2000 x 1500 render). You are magic as usual. :) The problem is when you use them in transparent renders, because now they work a bit differently. But they are not supposed to work that way...


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 24, 2012, 06:39:16 PM
What issues are in transparent mode?

One issue i know is in minDE combination with overlap mode, there you receive steps because the DE makes steps.  But this can be avoided if i add the overlap distance to the DEstop value that is used in the formula.

Here is the source for the heightmapIFS:

Code:
  push  ecx                 //added OTrap coloring  + speedup
  add   esp, -32            //HeightMap  [nr: Int; Xoff, Yoff, Hoff, Xscale, Yscale, Hscale, Rotation: SRotMat, Col nr, Col OTrap, Col off, Col mult
  fld   qword [esi - 104]   //             -12     -16   -20   -24    -28      -32    -36       -40..-72          -76      -80      -84      -88
  fld   qword [esi - 112]
  fld   qword [esi - 120]   //x,y,z
//{rotation of x,y,z snipped}
  fld  st(2)               //speedup: calc map only if distance to surface is less than...
  fadd dword [edi - 24]    //z+Z(H)offset, x,y,z
  fld  dword [edi - 36]    //Hscale,z', x,y,z
  fmul qword [edi - 8]     //Hscale*0.5,z', x,y,z
  fsubp
  fabs                     //Abs(z'-Hscale*0.5), x,y,z
  fld  dword [edi - 36]
  fabs
  fadd qword [esi - 136]   //In dIFS: local DEstop value, add to distance
  fcompp                   //compare DEstop+Abs(Hscale) with Abs(z'-Hscale*0.5)
  fnstsw ax
  shr ah, 1
  jnc @@1
  fcompp                    //nz (x,y not needed anymore)  not close to surface: calculate distance to midpoint (0.5) of map
  fld   qword [edi - 8]     //0.5
  fmul  dword [edi - 36]    //amplitude H scale
  fsub  dword [edi - 24]    //H offset
  fsubrp                    //-z
  fstp  qword [esi - 32]    //Rout: Double; +56  is distance
  add   esp, 32
  pop   ecx
  ret
@@1:
  fmul  dword [edi - 28]
  fsub  dword [edi - 16]    // offsets after rot+scale
  fstp  qword [esp]
  fmul  dword [edi - 32]
  fsub  dword [edi - 20]
  fstp  qword [esp + 8]
  fstp  qword [esp + 24]
  mov   eax, esp            //esp contains 3d double vec, only x and y is used as map coord
  mov   edx, [edi - 12]
  mov   ecx, esp            //store result in same 3d vec
  call  [esi + 268]         //+356 - 88 = 268
//   PMapFunc2:  esi+356    //   eax             edx             ecx
//function GetMapPixelDirectXY(PVec3D: TPVec3D; MapNr: Integer): TVec3D; //Direct pixel coords 0..1 with tiling
  mov   ecx, [edi - 76]    
  and   ecx, 3              //make sure no access beyond stack is possible
  fld   qword [esp + ecx * 8]   //col of map
  fmul  dword [edi - 36]    //amplitude H scale
  fsub  dword [edi - 24]    //H offset
  fsub  qword [esp + 24]    //-z
  fstp  qword [esi - 32]    //Rout: Double; +56  is distance
  mov   ecx, [edi - 80]     //Otrap color mapnr
  and   ecx, 3
  fld   qword [esp + ecx * 8]   //col of map
  fadd  dword [edi - 84]
  fmul  dword [edi - 88]
  fstp  qword [esi + 128]   //dfree1 for otrap coloring
  add   esp, 32
  pop   ecx
  ret

ps: the code is not optimal, DEstop should be subtracted and then compared with scale + Fudge factor (that i have to add to the prog for DEcomb with overlap)


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 25, 2012, 12:04:00 PM
My solution is a lot less sophisticated, works in almos all conditions, except for veeery high distances and strange viewpoints. I already applied it everywhere  :embarrass:
No longer issues, i use -z instead of abs(z) so it is solid underneath, working just as before in all possible cases. ;) It even works for an extrusion of 0 (useful for a colored flat plane)

Code:
... // unchanged "preparation"
01006454     DD4414 10      FLD QWORD PTR SS:[ESP+EDX+10] // z or something ;)
01006458     D9E1           FABS // abs(z) - 1st term of comparation
0100645A     DD47 B8        FLD QWORD PTR DS:[EDI-48] // this controls how much it extrudes
0100645D     DC0F           FMUL QWORD PTR DS:[EDI] // multiply by 1.5
0100645F     90             NOP
01006460     D9E1           FABS // take abs for safety
01006462     DC47 08        FADD QWORD PTR DS:[EDI+8] // add 0.25 -> render a thin slice for a 'zero' extrusion
01006465     90             NOP
01006466     DED9           FCOMPP
01006468     DFE0           FSTSW AX
0100646A     D0EC           SHR AH,1
0100646C     73 0B          JNB SHORT twunk_32.01006479
0100646E     DD4414 10      FLD QWORD PTR SS:[ESP+EDX+10] // fail, we are far away from the plane. Load z
01006472     D9E0           FCHS // -z is the distance we return
01006474     E9 DA000000    JMP 01006553 // jumps to CMP DWORD PTR DS:[EDI-4C],0 ... and finish the computation
...// unchanged "real formula"


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 25, 2012, 03:57:48 PM
My solution is a lot less sophisticated, works in almos all conditions, except for veeery high distances and strange viewpoints.

Just subtract the DEstop value from z before fabs(z)!


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 25, 2012, 04:51:57 PM
Just subtract the DEstop value from z before fabs(z)!

... did not work, instead adding it to the slope factor exactly like you did) makes it work fine! :beer: :beer: :beer:


Title: Re: Buggy reflects on this parameter
Post by: Jesse on July 25, 2012, 11:14:37 PM
As long as you know what i did there  :)  :beer:


Title: Re: Buggy reflects on this parameter
Post by: DarkBeam on July 26, 2012, 10:36:15 AM
Also I was wondering, some kinds of surface are sensible to destop, maybe an addition of it can make them better? :dink: