Menu

Looks fantastic, but 2 Examples not working

Anonymous
2010-12-10
2016-10-23
  • Anonymous

    Anonymous - 2010-12-10

    Greetings:  SpiderGL is very impressive!   Excellent work.

    Just to let you know, two of the demos in the gallery did not work properly for me. 

    I am using Chrome 10.0.605.0 canary build running on WIndows 7 64bit on a laptop with a GeForce 260M GTX

    Here are the log messages I got:

    Example 5: Ray-Casting with BlockMaps

    -------------------------------------
    [SHADER LOG] SUCCESS:
    [SHADER LOG] SUCCESS:
    [PROGRAM LOG] SUCCESS:
    -------------------------------------
    [SHADER LOG] SUCCESS:
    [SHADER LOG]
    FAIL:
    ERROR: 0:125: 'while' : This type of loop is not allowed
    [PROGRAM LOG] FAIL:
    ----------------------
    

    Example 8: Streaming LoD Terrain

    SpiderGL Version : 0.1.1
    -------------------------------------
    [SHADER LOG]
    FAIL:
    ERROR: 0:30: 'texture2D' : no matching overloaded function found 
    ERROR: 0:30: 'x' :  field selection requires structure, vector, or matrix on left hand side 
    [SHADER LOG] SUCCESS:
    [PROGRAM LOG] FAIL:
    -------------------------------------
    [SHADER LOG] SUCCESS:
    [SHADER LOG] SUCCESS:
    [PROGRAM LOG] SUCCESS:
    -------------------------------------
    
     
  • Alvaro

    Alvaro - 2010-12-10

    WebGL implementations are becoming more strict with respect to standard compliance. The spec says that "while" loop support is not mandatory. Chrome and now also Firefox (both using ANGLE to convert shaders to DirectX) don't allow while loops.

    You have to convert them into "for" loops, but not any loop is allowed. They have to have a known maximum number of iterations at compile time. They have to have this form e.g:

    for (int i=0; i<CONSTANT; i++) { …  if(EXIT_CONDITION) break; …}

    or similar (for (float x=0.0; x<100.0; x+=1.4) )

    and use a conditional "break" inside to exit in less iterations.

    In the second case I still don't understand what is wrong (seems OK to me).

     
  • Anonymous

    Anonymous - 2010-12-12

    I downloaded Firefox Minefield 4.0b8pre  12 december 2010 and the example 8 still does not run with the same error.

    However, the terrain example works beautifully!   I am really impressed.  

      I'll see if I can get the support files off the site so I can try to fix the shader in example 8.   It looks like there is a tree.txt and a bunch of png files in the examples/data/multires128.  If I can figure out the names I should be able to grab them from spidergl.org since they don't seem to be in the SVN repo.

    -Kevin

     
  • DJLinux

    DJLinux - 2016-10-23

    for the blockmap render demo I fix it in file "blockmap.f.glsl" like this:

    //while (!hit && (ray_len < p.max_length)) 
      for (int i=0; i<100; i++) {
        blockmap_data      = texture2D(s_blockmap_sampler, sample_coord.xy);
    
        prev_sample_coord  = sample_coord;
        prev_ray_len       = ray_len;
    
        update_dir_u       = (sample_coord.z < sample_coord.w);
        ray_len            = (update_dir_u) ? (sample_coord.z)  : (sample_coord.w);
        if (ray_len >=p.max_length) {
          hit=false;
          break;
        }  
        sample_coord      += (update_dir_u) ? (p.sample_step_u) : (p.sample_step_v);
    
        hit                = (blockmap_data.x >= ((p.ray_org.z + ray_len * p.z_step)));
        if (hit==true)
          break;
      }
    
     

    Last edit: DJLinux 2016-10-23

Log in to post a comment.