Announcement

Collapse
No announcement yet.

Voxel Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    @HeadClot: In the case of not pre-generating the values with the noise generator, it's just a simple matter of displacing the distance in the USphereWorldGenerator class. You could add a USphereWorldGenerator to that class or inherit from it, and construct the generators with blueprints to easily play around with the values.

    Simple displacement can be done like this, tho I'm not recommending it if you've got a big world and the noise generator chain gets too complex. As you then move about with your character, it will again and again probe the noise values, so you should probably pre generate those values and then apply them, as recalculating the heights are a waste of resources and very costly.
    Code:
    float UPerlinSphereGenerator::GetDefaultValue(int X, int Y, int Z)
    {    
        float Alpha = -1.0f;
        float GeneratedPerlinHeight = 0.0f;
    
        if (UseNoiseGenerator) {
            NoiseGenerator = NoiseGenerator == nullptr ? NewObject<UUFNNoiseGenerator>() : NoiseGenerator;
            GeneratedPerlinHeight = NoiseGenerator->GetNoise2D(X, Y) * PerlinHeightMultiplier;
        }
    
        // Displace (fill) the ground up to the specified distance
        float Distance = FVector(X, Y, Z).Size() + GeneratedPerlinHeight;
        Alpha = FMath::Clamp(Distance - LocalRadius, -2.f, 2.f) / 2;
        Alpha *= HardnessMultiplier;
    
        return Alpha * (InverseOutsideInside ? -1 : 1);
    }
    Last edited by Wilken; 10-24-2017, 11:36 AM.

    Comment


      Phyronnaz Thank your for the help on the generated size, that helps a lot! Now, another question: when I went to test the voxel water, it ended up lagging quite a bit. I have a fairly powerful machine, so I'm wondering if the water lagging is just something that has to do with it being in the editor or if its currently lagging like that at all times. The reason being is that we ideally would be able to use the voxel water for an ocean that would be surrounding an island. Is that feasible with the Voxel water?

      On the note of islands, when using the VoxelLandscapeModifier, is there a limit to the physical size of the voxel landscape that you import? Specifically is the X and Y length of the imported VoxelLandscape determined by the size of the original heightmap used to create the landscape? Or is there an upper limit to the size for a single VoxelLandscapeModifier? I hope that I communicated that correctly.

      Comment


        Originally posted by Phyronnaz View Post
        @Filmburner Try upgrading to Visual Studio 2017, C4800 has been removed from it and this is the version I'm using (so I'm not getting the error).
        Ah, I see, only just saw this...

        I've fixed the problem code for 2015, would you like a copy of it? (is just in VoxelPolygonizer.cpp)

        Comment


          BinaryScrub
          I went to test the voxel water, it ended up lagging quite a bit
          For now water is just a proof of concept, and is implemented in quite a dirty way. I will improve it later. As for the ocean it depends on how great the final implementation will be.
          is there a limit to the physical size of the voxel landscape that you import? Specifically is the X and Y length of the imported VoxelLandscape determined by the size of the original heightmap used to create the landscape?
          The only limit in size is memory usage, and how long it takes to import it. For now the only option is a 1:1 scale, but I'll add a custom scale option soon.

          Wilken I think you would have better results if you were converting cartesian coordinates to spherical ones, as you would have continuity.
          Website: https://voxelplugin.com
          Discord: https://discord.voxelplugin.com
          Twitter: https://twitter.com/phyronnaz

          Comment


            Phyronnaz That is indeed true, and is what I'm working on! What I gave was just a simple (naiive) solution adopted from doing the same thing on a plane, not much else. I'm tinkering with a few coordinate systems and spheroid generation: I want to generate the spheroid by it's different semiminor axes using ellipsoids with both WGS84, geographic coordinates, geodetic surface normals and so on. I'd also like to be able to approximate paths of the curvature, but that's of course another multiple solutions problem.

            Representing a earth as a sphere is visually fine, and the moon even more so. But lots of other celestial objects are not very spherical at all, just look at phobos.

            Comment


              Btw Phyronnaz , it's pretty awesome of you to make this MIT licensed

              Comment


                Hi Phyronnaz , any plans to support 4.18? They refactored GetDetailsView method on IDetalLayoutBuilder for some upcoming changes, so it now returns a pointer ( just switching the dot for a -> doesn't work, as when i try to create a blueprint from the LandscapeWorldGenerator, the Landscape i set in the world when i converted it disappears and it is unsettable in the blueprint.

                I did fork the latest version in hopes that you might already have considered it, but in one of your latest changes even the VoxelChunkComponent(350) has got an error UpdateFromPreallocatedData doesn't take 2 parameters.

                Yeah, they did a lot of changes in the "right" places

                The reason why i upgraded to 4.18 is the volumetric lighting. I wanted to test the performance (as it should be quite faster) in large areas with no static lighting.

                Thanks

                Comment


                  whisper2shade I fixed the GetDetailsView & UpdateFromPreallocatedData errors, however all the functions defined with the FORCEINLINE macro are raising undefined symbol errors. I'm going to stay with 4.17 for now.
                  I've pushed those fixes on a 4.18 branch, as they are not compatible with 4.17.

                  ioFlow Studios Thanks

                  Wilken
                  I'd also like to be able to approximate paths of the curvature
                  What do you mean by "paths of the curvature"?
                  Website: https://voxelplugin.com
                  Discord: https://discord.voxelplugin.com
                  Twitter: https://twitter.com/phyronnaz

                  Comment


                    Originally posted by Phyronnaz View Post
                    whisper2shade I fixed the GetDetailsView & UpdateFromPreallocatedData errors, however all the functions defined with the FORCEINLINE macro are raising undefined symbol errors. I'm going to stay with 4.17 for now.
                    I've pushed those fixes on a 4.18 branch, as they are not compatible with 4.17.
                    Thanks for the new branch. It compiles and runs, unfortunately (i suspect because of the Epic refactor), i can't assign a landscape in the LandscapeVoxelAsset BP. I will try to play with it in the evening, but i'm not that experienced in UE to be confident to fix it soon.

                    Comment


                      whisper2shade LandscapeVoxelAsset doesn't work anymore. I will fix it soon.
                      Website: https://voxelplugin.com
                      Discord: https://discord.voxelplugin.com
                      Twitter: https://twitter.com/phyronnaz

                      Comment


                        VoxelAssets:


                        Landscape, Mesh and Spline Importers are all producing VoxelAssets, which allows for a more generic usage.

                        Mesh Importer doesn't use raycasts anymore, so it can be used on big mesh with high resolution (in the video I showcase this on the default UE table asset with VoxelSize = 1cm).

                        Landscape Importer supports up to 4096*4096 landscapes (weird glitches are showing beyond that, probably due to some UE Landscape optimizations).

                        VoxelAssets support runtime import with very little lag (could be reduced by doing import on another thread).


                        I'll add soon the possibility to spawn VoxelAssets procedurally in WorldGenerators.
                        Website: https://voxelplugin.com
                        Discord: https://discord.voxelplugin.com
                        Twitter: https://twitter.com/phyronnaz

                        Comment


                          Ambient Occlusion:

                          Screenshot: Unlit with material base color set to ambient occlusion (alpha component of vertex colors)

                          Don't know if it's really useful as it's relatively expensive to compute.
                          Website: https://voxelplugin.com
                          Discord: https://discord.voxelplugin.com
                          Twitter: https://twitter.com/phyronnaz

                          Comment


                            Originally posted by Phyronnaz View Post
                            Ambient Occlusion:

                            Screenshot: Unlit with material base color set to ambient occlusion (alpha component of vertex colors)

                            Don't know if it's really useful as it's relatively expensive to compute.
                            Wow, that looks really good Phyronnaz! Maybe a method might come to mind for you to speed it up some in the future. On the subject of improving visual quality, have you looked in to a sort of tessellation for the voxel terrain to improve the smooth look of it while using relatively low density voxel settings?

                            Comment


                              Encryption767 Haven't looked into that for now, but do you think it's really needed? I'm getting pretty good results and reasonable performance for a Voxel Size of 25 (80~120fps on a GTX 970). However I'll be interested to know how well it performs on other hardware


                              Website: https://voxelplugin.com
                              Discord: https://discord.voxelplugin.com
                              Twitter: https://twitter.com/phyronnaz

                              Comment


                                Originally posted by Phyronnaz View Post
                                Encryption767 Haven't looked into that for now, but do you think it's really needed? I'm getting pretty good results and reasonable performance for a Voxel Size of 25 (80~120fps on a GTX 970). However I'll be interested to know how well it performs on other hardware
                                Tomorrow I will test it out on my system. I have a i7 4820k with 32gb ram and a 1080gtx. For one person playing around in the world I would say voxel size of 25 would be fine but lets think for a min of around 8 - 10 players on a world with the game having to keep all of the clients updated with changes in the terrain as well as simulating everything else. Actual game environment with AI, physics and nice eye candy ect.

                                I have ordered an Asus zenith extreme mobo and a 1950x Threadripper with 32gb of ddr4 memory. I am hoping to get some performance increases with that set up but many people still use quad core i5's to game on so there is that too.

                                Edit: Could you push that map you tested your performance on to GitHub?

                                Comment

                                Working...
                                X