Search Unity

Feature Request Object Position from vertex shader-stage to pixelcolor

Discussion in 'Shader Graph' started by olli_vrcoaster, Mar 11, 2020.

  1. olli_vrcoaster

    olli_vrcoaster

    Joined:
    Sep 1, 2017
    Posts:
    24
    Hey, i'd like to keep the original vertex.xyz from the vertex shader-stage and access it in the fragment shader-stage later.

    Let's say i have tree that i bent in vertex-position. And for the diffuse color i'd like to use the original xyz position of the straight tree. whenever i use a the position node(object) though i get the xyz data after vertex transformation.

    In regular shader programming i'd just pass a custom float3 from vertex to fragment shader and save the original xyz in there.

    Is there a way to do that with Shader Graph ?

    There's got to be some way to outsource some calculations to the vertex shader?! For mobile shader programming i believe there's quite a lot of performance impact if you can't do that anymore....