Mostrar posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mavine

Paginas: [1]
1
Sources Generales / Re: takumi12 - VAO (Vertex Array Object) SHADER MAIN 5.2
« Posteado: March 28, 2025, 11:25:21 PM »
You're missing the important part that was already mentioned earlier:

"The problem remains how to load the shader and correctly position the transformation values ​​for the camera, view, and model." – takumi12 angryy2

If your model doesn’t appear, it's not the shader itself — it's likely that your camera/view/projection setup is wrong, and the object is rendered outside the visible space.

Code: [Select]
void BMD::RenderVertexBuffer(int textureIndex, Mesh_t* m, int vertex_index, vec3_t* vertices, vec2_t* textCoords)
{
const auto texture = Bitmaps.GetTexture(textureIndex);
if (!texture) return;

GLuint textureID = texture->TextureNumber;
if (!glIsTexture(textureID)) return;

glm::mat4 model = glm::mat4(1.0f);

float distanceBehind = -1.0f;
float heightAbove = 0.9f;
float yaw = -0.8;// glm::radians(CameraAngle[0])* glm::radians(CameraFOV);

glm::vec3 characterPosition = glm::vec3(CameraPosition[0], CameraPosition[1], CameraPosition[2]);

glm::vec3 behindOffset = glm::vec3(
cosf(yaw) * -distanceBehind,
sinf(yaw) * -distanceBehind,
0.0f
);

glm::vec3 cameraPosition = characterPosition + behindOffset;
cameraPosition.z += heightAbove;

glm::mat4 view = glm::lookAt(
cameraPosition,
characterPosition,
glm::vec3(0.0f, 0.0f, 1.0f)
);

glm::mat4 projection = glm::perspective(glm::radians(CameraFOV),
(float)WindowWidth / (float)WindowHeight, CameraViewNear, CameraViewFar * 1.4f);

GLuint shader_id = gShaderGL->GetShaderId();
glUseProgram(shader_id);

// Matrici al vertex shader
glUniformMatrix4fv(glGetUniformLocation(shader_id, "model"), 1, GL_FALSE, glm::value_ptr(model));
glUniformMatrix4fv(glGetUniformLocation(shader_id, "view"), 1, GL_FALSE, glm::value_ptr(view));
glUniformMatrix4fv(glGetUniformLocation(shader_id, "projection"), 1, GL_FALSE, glm::value_ptr(projection));

// Texture
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, textureID);
glUniform1i(glGetUniformLocation(shader_id, "texture1"), 0);

glBindVertexArray(m->VAO);

// Vertex
glBindBuffer(GL_ARRAY_BUFFER, m->VBO_Vertices);
glBufferSubData(GL_ARRAY_BUFFER, 0, vertex_index * sizeof(vec3_t), vertices);
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, (void*)0);
glEnableVertexAttribArray(0);

// Texture Coord
glBindBuffer(GL_ARRAY_BUFFER, m->VBO_TexCoords);
glBufferSubData(GL_ARRAY_BUFFER, 0, vertex_index * sizeof(vec2_t), textCoords);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, (void*)0);
glEnableVertexAttribArray(1);

// Draw call
glDrawElements(GL_TRIANGLES, vertex_index, GL_UNSIGNED_SHORT, 0);

glBindVertexArray(0);
glUseProgram(0);
}

Use this hardcoded snippet to test and adjust until your object becomes visible.



exactly like that , the transfom from camera pos is taken from the character's position and it is always returned to BodyOrigin

Samuel 
Where do I call this function?   void BMD::RenderVertexBuffer(int textureIndex, Mesh_t* m, int vertex_index, vec3_t* vertices, vec2_t* textCoords)

2
Sources Generales / Re: takumi12 - VAO (Vertex Array Object) SHADER MAIN 5.2
« Posteado: March 11, 2025, 02:05:15 AM »
it will look like this
shader.vs
#version 330 core

layout(std140, binding = 0) uniform MeshState {
    int RenderFlag;
    float Alpha;
    float BlendMeshTexCoordU;
    float BlendMeshTexCoordV;
    float BlendMeshLight;
};

uniform mat4 uModelView;
uniform mat4 uProjection;

layout(location = 0) in vec3 aPosition;
layout(location = 1) in vec2 aTexCoord;
layout(location = 2) in vec3 aNormal;

out vec2 TexCoord;
out vec3 LightEffect;

