IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JavaScript Discussion :

[webgl] Polygones qui clignotent


Sujet :

JavaScript

  1. #1
    Inactif
    Homme Profil pro
    web+multimedia
    Inscrit en
    Décembre 2014
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : web+multimedia

    Informations forums :
    Inscription : Décembre 2014
    Messages : 6
    Points : 8
    Points
    8
    Par défaut [webgl] Polygones qui clignotent
    Bonjour,

    Sur un maillage de heightmap, il y'a deux bordures du quadrillage où les polygones clignotent sur la configuration suivante:
    - windows 8.1 , chrome et firefox
    pas de bug sur iexplorer
    sur windows 7 ça fonctionnait très bien

    savez-vous à quoi peut être dù ce type de bug et s'il est possible de le corriger ?

  2. #2
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 089
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 089
    Points : 44 660
    Points
    44 660
    Par défaut
    Bonjour,
    savez-vous à quoi peut être dù ce type de bug et s'il est possible de le corriger ?
    difficile de se prononcer sans voir une page test !

  3. #3
    Inactif
    Homme Profil pro
    web+multimedia
    Inscrit en
    Décembre 2014
    Messages
    6
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : web+multimedia

    Informations forums :
    Inscription : Décembre 2014
    Messages : 6
    Points : 8
    Points
    8
    Par défaut
    Une page test ne va pas vous dire grand chose car ce bug ne se produit que dans certaines conditions gpu/os/browser

    Voici le code utilisé pour générer les buffers, y'a ptêtre une erreur dedans




    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
      var vertexArray = new Float32Array(numVerts*floatPerVert);  
      var indexArray = new Uint16Array(numIndex);  
     
      function addVector(arr,index,x,y,z,u,v,u2,v2) {
        var i = index*floatPerVert;
        arr[i+0] = x;
        arr[i+1] = y;
        arr[i+2] = z;
        arr[i+3] = u;
        arr[i+4] = v;
        arr[i+5] = u2;
        arr[i+6] = v2;  
      }
     
      var cS = 32;
      var ivert=0,iindex=0,offx,offy,offu,offv,uSz=1.0/numCol,vSz=1.0/numRow,msk=0;
      for ( row = 0; row < numRow; row++ ) {
        for ( col = 0; col < numCol; col++ ) {
     
          // CREATE THE 4 VERTS
          offx = (col - numCol/2);
          offy = (row - numRow/2);
          offu = col*uSz;
          offv = row*vSz;
          addVector( vertexArray, ivert+0, (offx+0)*cS, (offy+0)*cS, zmap[(row+0)*numCol+(col+0)]*cS, 0, 0, offu, offv );
          addVector( vertexArray, ivert+1, (offx+1)*cS, (offy+0)*cS, zmap[(row+0)*numCol+(col+1)]*cS, 1, 0, offu+uSz, offv );
          addVector( vertexArray, ivert+2, (offx+1)*cS, (offy+1)*cS, zmap[(row+1)*numCol+(col+1)]*cS, 1, 1, offu+uSz, offv+uSz );
          addVector( vertexArray, ivert+3, (offx+0)*cS, (offy+1)*cS, zmap[(row+1)*numCol+(col+0)]*cS, 0, 1, offu, offv+uSz );
     
          // CREATE THT 6 INDEXES
          indexArray[iindex+0] = ivert + 0;
          indexArray[iindex+1] = ivert + 1;
          indexArray[iindex+2] = ivert + 2;
          indexArray[iindex+3] = ivert + 0;
          indexArray[iindex+4] = ivert + 2;
          indexArray[iindex+5] = ivert + 3;
     
          ivert += 4;
          iindex += 6;
        }  
      }

  4. #4
    Modérateur

    Avatar de NoSmoking
    Homme Profil pro
    Inscrit en
    Janvier 2011
    Messages
    17 089
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Isère (Rhône Alpes)

    Informations forums :
    Inscription : Janvier 2011
    Messages : 17 089
    Points : 44 660
    Points
    44 660
    Par défaut
    Difficile de dire hors du contexte, je me hasarderais donc à dire que si offx et offy sont des positions d'affichage à l'écran il est préférable qu'ils soient des entiers donc je ferais plutôt offx = (col - numCol >>1);, mais bon!....

Discussions similaires

  1. [Flash] Curseur qui clignote !
    Par Neroptik dans le forum Flash
    Réponses: 2
    Dernier message: 13/11/2006, 17h51
  2. Afficher un caractère qui clignote à l'écran
    Par ha125 dans le forum Assembleur
    Réponses: 2
    Dernier message: 27/04/2006, 18h45
  3. Lumière qui clignote
    Par seeme dans le forum OpenGL
    Réponses: 2
    Dernier message: 06/02/2006, 15h48
  4. [Linux]Avoir le curseur qui clignote
    Par Yabo dans le forum C
    Réponses: 2
    Dernier message: 06/07/2003, 13h46

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo