voxel | a simple voxel engine written in go with opengl | Graphics library

 by   boombuler Go Version: Current License: MIT

kandi X-RAY | voxel Summary

kandi X-RAY | voxel Summary

voxel is a Go library typically used in User Interface, Graphics applications. voxel has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

a simple voxel engine written in go with opengl
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              voxel has a low active ecosystem.
              It has 10 star(s) with 2 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              voxel has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of voxel is current.

            kandi-Quality Quality

              voxel has no bugs reported.

            kandi-Security Security

              voxel has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              voxel is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              voxel releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi has reviewed voxel and discovered the below as its top functions. This is intended to give you an instant insight into voxel implemented functionality, and help decide if they suit your requirements.
            • Performs a meshing with the given direction .
            • StartEngine starts the glog engine .
            • Read reads a Vox file model .
            • performCulling iterates over the given Chunk .
            • CreateMeshFromChunk creates a flat mesh from the given chunk .
            • loadModelFile loads a model file .
            • readSize is a helper function to read the size of a buffer .
            • readVoxels reads Voxels from a voxReader .
            • does notPerfomMeshing returns a slice of mesoshing
            • NewRenderedChunk returns a new Renderer .
            Get all kandi verified functions for this library.

            voxel Key Features

            No Key Features are available at this moment for voxel.

            voxel Examples and Code Snippets

            No Code Snippets are available at this moment for voxel.

            Community Discussions

            QUESTION

            image distance transform different xyz voxel sizes
            Asked 2021-Jun-15 at 02:32

            I would like to find minimum distance of each voxel to a boundary element in a binary image in which the z voxel size is different from the xy voxel size. This is to say that a single voxel represents a 225x110x110 (zyx) nm volume.

            Normally, I would do something with scipy.ndimage.morphology.distance_transform_edt (https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.ndimage.morphology.distance_transform_edt.html) but this gives the assume that isotropic sizes of the voxel:

            ...

            ANSWER

            Answered 2021-Jun-15 at 02:32

            Normally, I would do something with scipy.ndimage.morphology.distance_transform_edt but this gives the assume that isotropic sizes of the voxel:

            It does no such thing! You are looking for the sampling= parameter. From the latest version of the docs:

            Spacing of elements along each dimension. If a sequence, must be of length equal to the input rank; if a single number, this is used for all axes. If not specified, a grid spacing of unity is implied.

            The wording "sampling" or "spacing" is probably a bit mysterious if you think of pixels as little squares/cubes, and that is probably why you missed it. In most situations, it is better to think of pixels as point samples on a grid, with fixed spacing between samples. I recommend Alvy Ray's a pixel is not a little square for a better understanding of this terminology.

            Source https://stackoverflow.com/questions/67961571

            QUESTION

            Find and Replace number to NA in array R
            Asked 2021-Jun-09 at 16:35

            I have some NifTi files of brain images where there are lots of zeros that I want to replace with NAs but I'm not sure how to do it. I read in the description of the is.na() function that: "the generic function is.na<- sets elements to NA" so I thought I could use that, but it didn't work. Here is specifically what I tried:

            ...

            ANSWER

            Answered 2021-Jun-08 at 22:19

            Here are some possible option to replace 0 by NA

            Source https://stackoverflow.com/questions/67894954

            QUESTION

            A good way to serialize a known array of small structs
            Asked 2021-Jun-09 at 03:38

            I have a large array of small structs that I would like to serialize to file.

            The struct:

            ...

            ANSWER

            Answered 2021-Jun-08 at 08:52

            Assuming you're using a recent framework: spans are your friend. As a trivial way of writing them:

            Source https://stackoverflow.com/questions/67884211

            QUESTION

            Voxelization of STL-file; writing into np.array
            Asked 2021-Jun-07 at 15:29

            I would like to voxelise a .stl file and write it into an np.array. The resolution of the voxels should be adjustable. Here is my code for this:

            ...

            ANSWER

            Answered 2021-May-25 at 09:00

            If anyone ever has the same problem and is looking for a solution: This project worked for me: GitHub: stl-to-voxel

            The model is then also filled. If the maximum dimension is known, you can determine the exact voxel size via the resolution.

            Here is some code:

            Source https://stackoverflow.com/questions/67380124

            QUESTION

            How to convert vector (k1, k2) to RGBA (r, g, b, a) in volume?
            Asked 2021-May-18 at 08:29

            I have a 3d array representing a volume. Every voxel keeps a vector (k1, k2) as its local principle curvature.

            Now, I need to visualize this volume by color (just like the picture below). So I need to convert it to a RGBA volume. Is there any algorithm to implement transfer function from (k1, k2) to (r, g, b, a)? Thanks!

            ...

            ANSWER

            Answered 2021-May-12 at 06:52

            QUESTION

            Python voxelfuse can only concatenate str (not "int") to str
            Asked 2021-May-14 at 13:38

            I'm trying to generate a .vox represantation of my Prison Architect save file. I'm using a library called voxelfuse to generate the voxels and for some reason the union() method gives me a can only concatenate str (not "int") to str Here's my code:

            ...

            ANSWER

            Answered 2021-May-14 at 13:38

            Considering tiles is read from a file I believe the problem may be that tile['x'] and tile['y'] are strings and not integers. Try to transform them before passing them as arguments:

            Source https://stackoverflow.com/questions/67535038

            QUESTION

            How to downsample grid in OpenVDB
            Asked 2021-May-12 at 11:43

            Is there any good way to downsample voxels grid in OpenVDB?

            For example I have grid 8x8x8 with voxel size - 1.0, and I want to get grid 4x4x4 with voxel size - 2.0: each voxel of new grid is some interpolation of original voxels, e. g. [0,0,0] voxel of new grid is average value of [0,0,0]-[1,1,1] (8 voxels) of original grid)

            P.S. There is way to do it manually but I bet openvdb has its own implementation

            ...

            ANSWER

            Answered 2021-May-12 at 11:43

            The thing I was looking for is resampleToMatch

            Source https://stackoverflow.com/questions/67502680

            QUESTION

            marching cubes drawing triangles unity
            Asked 2021-May-08 at 21:29

            I am trying to implement marching cubes into my game, and so far I have set up a system for drawing triangles with four points in world space. I have got the system working where I set the points, but then when I draw the two triangles to make it a mesh, it only draws one, but I set up a print() statement, and it shows that 2 triangles are drawn each time, so that is normal. I can't figure out what I need to do. Here is my code, and comment on this post if you need any more pics/code:

            ...

            ANSWER

            Answered 2021-May-08 at 21:29

            I'm pretty sure your issue here is order.

            Unity uses a clockwise winding order. This means that

            • if you provide the triangles in clockwise order the normal will face towards you and you will see the triangle.

            • if you provide the triangle in counter-clockwise order the normal will face away from you and you will not see the triangle.

            Now looking at your code (at least as far as I can tell) your vertices look somewhat like

            Source https://stackoverflow.com/questions/67360593

            QUESTION

            Vulkan, what variables does an object need? As in a separate mesh that can be updated individually
            Asked 2021-Apr-30 at 15:52

            So I have been experimenting, and I can add a new "object" by adding every model in the scene to the same vertex buffer, but this isn't good for a voxel game because I don't want to have to reorganize the entire world's vertices every time a player destroys a block.

            And it appears I can also add a new "object" by creating a new vertex and index buffer for it, and simply binding both it and all other vertex buffers to the command buffers array at the same time like this:

            ...

            ANSWER

            Answered 2021-Apr-30 at 15:52

            You split your world into chunks, and draw one chunk at a time. All chunks have some space reserved for them in (a single) vertex buffer, and when something has changed, you only update that one chunk. If a chunk grows too large... Well, you will probably need some sort of a memory allocation system.

            Do NOT create separate buffers for every little thing. Buffers just hold data. Any data. You can even store different vertex formats for different pipelines in one same buffer - just in different places within it and binding it with an offset. Do not rebind just to draw a different mesh if all your vertices are packed neatly into array (they most likely are). If you want to only draw a part of a buffer - just use what draw commands give you.

            Command buffers are just a block of instructions for the gpu. You dont need one per object. However, one cannot be used and written to at the same time, so you will need at least one per frame in flight and one to write to. Pipelines(descriptor sets, and pretty much whatever else you bind) are just a bunch of state that your gpu starts using once you bind it. At the start of command buffer, the state is undefined - it is NOT inherited between command buffers in any way.

            Source https://stackoverflow.com/questions/67324713

            QUESTION

            How to get parallel GPU pixel rendering? For voxel ray tracing
            Asked 2021-Apr-28 at 03:07

            I made a voxel raycaster in Unity using a compute shader and a texture. But at 1080p, it is limited to a view distance of only 100 at 30 fps. With no light bounces yet or anything, I am quite disappointed with this performance.

            I tried learning Vulkan and the best tutorials are based on rasterization, and I guess all I really want to do is compute pixels in parallel on the GPU. I am familiar with CUDA and I've read that is sometimes used for rendering? Or is there a simple way of just computing pixels in parallel in Vulcan? I've already got a template Vulkan project that opens a blank window. I don't need to get any data back from the GPU just render straight to the screen after giving it data.

            And with the code below would it be significantly faster in Vulkan as opposed to a Unity compute shader? It has A LOT of if/else statements in it which I have read is bad for GPUs but I can't think of any other way of writing it.

            EDIT: I optimized it as much as I could but it's still pretty slow, like 30 fps at 1080p.

            Here is the compute shader:

            ...

            ANSWER

            Answered 2021-Apr-04 at 10:11

            Compute shader is what it is: a program that runs on a GPU, be it on vulkan, or in Unity, so you are doing it in parallel either way. The point of vulkan, however, is that it gives you more control about the commands being executed on GPU - synchronization, memory, etc. So its not neccesseraly going to be faster in vulkan than in unity. So, what you should do is actually optimise your shaders.

            Also, the main problem with if/else is divergence within groups of invocations which operate in lock-step. So, if you can avoid it, the performance impact will be far lessened. These may help you with that.

            If you still want to do all that in vulkan...

            Since you are not going to do any of the triangle rasterisation, you probably won't need renderpasses or graphics pipelines that the tutorials generally show. Instead you are going to need a compute shader pipeline. Those are far simplier than graphics pipelines, only requiring one shader and the pipeline layout(the inputs and outputs are bound via descriptor sets).

            You just need to pass the swapchain image to the compute shader as a storage image in a descriptor (and of course any other data your shader may need, all are passed via descriptors). For that you need to specify VK_IMAGE_USAGE_STORAGE_BIT in your swapchain creation structure.

            Then, in your command buffer you bind the descriptor sets with image and other data, bind the compute pipeline, and dispatch it as you probably do in Unity. The swapchain presentation and submitting the command buffers shouldn't be different than how the graphics works in the tutorials.

            Source https://stackoverflow.com/questions/66913186

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install voxel

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/boombuler/voxel.git

          • CLI

            gh repo clone boombuler/voxel

          • sshUrl

            git@github.com:boombuler/voxel.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link