Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: takumi12 - VAO (Vertex Array Object) SHADER MAIN 5.2  (Visto 10244 veces)

0 Miembros and 2 Guests are viewing this topic.

Offline ZabiinoOo #40 Posteado: September 18, 2025, 05:12:06 PM

  • MAESTRO

  • US. DE HONOR

  • LEYENDA

  • Administrador
  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 7.463
  • Gracias recibida: 136497
  • pe
void BMD::RenderVertexBuffer(int i, Mesh_t* m, int vertex_index, vec3_t* vertices, vec2_t* textCoords)
{
   GLuint shader_id = gShaderGL->GetShaderId();
   glUseProgram(shader_id);
    glm::mat4 model;
    for (int j = 0; j < m->NumVertices; j++)
   {
        Vertex_t* v = &m->Vertices[j];

        float* vp = VertexTransform[j];
        VectorTransform(v->Position, BoneMatrix[v->Node], vp);
       VectorRotate(v->Position, BoneMatrix[v->Node], vp);
      vp[0] = vp[0] * BoneScale + BoneMatrix[v->Node][0][3];
      vp[1] = vp[1] * BoneScale + BoneMatrix[v->Node][1][3];
      vp[2] = vp[2] * BoneScale + BoneMatrix[v->Node][2][3];
        model = glm::translate(glm::mat4(1.0f), vp);
               
    }

   glm::mat4 view = glm::lookAt(glm::vec3(-CameraPosition[0], -CameraPosition[1], -CameraPosition[2]), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
   glm::mat4 projection = glm::perspective(glm::radians(CameraFOV), (float)WindowWidth / (float)WindowHeight, CameraViewNear, CameraViewFar * 1.4f);

   glUniformMatrix4fv(glGetUniformLocation(shader_id, "projection"), 1, GL_FALSE, glm::value_ptr(projection));

   // Enviar la matriz de vista
   glUniformMatrix4fv(glGetUniformLocation(shader_id, "view"), 1, GL_FALSE, glm::value_ptr(view));

   // Enviar la matriz de modelo
   glUniformMatrix4fv(glGetUniformLocation(shader_id, "model"), 1, GL_FALSE, glm::value_ptr(model));


   glBindVertexArray(m->VAO);
   glDrawElements(GL_TRIANGLES, vertex_index, GL_UNSIGNED_SHORT, 0);
   glBindVertexArray(0);
   glUseProgram(0);
}

it will look like this
How to implement in the renderMesh and other renders?


Eu hein ? O_O Rafael Dias pedindo ajuda na TuServerMU ? Eu estou vendo isso mesmo ? Aqui não era a Cracolandia do MU e você não precisava de nada de forum ?
Mundo gira hem..., porque não usa seu nome verdadeiro.... vergonha... retaliação ...

Falta humildade..... EU HEINNNN !



What the hell? O_O Rafael Dias asking for help on TuServerMU? Am I really seeing this? Wasn't this the MU's Crackland and you didn't need any forums?

Fra mundo huh..., why don't you use your real name.... shame... retaliation...

Lack of humility..... WHAT THE HELL!!

Assim são os amigos falsos e covardes, eles se escondem




Prohibido pedir soporte via MP
Leer las reglas de cada seccion
we trust god

Gracias:


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate


 

Related Topics

  Subject / Started by Replies Last post
4 Replies
5476 Views
Last post March 03, 2020, 05:27:28 PM
by jorginhuz
4 Replies
1965 Views
Last post March 02, 2025, 08:12:33 PM
by czrdiamond
33 Replies
8319 Views
Last post November 14, 2021, 03:43:48 PM
by jorge2016
27 Replies
12073 Views
Last post April 06, 2025, 06:00:54 AM
by Xingaw
8 Replies
5901 Views
Last post June 03, 2024, 11:47:23 PM
by Kosh