marching | A JavaScript library that compiles GLSL ray marchers | Graphics library

 by   charlieroberts JavaScript Version: 1.1.4 License: MIT

kandi X-RAY | marching Summary

kandi X-RAY | marching Summary

marching is a JavaScript library typically used in User Interface, Graphics, WebGL applications. marching has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i marching' or download it from GitHub, npm.

Marching.js is a JavaScript shader compiler specifically focused on ray marching via signed distance functions. The goals of this project are:. Marching.js builds on the work of many other people.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              marching has a low active ecosystem.
              It has 164 star(s) with 8 fork(s). There are 12 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 3 have been closed. On average issues are closed in 19 days. There are 5 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of marching is 1.1.4

            kandi-Quality Quality

              marching has 0 bugs and 0 code smells.

            kandi-Security Security

              marching has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              marching code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              marching 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

              marching releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of marching
            Get all kandi verified functions for this library.

            marching Key Features

            No Key Features are available at this moment for marching.

            marching Examples and Code Snippets

            No Code Snippets are available at this moment for marching.

            Community Discussions

            QUESTION

            Marching Cubes - Getting Skewed Surfaces
            Asked 2021-Jun-01 at 16:56

            I tried to plot all the iso-surfaces generated by the Marching cube LUT by Paul Brouke (http://paulbourke.net/geometry/polygonise/). I chose the vertices to be the midpoint of the edges by the triTable LUT. I am getting these highly skewed surfaces, I am trying to figure out if I am making any error. Here is the matlab code for that.

            The results I am getting do not appear to be symmetries of the 14 unique configurations that MC is supposed to provide.. I would like to know where I am going wrong.. I am sure the LUT is right because the source has been used widely..

            ...

            ANSWER

            Answered 2021-Jun-01 at 16:55

            I had made a silly mistake of defining the EdgeConnection and vertexList in different numbering notations... I have now edited the code in the question it now works

            Thanks a lot to @Ander Biguri for pointing me in the right direction during the debugging

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

            QUESTION

            How to make a slide when the screen is zoomed out?
            Asked 2021-May-13 at 20:08

            ...

            ANSWER

            Answered 2021-May-13 at 20:08

            If you want a media query like solution for javascript you have to listen for the resize event with an event listener and call the slide function showSlides() in it. In the slide function you have to wrap the code in the if statement that asks for window.innerWidth. Additionally you have to define an else block for showing the images again.

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

            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

            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

            QUESTION

            longestSubstring python solution what does it mean --> for t in s.split(c)
            Asked 2021-Apr-17 at 09:17

            I have been studying leetCode and I ran into this problem: Given a string s and an integer k, return the length of the longest substring of s such that the frequency of each character in this substring is greater than or equal to k.

            The most elegant solution so far is below but I don't understand

            A: What is it trying to do

            ...

            ANSWER

            Answered 2021-Apr-16 at 20:52

            If c == 'b', s.split(c) splits the input into

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

            QUESTION

            Not sure how to properly use Matrix4.LookAt in this situation
            Asked 2021-Feb-15 at 06:23

            I am experimenting with ray marching, and have been following Jamie Wong's tutorial.

            When the moving the camera section comes, they use the function

            ...

            ANSWER

            Answered 2021-Feb-15 at 06:23

            OpenTK offers the data types Vector3, Vector4 and Matrix4 in the OpenTK.Mathematics namespace.

            Assuming you have the vectors:

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

            QUESTION

            How to change opacity in Javascript for object
            Asked 2020-Dec-23 at 05:51

            Found code here for metaballs using vanilla javascript. Is there a way I can change the opacity of the metaballs? I think it should be a quick fix but im not too sure. I tried changing to CSS class bubbles but that didnt work so im assuming in needs to be in the Javascript. Anything helps, thanks.

            Found code here for metaballs using vanilla javascript. Is there a way I can change the opacity of the metaballs? I think it should be a quick fix but im not too sure. I tried changing to CSS class bubbles but that didnt work so im assuming in needs to be in the Javascript. Anything helps, thanks.

            ...

            ANSWER

            Answered 2020-Dec-23 at 05:42

            You can do it by changing the context alpha channel with RGBA (see at the very bottom ctx.fillStyle = 'rgba(0, 0, 255, 0.5)' // NEW! where 0.5 is the level of opacity - see ) :

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

            QUESTION

            How to get the TF-IDF scores as well for the most important words?
            Asked 2020-Nov-12 at 15:59

            I am working on a project with tf-idf, I have a column (df['liststring']) in my dataframe that contains the preprocessed text (without punctuation, stop words, etc.) from my various documents.

            I ran the following code, and I got the top 10 words with the highest tf-idf values but I would like to see their scores as well.

            ...

            ANSWER

            Answered 2020-Nov-12 at 15:59
            df_tfidf['top10'] = [[(reverse_vocab.get(item), X_tfidf[i, item])  for item in row] 
                                 for i, row in enumerate(tfidf_max10) ]
            

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

            QUESTION

            Get the contour (outline) from a png image with the correct edges
            Asked 2020-Oct-05 at 00:57

            I have multiple png files and I'm trying to get the polygon contour coordinates. That is the simplified coordinates, only each outer corner (not a convex hull polygon).

            The program that will do this at the moment is python and opencv. But another program is oke I did try to fix this using npm packages, imagemagick, potrace, Lua. It will be uses as a shell command in a 'build polygons from images' process.

            This was the last test under python.

            The problem now is the that some edges are 'not' correct in the example below.

            I did the following steps

            • Convert the alpha to black and white
            • Trace the contour
            • Get the coordinates
            1. The original png file contains black lines (keep them).

            1. Converted black and white image (you can't see the top line, because this website have a white background)
            ...

            ANSWER

            Answered 2020-Oct-05 at 00:57
            Desired Output: Vector Graphic

            The points, lines, and curves in a vector graph may be scaled up or down to any resolution with no aliasing. As such you will not see the broken corners. Suppose the output is a vector graph in SVG format. The corners can be visualized nicely by converting each contour to an SVG polygon. You may refer to here for three choices to render the corners. I also add a function add_pixel_fillers to adjust close enough points.

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

            QUESTION

            Unity Mesh UV problem on the positive and negative x-axis on perpendicular walls
            Asked 2020-Sep-24 at 11:35

            I am trying to make a 3D-voxel game that uses the marching cubes algorithm to procedurally generate a game world. This is working fine so far, except that, on exactly perpendicular sides on the positive and negative x sides of a given perpendicular piece of the world/chunk mesh, it looks like the uv coordinates aren't quite right as it just displays a solid color instead of the texture. [![view of debug-chunks and the buggy sides][1]][1]

            At <2.> you can see the chunk wall how it is supposed to look like and at <1.> you can see the weird bug. This ONLY occurs on exactly perpendicular x-side triangles! Those meshes in the image are debug-chunks to show the problem. All the noise-to-terrain translation works fine and I don't get any bugs there. It's only the uvs that cause problems. I am using the following code to populate the Mesh.vertices, Mesh.triangles and Mesh.uv:

            ...

            ANSWER

            Answered 2020-Sep-24 at 11:35

            Well, it turns out that this probably is some weird behavior from unity. When explicitly setting the mesh after the mesh population process as the meshFilters' mesh, it works just fine. Also, I had to call mesh.RecalculateTangents() to make it work.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install marching

            You can install using 'npm i marching' or download it from GitHub, npm.

            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
            Install
          • npm

            npm i marching

          • CLONE
          • HTTPS

            https://github.com/charlieroberts/marching.git

          • CLI

            gh repo clone charlieroberts/marching

          • sshUrl

            git@github.com:charlieroberts/marching.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

            Explore Related Topics

            Consider Popular Graphics Libraries

            three.js

            by mrdoob

            pixijs

            by pixijs

            pixi.js

            by pixijs

            tfjs

            by tensorflow

            filament

            by google

            Try Top Libraries by charlieroberts

            interface.js

            by charlierobertsJavaScript

            Control

            by charlierobertsJavaScript

            genish.js

            by charlierobertsJavaScript

            gibber.audio.lib

            by charlierobertsJavaScript

            p5.gibber.js

            by charlierobertsJavaScript