#Shader Custom Function

1 messages · Page 1 of 1 (latest)

fiery hazel
#

I'm gonna use a thread not to clog up the chat

#

SO I have a Shader Graph I am using.

#

Take note, I am taking a Geometry Position (Object space), injecting pragmas, pay attention to: procedural:ConfigureProcedural, that is important for the next screen shots.

#

And here is the GraphPointGPU.hlsl contents:

#if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED)
    StructuredBuffer<float3> _Positions;
#endif

float _Step;

void ConfigureProcedural() {
    #if defined(UNITY_PROCEDURAL_INSTANCING_ENABLED)
        float3 position = _Positions[unity_InstanceID];
        
        UNITY_MATRIX_M = 0.0;
        UNITY_MATRIX_M._m03_m13_m23_m33 = float4(position, 1.0);
        UNITY_MATRIX_M._m00_m11_m22 = _Step;
    #endif
}

void ShaderGraphFunction_float (float3 In, out float3 Out) {
    Out = In;
}

void ShaderGraphFunction_half (half3 In, out half3 Out) {
    Out = In;
}