Skip to content

Refraction#39

Open
derek-mcblane wants to merge 5 commits into
jeffreypersons:mainfrom
derek-mcblane:feature-refraction
Open

Refraction#39
derek-mcblane wants to merge 5 commits into
jeffreypersons:mainfrom
derek-mcblane:feature-refraction

Conversation

@derek-mcblane
Copy link
Copy Markdown
Contributor

No description provided.

fixup rename arg in setBias
…lculations; update traceRay for refraction; make specular light color come from light not material; various updates to scenes
Comment thread src/LightIncidence.cpp
Comment on lines +56 to +59
float LightIncidenceFresnel::transmittedProportion() const
{
return transmittedProportion_;
}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this doesn't get used and should probably be removed

Comment thread src/Material.hpp
Comment on lines -27 to +29
Color ambientColor_;
Color diffuseColor_;
Color specularColor_;
float intrinsity_;
float reflectivity_;
float refractivity_;
float shininess_;
float transparency_;
float indexOfRefraction_;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are many ways to do this and I'd like some input

Comment thread src/Objects.cpp
result.t = t;
result.point = pointIntersectingPlane;
result.normal = planeNormal_;
result.normal = (Math::dot(ray.origin, planeNormal_) > 0.0f ? 1.0f : -1.0f) * planeNormal_;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might make sense to move this somewhere else since it's common for all intersections

Comment thread src/Objects.cpp

// recall, a point lies in a triangle if..
// (e0 x(R � P0)).n > 0 & (e1 x(R � P1)).n > 0 & (e2 x(R � P2)).n > 0
// (e0 x(R � P0)).n > 0 & (e1 x(R � P1)).n > 0 & (e2 x(R � P2)).n > 0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, should revert this

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mojibake

Comment thread src/RayTracer.hpp
void setBackgroundColor(const Color& backgroundColor);

Ray reflectRay(const Ray& ray, const Intersection& intersection) const;
void biasRayInDirection(Ray& ray, const Vec3& direction) const;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not so sure about mutating ray here

Comment thread src/RayTracer.cpp
outgoingRay = Ray{intersection.point, incidence.reflectedDirection()};
biasRayInDirection(outgoingRay, intersection.normal);
reflectedColor = traceRay(camera, scene, inObject, outgoingRay, depth + 1);
reflectedProportion = object_material.reflectivity() * incidence.reflectedProportion();
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idk if I'm really using 'reflectivity' in a way that makes sense.

@derek-mcblane derek-mcblane marked this pull request as ready for review January 11, 2025 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants