Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: Libgdx 3D Doom style help!

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2016
    Posts
    11

    Libgdx 3D Doom style help!

    Hello so, I'm trying to make a 3D engine like prelude of the Chambered, however I am having a few issues
    I want to make animations on tiles however the mesh is static, now I could make the mesh dynamic and every frame rebuild it (giving it new texture coords) however I feel like there is a better way of doing this

    The current way I am making the map is by going through each pixel of an image and if its black then its not a wall else is a wall, and im rendering all into one mesh.

    [My current solution to my problem is]
    What if i split up the mesh into parts of meshes for example a static mesh which is stuff which will always be there and the dynamic mesh which will have to change every frame... Is this correct? Am i doubting my method?

    -------------------------------------------------------------------

    Also on another note, I've had trouble with implementing shaders in the 3D api while creating a custom mesh as all i wanted is FOG including everything that Libgdx provides, now would it be better to make a custom shader which will mean re-building the rendering api or what i have done which is copy the shader code from libgdx docs and just add the fog in ---- which is what you see in the image below?

    So far I have this
    Click image for larger version. 

Name:	hh.jpg 
Views:	75 
Size:	20.1 KB 
ID:	2403

  2. #2
    Member Regular Contributor
    Join Date
    Jul 2012
    Posts
    429
    All of this looks very confused.

    Doom was using BSPs intensively. It allows to split out walls in order to render only what is visible.
    Here is another link and another one.
    I really advise you to have a deep look and understanding of them.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,528
    Quote Originally Posted by tommohawkaction View Post
    What if i split up the mesh into parts of meshes for example a static mesh which is stuff which will always be there and the dynamic mesh which will have to change every frame... Is this correct?
    If you are going to be changing attributes for some vertices and not others, it makes sense to separate dynamic faces from static faces. Otherwise you're faced with a choice between a single update which uploads more data than is strictly necessary, or many small updates. Neither of those are efficient. The dynamic faces should use a separate draw call so that you don't have to modify the texture coordinates in place (which will cause a pipeline stall).

    The other option is to not modify the texture coordinates, but to add additional vertex attributes which describe how the texture coordinates change with time, then calculate the texture coordinates in the vertex shader.

  4. #4
    Junior Member Newbie
    Join Date
    Jul 2016
    Posts
    11
    Quote Originally Posted by Silence View Post
    All of this looks very confused.

    Doom was using BSPs intensively. It allows to split out walls in order to render only what is visible.
    Here is another link and another one.
    I really advise you to have a deep look and understanding of them.
    Yeah sorry Slience, I didn't mean the whole engine bit by bit.. What i meant was the same look but using modern techniques. Thanks for your reply though

  5. #5
    Junior Member Newbie
    Join Date
    Jul 2016
    Posts
    11
    Quote Originally Posted by GClements View Post
    If you are going to be changing attributes for some vertices and not others, it makes sense to separate dynamic faces from static faces. Otherwise you're faced with a choice between a single update which uploads more data than is strictly necessary, or many small updates. Neither of those are efficient. The dynamic faces should use a separate draw call so that you don't have to modify the texture coordinates in place (which will cause a pipeline stall).

    The other option is to not modify the texture coordinates, but to add additional vertex attributes which describe how the texture coordinates change with time, then calculate the texture coordinates in the vertex shader.
    Okay that makes sense, so for a smallish level/dungeon would you suggest splitting the mesh into two, one being static (Where nothing changes) and one being dynamic (Changing texture coords) and every frame recreate the dynamic mesh?

  6. #6
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,528
    Quote Originally Posted by tommohawkaction View Post
    Okay that makes sense, so for a smallish level/dungeon would you suggest splitting the mesh into two, one being static (Where nothing changes) and one being dynamic (Changing texture coords) and every frame recreate the dynamic mesh?
    Well, there's no need to recreate the entire mesh; you just need to change the texture coordinates. See this page for techniques for doing so efficiently.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •