sap

Member
  • Content count

    4
  • Joined

  • Last visited

Community Reputation

115 Neutral

About sap

  • Rank
    Newbie
  1. thanks for the tip, i had no idea about that phenomenon.   works fine now, thanks a lot!
  2. Hello,   im trying to load the sponza scene using opengl and the assimp library. but some texture and models become full of artifacts when im looking from a far.   i create mipmaps for every texture in the scene. i create 1 VAO, 1 VBO and 1 IBO for each mesh in the scene (about 78 total according to opengldebugcallback message).   i clear color, depth and stencil every frame. i also set the culling mode as:   glEnable(GL_CULL_FACE); glFrontFace(GL_CCW);   but as you can see from the images, when im close the the lion head everything seems good, but i move away from it and i get all these issues. the same for the green and red textures on the walls (they look fine when close them).   also this bug doesnt happen with anything else like the walls, doors, windows, etc. is there something im missing?
  3. it works prefect now!   i forgot to write in my post that i did try to solve it to be negated and i did get the -1, -1 sum vector but for some reason i got -2,2 on the multiplication vector.. anyway thanks a lot!
  4. Hello,   so using gl_VertexID we can create a fullscreen triangle without using any vertex buffer, index buffer or vertex array. heres the code for the directx one: out_texture = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2); gl_Position = vec4(out_texture * vec2(2.0f, -2.0f) + vec2(-1.0f, 1.0f), 0.0f, 1.0f); please ignore the fact that i used gl_Position instead of whatever they use in directx.   anyway, we can just draw 3 vertices (glDrawArrays(GL_TRIANGLES, 0, 3)) and the vertex shader for each vertex will create a vertex position and UV coord. problem is, that vertex shader creates UV coords with [0,0] at top left instead of bottom left like opengl requires. so i think a change is needed when setting the gl_Position. if i understand correctly this is what happens: gl_VertexID = 0 makes out_texture = 0,0 and gl_Position = -1,1 (top left) and i want gl_Position = -1,-1 (bottom left) gl_VertexID = 1 makes out_texture = 2,0 and gl_Position = 3,1 (top right) and i want gl_Position = 3,-1 (bottom right) gl_VertexID = 2 makes out_texture = 0,2 and gl_Position = -1,-3 (bottom left) and i want gl_Position = -1,3 (top left) google is full of search results showing the directx vertex shader, but i cant find a single one using opengl.. any help is welcome.