Search Unity

Distortion of the coordinate system along a spline ( for raymarching )

Discussion in 'General Graphics' started by Alesk, May 21, 2021.

  1. Alesk

    Alesk

    Joined:
    Jul 15, 2010
    Posts:
    340
    Hi,

    I'm working on project where I have a transparent pipe mesh extruded along a sinuous spline.

    I would like to render and animate some kind of elongated slug bubbles inside it, moving along the path defined by the spline, using raymarching.

    What I have in mind is conforming the 3D texture coordinates to the "spline space".
    In this case, I just would have to move the bubble along the Z axis to get it flow and deform along the spline, since the coordinates system would be distorted.

    I already have the oriented points along my spline to define the up, right and forward vectors, and these data baked into textures ready to use in a shader.

    But I have no clue on how to use them properly to realize this... if it's doable.

    Any hint will be gladly appreciated ;)