Refraction#39
Open
derek-mcblane wants to merge 5 commits into
Open
Conversation
fixup rename arg in setBias
…lculations; update traceRay for refraction; make specular light color come from light not material; various updates to scenes
derek-mcblane
commented
Nov 1, 2022
Comment on lines
+56
to
+59
| float LightIncidenceFresnel::transmittedProportion() const | ||
| { | ||
| return transmittedProportion_; | ||
| } |
Contributor
Author
There was a problem hiding this comment.
I think this doesn't get used and should probably be removed
derek-mcblane
commented
Nov 1, 2022
Comment on lines
-27
to
+29
| Color ambientColor_; | ||
| Color diffuseColor_; | ||
| Color specularColor_; | ||
| float intrinsity_; | ||
| float reflectivity_; | ||
| float refractivity_; | ||
| float shininess_; | ||
| float transparency_; | ||
| float indexOfRefraction_; |
Contributor
Author
There was a problem hiding this comment.
I think there are many ways to do this and I'd like some input
derek-mcblane
commented
Nov 1, 2022
| result.t = t; | ||
| result.point = pointIntersectingPlane; | ||
| result.normal = planeNormal_; | ||
| result.normal = (Math::dot(ray.origin, planeNormal_) > 0.0f ? 1.0f : -1.0f) * planeNormal_; |
Contributor
Author
There was a problem hiding this comment.
Might make sense to move this somewhere else since it's common for all intersections
derek-mcblane
commented
Nov 1, 2022
|
|
||
| // 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 |
Contributor
Author
There was a problem hiding this comment.
Weird, should revert this
derek-mcblane
commented
Nov 1, 2022
| void setBackgroundColor(const Color& backgroundColor); | ||
|
|
||
| Ray reflectRay(const Ray& ray, const Intersection& intersection) const; | ||
| void biasRayInDirection(Ray& ray, const Vec3& direction) const; |
Contributor
Author
There was a problem hiding this comment.
Not so sure about mutating ray here
derek-mcblane
commented
Nov 1, 2022
| outgoingRay = Ray{intersection.point, incidence.reflectedDirection()}; | ||
| biasRayInDirection(outgoingRay, intersection.normal); | ||
| reflectedColor = traceRay(camera, scene, inObject, outgoingRay, depth + 1); | ||
| reflectedProportion = object_material.reflectivity() * incidence.reflectedProportion(); |
Contributor
Author
There was a problem hiding this comment.
Idk if I'm really using 'reflectivity' in a way that makes sense.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.