What are the pros and cons of using a heightmap vs a model in 3D games












1















I am learning how to program an OpenGL game engine in Java. I've done loading models from files already but next up is heightmaps and I'm wondering what are the benefits of using a heightmap to generate 3D terrain as opposed to a list of Z-axis values or a 3D model? Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?



Some that I can think of:



Heightmap pros:




  • Smaller file, since the game will generate it into memory at runtime.

  • More optimized algorithms for manipulation of an n^2 image?

  • Easier procedural generation.


Heightmap cons:




  • Problem with steep angles and overhangs are impossible.

  • Don't seem to be as accurate as models.

  • Are they that helpful for making terrain if you aren't procedurally generating it?










share|improve this question



























    1















    I am learning how to program an OpenGL game engine in Java. I've done loading models from files already but next up is heightmaps and I'm wondering what are the benefits of using a heightmap to generate 3D terrain as opposed to a list of Z-axis values or a 3D model? Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?



    Some that I can think of:



    Heightmap pros:




    • Smaller file, since the game will generate it into memory at runtime.

    • More optimized algorithms for manipulation of an n^2 image?

    • Easier procedural generation.


    Heightmap cons:




    • Problem with steep angles and overhangs are impossible.

    • Don't seem to be as accurate as models.

    • Are they that helpful for making terrain if you aren't procedurally generating it?










    share|improve this question

























      1












      1








      1


      0






      I am learning how to program an OpenGL game engine in Java. I've done loading models from files already but next up is heightmaps and I'm wondering what are the benefits of using a heightmap to generate 3D terrain as opposed to a list of Z-axis values or a 3D model? Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?



      Some that I can think of:



      Heightmap pros:




      • Smaller file, since the game will generate it into memory at runtime.

      • More optimized algorithms for manipulation of an n^2 image?

      • Easier procedural generation.


      Heightmap cons:




      • Problem with steep angles and overhangs are impossible.

      • Don't seem to be as accurate as models.

      • Are they that helpful for making terrain if you aren't procedurally generating it?










      share|improve this question














      I am learning how to program an OpenGL game engine in Java. I've done loading models from files already but next up is heightmaps and I'm wondering what are the benefits of using a heightmap to generate 3D terrain as opposed to a list of Z-axis values or a 3D model? Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?



      Some that I can think of:



      Heightmap pros:




      • Smaller file, since the game will generate it into memory at runtime.

      • More optimized algorithms for manipulation of an n^2 image?

      • Easier procedural generation.


      Heightmap cons:




      • Problem with steep angles and overhangs are impossible.

      • Don't seem to be as accurate as models.

      • Are they that helpful for making terrain if you aren't procedurally generating it?







      java opengl 3d-rendering






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 25 '18 at 11:45









      AlthaenAlthaen

      396




      396
























          1 Answer
          1






          active

          oldest

          votes


















          0














          If you refer to a gray-scale/rgb/rgba image with height-values as heightmap, then you are mostly right.




          list of Z-axis values




          You can store your values however you want, you can even serialize/deserealize them, the only difference is that the image format is universal and is used in all the 3d software. So you probably want to make your pipeline based on the image heightmap format since you probably won't generate heightmaps procedurally yourself and will import them from some kind of 3d-software.




          3D model




          Heightmaps can be used only when f(x,z) has got one value. In this case I believe there's no reason to use 3d meshes instead of heightmaps.




          Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?




          No, LOD and other stuff depends only on your implementation. It's just that in heightmaps you use 8 bits(grayscale) / 24 bits(RGB) / 32 bits(RGBA) per vertex and with 3d model you use 3x32 bits per vertex.



          So, basically, heightmaps are used just to save some memory / importing expanses. And they are probably easier to generate, but I am not a 3d modeler so can't say for sure.






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467097%2fwhat-are-the-pros-and-cons-of-using-a-heightmap-vs-a-model-in-3d-games%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If you refer to a gray-scale/rgb/rgba image with height-values as heightmap, then you are mostly right.




            list of Z-axis values




            You can store your values however you want, you can even serialize/deserealize them, the only difference is that the image format is universal and is used in all the 3d software. So you probably want to make your pipeline based on the image heightmap format since you probably won't generate heightmaps procedurally yourself and will import them from some kind of 3d-software.




            3D model




            Heightmaps can be used only when f(x,z) has got one value. In this case I believe there's no reason to use 3d meshes instead of heightmaps.




            Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?




            No, LOD and other stuff depends only on your implementation. It's just that in heightmaps you use 8 bits(grayscale) / 24 bits(RGB) / 32 bits(RGBA) per vertex and with 3d model you use 3x32 bits per vertex.



            So, basically, heightmaps are used just to save some memory / importing expanses. And they are probably easier to generate, but I am not a 3d modeler so can't say for sure.






            share|improve this answer






























              0














              If you refer to a gray-scale/rgb/rgba image with height-values as heightmap, then you are mostly right.




              list of Z-axis values




              You can store your values however you want, you can even serialize/deserealize them, the only difference is that the image format is universal and is used in all the 3d software. So you probably want to make your pipeline based on the image heightmap format since you probably won't generate heightmaps procedurally yourself and will import them from some kind of 3d-software.




              3D model




              Heightmaps can be used only when f(x,z) has got one value. In this case I believe there's no reason to use 3d meshes instead of heightmaps.




              Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?




              No, LOD and other stuff depends only on your implementation. It's just that in heightmaps you use 8 bits(grayscale) / 24 bits(RGB) / 32 bits(RGBA) per vertex and with 3d model you use 3x32 bits per vertex.



              So, basically, heightmaps are used just to save some memory / importing expanses. And they are probably easier to generate, but I am not a 3d modeler so can't say for sure.






              share|improve this answer




























                0












                0








                0







                If you refer to a gray-scale/rgb/rgba image with height-values as heightmap, then you are mostly right.




                list of Z-axis values




                You can store your values however you want, you can even serialize/deserealize them, the only difference is that the image format is universal and is used in all the 3d software. So you probably want to make your pipeline based on the image heightmap format since you probably won't generate heightmaps procedurally yourself and will import them from some kind of 3d-software.




                3D model




                Heightmaps can be used only when f(x,z) has got one value. In this case I believe there's no reason to use 3d meshes instead of heightmaps.




                Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?




                No, LOD and other stuff depends only on your implementation. It's just that in heightmaps you use 8 bits(grayscale) / 24 bits(RGB) / 32 bits(RGBA) per vertex and with 3d model you use 3x32 bits per vertex.



                So, basically, heightmaps are used just to save some memory / importing expanses. And they are probably easier to generate, but I am not a 3d modeler so can't say for sure.






                share|improve this answer















                If you refer to a gray-scale/rgb/rgba image with height-values as heightmap, then you are mostly right.




                list of Z-axis values




                You can store your values however you want, you can even serialize/deserealize them, the only difference is that the image format is universal and is used in all the 3d software. So you probably want to make your pipeline based on the image heightmap format since you probably won't generate heightmaps procedurally yourself and will import them from some kind of 3d-software.




                3D model




                Heightmaps can be used only when f(x,z) has got one value. In this case I believe there's no reason to use 3d meshes instead of heightmaps.




                Does it depend on the detail of the terrain or is it just more efficient to use a heightmap?




                No, LOD and other stuff depends only on your implementation. It's just that in heightmaps you use 8 bits(grayscale) / 24 bits(RGB) / 32 bits(RGBA) per vertex and with 3d model you use 3x32 bits per vertex.



                So, basically, heightmaps are used just to save some memory / importing expanses. And they are probably easier to generate, but I am not a 3d modeler so can't say for sure.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 26 '18 at 9:56

























                answered Nov 26 '18 at 7:39









                user3051029user3051029

                165112




                165112






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53467097%2fwhat-are-the-pros-and-cons-of-using-a-heightmap-vs-a-model-in-3d-games%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Lallio

                    Unable to find Lightning Node

                    Futebolista