Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Volumetric Shader: Render Geometry Instead Of Cloud Of Points

Discussion in 'Shaders' started by SimonJ9, Mar 31, 2019.

  1. SimonJ9

    SimonJ9

    Joined:
    Feb 5, 2018
    Posts:
    17
    I have a file containing all the coordinates of vertices and I read them into an array of Vector3, and I'm currently rendering these points with a ray marching shader on a Texture3D of a cube mesh.

    I'm looking for a method to render the geometry those vertices are supposed to construct instead of the collection of points I currently have. Is there already a solution, or is there any suggested algorithm/similar solution to start with? Any suggestions will help, thanks in advance!
     
  2. Sh-Shahrabi

    Sh-Shahrabi

    Joined:
    Sep 28, 2018
    Posts:
    56
    Why do you need the geometry? I am doing something similar here. it might be of some help, since it is not as expensive as ray marching

    I am baking the vertices and their color in a texture (do this in C++ or python, C#+unity combo will take ages to compute bigger arrays) and using VFX graph I generate tons of quades which I place on the position of the vertex. It is not as good as a geometry, but you can even bake in normal maps and get actual lighting too.
     
    Seyed_Morteza_Kamaly likes this.
  3. SimonJ9

    SimonJ9

    Joined:
    Feb 5, 2018
    Posts:
    17
    Hi, thank you for your reply. I use ray marching to obtain slices of the object I'm trying to render. Maybe I don't need to generate the actual geometry. I'm trying to make the cloud of dots look like a relatively smooth mesh. Your work looks great! I know I'm must be missing something here.