summaryrefslogtreecommitdiffstats
path: root/tests/fcpw/ray.slang
blob: f12664ed767349a323d24701290165b3cab9bd7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
implementing fcpw;

public struct Ray
{
    public float3 o;    // ray origin
    public float3 d;    // ray direction
    public float3 dInv; // 1 over ray direction (coordinate-wise)
    public float tMax;  // max ray distance

    // constructor
    public __init(float3 o_, float3 d_, float tMax_)
    {
        o = o_;
        d = d_;
        dInv = float3(1.0, 1.0, 1.0) / d_;
        tMax = tMax_;
    }
};