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

OpenGL Discussion :

WebGL : mat3 en attribut


Sujet :

OpenGL

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éprouvé

    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 448
    Par défaut WebGL : mat3 en attribut
    Hello

    Quelqu'un sait comment passer un attribut de type mat3 à un vertex shader?
    J'arrive à passer des vecteurs mais j'aimerais passer une mat3.

    Je précise que je parle bien d'attribut et non d'uniform.

  2. #2
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 173
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 173
    Billets dans le blog
    155
    Par défaut
    Bonjour,

    Dans la spécification, je vois ces belles fonctions :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    void uniform3f(WebGLUniformLocation location, GLfloat x, GLfloat y, GLfloat z);
        void uniform3fv(WebGLUniformLocation location, Float32Array v);
        void uniform3fv(WebGLUniformLocation location, float[] v);
        void uniform3i(WebGLUniformLocation location, GLint x, GLint y, GLint z);
        void uniform3iv(WebGLUniformLocation location, Int32Array v);
        void uniform3iv(WebGLUniformLocation location, long[] v);
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  3. #3
    Membre éprouvé

    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 448
    Par défaut
    Je re-précise que je parle bien d'attribut et non d'uniform.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    attribute mat3 aMat3;
    Et non pas

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    uniform mat3 uMat3;
     
    varying mat3 vMat3;

  4. #4
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 173
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 173
    Billets dans le blog
    155
    Par défaut


    Pardon. Dans la même spécification :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    void vertexAttrib1f(GLuint indx, GLfloat x);
        void vertexAttrib1fv(GLuint indx, Float32Array values);
        void vertexAttrib1fv(GLuint indx, float[] values);
        void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
        void vertexAttrib2fv(GLuint indx, Float32Array values);
        void vertexAttrib2fv(GLuint indx, float[] values);
        void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
        void vertexAttrib3fv(GLuint indx, Float32Array values);
        void vertexAttrib3fv(GLuint indx, float[] values);
        void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
        void vertexAttrib4fv(GLuint indx, Float32Array values);
        void vertexAttrib4fv(GLuint indx, float[] values);
        void vertexAttribPointer(GLuint indx, GLint size, GLenum type, 
                                 GLboolean normalized, GLsizei stride, GLintptr offset);
    Dans la spécification du WebGL il réfère à la spécification de OpenGL ES 2 (section 2.7) qui dit :
    The VertexAttrib* commands can also be used to load attributes declared as a
    2×2, 3×3 or 4×4 matrix in a vertex shader. Each column of a matrix takes up one
    generic 4-component attribute slot out of the MAX_VERTEX_ATTRIBS available
    slots. Matrices are loaded into these slots in column major order. Matrix columns
    need to be loaded in increasing slot numbers.
    La commande peut donc aussi être utilisée pour une matrice.
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

  5. #5
    Membre éprouvé

    Profil pro
    Inscrit en
    Juillet 2006
    Messages
    1 448
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Juillet 2006
    Messages : 1 448
    Par défaut
    Je pige pas trop, il me faudrait un exemple.
    Est-ce que vous arriver à en trouver un ?

  6. #6
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 173
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 173
    Billets dans le blog
    155
    Par défaut
    Il faut chercher du coté des demos WebGL, je pense.
    Sinon, un programme OpenGL classique est similaire.
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

Discussions similaires

  1. Ajout d'attribut à l'élément "Body"
    Par Tirlibibi dans le forum XMLRAD
    Réponses: 2
    Dernier message: 07/04/2003, 16h52
  2. Filtre d'affichage de balise selon leur attributs
    Par Norely dans le forum XML/XSL et SOAP
    Réponses: 10
    Dernier message: 03/04/2003, 15h33
  3. Une fonction avec des attributs non obligatoires
    Par YanK dans le forum Langage
    Réponses: 5
    Dernier message: 15/11/2002, 14h39
  4. Lire un attribut dans un fichier XML en C++
    Par ti.k-nar dans le forum XML
    Réponses: 2
    Dernier message: 14/10/2002, 16h22
  5. comment changer d'attribut de fonte dans un Tlabel?
    Par sb dans le forum Composants VCL
    Réponses: 3
    Dernier message: 21/08/2002, 17h53

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