Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: The silence inside the fractal - GBuffers (how many may be used ?)

  1. #21
    Yes, I see all the old examples in the thinBasic package now. I think we need to drop all of them, and just distribute the new set.

    Anyway, if all the new graphical examples work on you system, Mike, then that greatly diminishes the possibility of an XP-specific bug in Oxygen, and the problem lies somewhere within the FractalInvest script.

  2. #22
    Exactly, Charles.

    For example, the TB distro's noise doesn't work with either DLL for me. The both GBuffers samples do work with either DLL. The new noise sample works with the new DLL only.

    Unfortunately, Fractal Invest GBuffers don't work at all.
    Mike
    (3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)

  3. #23
    It will have to be a process of deconstruction:

    The TbMain function encapsulation is redundant since the FractalInvest script already contains main-code outside of it.

    These 2 lines can be commented out
    'Function TBMain()
    ...
    'End Function


    PS:

    Also replaced some more o2_exec with compute. I missed them.
    Attached Files Attached Files
    Last edited by Charles Pegge; 20-01-2014 at 08:10.

  4. #24
    Hi Charles, Mike , all

    Charles, is it possible (I've been comparing some programs that worked before the pow(-2,2) history and gave up with the new DLL(s)" )
    that you changed something in the step of the for next loop.
    I may be dreaming but I do think they accepted floating point numbers (as a literal and as a variable) ?
    They don't do this any more ..

    best Rob

    (sometimes they do work (?) , but the first output of the loop sometimes seems to be a #qNAN - followed by the correct values afai can intercept the results )
    Attached Files Attached Files
    Last edited by RobbeK; 20-01-2014 at 11:30.

  5. #25
    Addendum : yep , some strange things happening


    best Rob
    Attached Files Attached Files

  6. #26
    Yes Rob, I found an FPU stack overflow, on float steps. I don't think this bug is connected with the XP problem

    update here

    http://www.thinbasic.com/community/s...ad.php?t=12175

  7. #27
    Thanks Charles,

    It may be connected with Mike's remark that older code doesn't work any more - I had the same problem and they all had the for...step...next in common. (they worked/work fine with the DLL from before the pow(x,y) update )

    best, Rob
    Last edited by RobbeK; 21-01-2014 at 01:02.

  8. #28
    One potential problem with float iteration is cumulative error, especially with single precision floats:

    single i
    int j
    for i=1 to 10000 step .1
    j++
    next
    print j " " i

    result: 100005 10000.05..

    Cumulative errors can be avoided, without significant change in performance, by scaling an integer iterator.

    for j=1 to 100000
    i=j*.1
    next
    print "count: "j " final value: " i cr

    result: 100001 10000
    Last edited by Charles Pegge; 21-01-2014 at 06:43.

  9. #29
    Hi Charles,

    Yes, and even worse things are possible, p.e. using the loop index as the index of an array etc....

    Speaking about this : (not related with above)

    I used to declare the shared arrays "pseudo" dynamic , with the idea that the address and an index would be sufficient ... but they go wrong if you replace the (in this example) m(33) with just a plain m .... they crash after iteration #3-4 (shown in the MsgBox - the index get a weird value) , if the loop is based on integers it works.
    Ah, yes to get a clearer idea about O2 -- the O2_basic, ... asm etc.. envokes the compiler and linker?? but declaration as ...

    function(...) as... link #something ,
    is this set up during run-time of the compiled code ????

    eTest.tbasic

    ================================

    Uses "Console" , "oxygen"



    Dim m(33) , n(33) As Single
    Dim s As String

    s="
    dim m as single at #m
    dim n(33) as single at #n ' needs to be indexed avoiding a crash
    dim i as integer
    dim j , dz as single

    dz=1/33
    For i=0 To 32
    m(i+1)=i*dz
    Next

    i=1

    For j=0 To 1-dz step dz
    print "Iteration #"+str(i)+" result : "+str(j)
    n(i)=j
    i++
    Next

    "
    O2_Basic s
    If O2_Errno Then
    MsgBox 0, O2_Error
    Stop
    End If




    O2_Exec

    PrintL "test complete"

    WaitKey
    =============================================================


    best Rob, thanks for your help !
    Last edited by RobbeK; 21-01-2014 at 13:48.

  10. #30
    Hi Rob, the linkage is set up at compile time. But the problem was the placement of at.

    at needs to come before as, when the type is specified on the right

    dim m at #m as single
    dim n at #n as single

    some other possibilities:

    dim m at #m, n at #n as single


    dim as single m at #m, n at #n


    single m at #m, n at #n

    ' Empty thinBasic CONSOLE file template
    
    
    Uses "Console" , "oxygen"
    
    
    
    
     
    Dim m(33) , n(33) As Single 
    Dim s As String
    
    
    s="
    dim m at #m as single
    dim n at #n as single
    '
    'dim m at #m, n at #n as single
    '
    'dim as single m at #m, n at #n
    '
    'single m at #m, n at #n
    
    
    '
    dim i as integer
    dim j , dz as single
    
    
    dz=1/33
    For i=0 To 32
     m(i+1)=i*dz
    Next  
    
    
    cr=chr(13,10)
    tab=chr(9)
    pr=""
    i=1 
    For j=0 To 1-dz step dz 
      pr+= "Iteration #"+str(i)+"  result :  "+str(j) cr
      n(i)=j
      i++
    Next
    print pr
    
    
    
    
    "
     O2_Basic s
    If O2_Errno Then
      MsgBox 0, O2_Error
      Stop 
    End If
     
    
    
     
    
    
    O2_Exec
    
    
    dim i as long
    
    
    For i=1 to 33
      printl "Iteration #"+str$(i)+"  result :  "+str$(n(i))
    Next
    
    
    WaitKey
    

Page 3 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Metallica - the inside of a fractal - O2 etc...
    By RobbeK in forum Sources, Templates, Code Snippets, Tips and Tricks, Do you know ...
    Replies: 10
    Last Post: 12-01-2014, 14:41
  2. Fractal Videos
    By Charles Pegge in forum Shout Box Area
    Replies: 2
    Last Post: 13-03-2010, 12:04
  3. Preview: GBuffers for TBGL
    By Petr Schreiber in forum TBGL module by Petr Schreiber
    Replies: 11
    Last Post: 04-03-2010, 11:33
  4. fractal tbgl help
    By Lionheart008 in forum TBGL General
    Replies: 12
    Last Post: 16-06-2009, 11:57

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •