Search Unity

Question Creating a volumetric shader on a vector field (Shadergraph)

Discussion in 'Shader Graph' started by Michael_Hutton, Oct 12, 2021.

  1. Michael_Hutton

    Michael_Hutton

    Joined:
    May 4, 2020
    Posts:
    9
    Hi all,

    I am in a bit of a head space mess. I've been doing a bit of reading around volumetric shaders. I have a basic knowledge of shades having written about 6 or 7 before and now a few in Unity's ShaderGraph.

    I am trying to figure out if there is a way of creating a shader from a Vector field ie a List<vector3> of points, without there being a mesh or rather a triangle list..(I am assuming you need a triangle list..) My project is modelling a shockwave and it's reflections off the ground and walls and I've got to a point where I can do this with a Fibonacci sphere with about 40000 vertices, casting rays out from an origin point and then calculating a point a distance (radius of shockwave) along the ray (can be reflected of surfaces). I end up with a list of Vectors and I deform a Fibonacci sphere mesh to these points and shade it with a lit two sided-translucent shader and it works great! No issues. It's amazing to see it bounce around a room.

    and then stupidly I thought (and it's been bugging me since)

    Can I shade this with a Volumetric shader to show a 'foggy' 'depthy' shockwave as it propagates out just from the Vector3 list? (with or without a triangle list in the mesh)

    I was wondering if anyone could point me in the right direction? Is this even possible?

    I know there are a few Shader geniuses here and would love to hear their thoughts! And thank you in advance if you reply :)