void main() {
    gl_Position = uProjection * uModelView * vec4(aPosition, 1.0);

    TexCoord = aTexCoord;
    if (RenderFlag == 1) {  // RENDER_TEXTURE
        TexCoord.x += BlendMeshTexCoordU;
        TexCoord.y += BlendMeshTexCoordV;
    }

    LightEffect = vec3(BlendMeshLight);
}

struct MeshRenderState {
    int RenderFlag;
    float Alpha;
    float BlendMeshTexCoordU;
    float BlendMeshTexCoordV;
    float BlendMeshLight;
};

// make UBO with VAO
GLuint uboMeshState;
glGenBuffers(1, &uboMeshState);
glBindBuffer(GL_UNIFORM_BUFFER, uboMeshState);
glBufferData(GL_UNIFORM_BUFFER, sizeof(MeshRenderState), NULL, GL_DYNAMIC_DRAW);
glBindBufferBase(GL_UNIFORM_BUFFER, 0, uboMeshState);


void UpdateMeshUBO(int RenderFlag, float Alpha, float BlendMeshTexCoordU, float BlendMeshTexCoordV, float BlendMeshLight) {
    MeshRenderState state = { RenderFlag, Alpha, BlendMeshTexCoordU, BlendMeshTexCoordV, BlendMeshLight };
    glBindBuffer(GL_UNIFORM_BUFFER, uboMeshState);
    glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(MeshRenderState), &state);
    glBindBuffer(GL_UNIFORM_BUFFER, 0);
}

void BMD::RenderMesh(int i, int RenderFlag, float Alpha, float BlendMeshTexCoordU, float BlendMeshTexCoordV, float BlendMeshLight, int MeshTexture)
{
    if (i >= 0 && i < NumMeshs)
    {
        Mesh_t* m = &Meshs;
        if (m->NumTriangles == 0)
            return;

        int Texture = IndexTexture[m->Texture];
        if (MeshTexture != -1)
            Texture = MeshTexture;
        if (Texture == -1)
            return;

        // Update UBO before drawing
        UpdateMeshUBO(RenderFlag, Alpha, BlendMeshTexCoordU, BlendMeshTexCoordV, BlendMeshLight);


        glUseProgram(shaderProgram);

        GLfloat modelView[16];
        glGetFloatv(GL_MODELVIEW_MATRIX, modelView);
        glUniformMatrix4fv(glGetUniformLocation(shaderProgram, "uModelView"), 1, GL_FALSE, modelView);

        glActiveTexture(GL_TEXTURE0);
        glBindTexture(GL_TEXTURE_2D, Texture);
        glUniform1i(glGetUniformLocation(shaderProgram, "uTexture"), 0);

        glBindVertexArray(VAO);
        glDrawElements(GL_TRIANGLES, m->NumTriangles * 3, GL_UNSIGNED_INT, 0);
        glBindVertexArray(0);

        glUseProgram(0);
    }
}



Hi... Can you help me? Do I need to change something in (createOpemGlWindow) or in any render?


3
Sources Generales / Re: Shark Shield Antihack premium
« Posteado: November 15, 2023, 09:21:42 PM »
Files OFF

4
Sources Generales / Re: offsets FPS 1.05g
« Posteado: October 23, 2022, 12:46:30 PM »
not work in 1.05D :(((((((

5
Sources Generales / Re: offsets FPS 1.05g
« Posteado: October 23, 2022, 12:39:15 PM »
para main 1.05D?

6
Soporte / Ayudas / Re: HP/MP REAL VALUE
« Posteado: June 07, 2021, 12:18:29 PM »
send me private mensage

7
Sources Generales / Re: Source RePack KoshGames
« Posteado: June 07, 2020, 10:52:20 PM »
you have this source ?  Combo effect when killing 

 
<<<

8
Soporte / Ayudas / PEDIDO Pedido Source
« Posteado: June 03, 2020, 07:00:10 PM »
does anyone have any idea how it works?

¿Alguien tiene alguna idea de cómo funciona?







9
Sources Generales / Re: Source eX614 - MuEmu - By Emershow
« Posteado: May 31, 2020, 10:00:56 PM »
crash main equiped katana , mobs invisible dungeon , imp invisible .

10
Sources Generales / Re: Right Click Mouse
« Posteado: May 29, 2020, 05:05:29 PM »
to point in which .cpp or .h to put the proper code to help general!

11
Sources Generales / Re: Source eX614 - MuEmu - By Emershow
« Posteado: May 25, 2020, 07:50:47 PM »
e sobre o crash do main em lorencia ?

Paginas: [1]