Created
May 12, 2017 05:19
-
-
Save iondune/4626a6e8990e8ab729b4695a431eaebc to your computer and use it in GitHub Desktop.
Sample struct to make raytracer diagnostics possible.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SPixelContext | |
{ | |
enum class EIterationType | |
{ | |
Primary = 0, | |
Reflection = 1, | |
Refraction = 2 | |
}; | |
struct SShadowInfo | |
{ | |
ray3f Ray; | |
bool Hit = false; | |
}; | |
struct SIteration | |
{ | |
EIterationType Type = EIterationType::Primary; | |
ray3f Ray; | |
CObject const * HitObject = nullptr; | |
vec3f HitPoint; | |
vec3f HitNormal; | |
float HitTime = 0; | |
vector<SShadowInfo> ShadowRays; | |
color3f Ambient; | |
color3f Diffuse; | |
color3f Specular; | |
string ExtraInfo; | |
SIteration * Parent = nullptr; | |
}; | |
vector<SIteration *> Iterations; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment