Home Marmoset

"rime flame" custom shader

weareape
polycounter lvl 7
Offline / Send Message
weareape polycounter lvl 7
I'm writing my first shader in tb3. i'm trying to recreate the rime flame that simon shared in his talk and am staying as close as i can to the material he was able to provide here.

https://www.youtube.com/watch?v=_mcXnb2tSa8&feature=youtu.be

Right now I am distorting the uv's by adding it to my main texture's texcoord. it's skewing it slightly but I can't figure out how to pass it in like I normal would. is there a way to do this?


Replies

  • weareape
    Offline / Send Message
    weareape polycounter lvl 7
    i've figured out most of the shader but i'm still having trouble with getting the panning distortion into the mask text correctly. on the left is what i have with distortion intensity at zero and on the right is what i should have with it at zero.

    Unity has a built in function called TRANSFORM_TEX. it passes in a scale bias on the texCoords that looks like this:
    <span>TRANSFORM_TEX(tex,name)&nbsp;(tex.xy&nbsp;*&nbsp;name##_ST.xy&nbsp;+&nbsp;name##_ST.zw)</span>
      tex is the name of the variable coming in and name is the name of the texture. any combination i've done so far hasn't given me what i've wanted yet. anyone have an idea?




  • weareape
    Offline / Send Message
    weareape polycounter lvl 7
    this is how i'm currently passing in the distortion. i can't figure out a "right way" to do it and any other combination breaks the shader. doesn't fix the texture looking squashed but did make it vertical like it should be.

    vec2 tc = finalDist.xy * s.vertexTexCoordSecondary.xy + s.vertexTexCoord.xy;


    https://www.youtube.com/watch?v=Qk3FgDzg2f8




Sign In or Register to comment.