Skip to content

Instantly share code, notes, and snippets.

@gam0022
Last active November 3, 2018 06:35
Show Gist options
  • Save gam0022/fbce023b15254723e940975d5d6d7966 to your computer and use it in GitHub Desktop.
Save gam0022/fbce023b15254723e940975d5d6d7966 to your computer and use it in GitHub Desktop.
uRaymarching
struct GBufferOut
{
    half4 diffuse  : SV_Target0; // rgb: diffuse,  a: occlusion
    half4 specular : SV_Target1; // rgb: specular, a: smoothness
    half4 normal   : SV_Target2; // rgb: normal,   a: unused
    half4 emission : SV_Target3; // rgb: emission, a: unused
#ifndef DO_NOT_OUTPUT_DEPTH
    float depth    : SV_Depth;
#endif
};

struct RaymarchInfo
{
    // Input
    float3 startPos;
    float3 rayDir;
    float3 polyNormal;
    float minDistance;
    float maxDistance;
    int maxLoop;
    int loop;

    // Output
    float3 endPos;
    float lastDistance;
    float totalLength;
    float depth;
    float3 normal;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment