New answers tagged raytracing
2
I solved this.
The bright color is look like rectangle because the light that is reflected by Lambertian material is scattered randomly in unit cube (with center is the unit normal) . I fixed this by just allow ray is scattered randomly point in unit sphere.
Final result
Example code :
Function to generate random vector
vec3 random(float min, float max)
{
...
Top 50 recent answers are included
Related Tags
raytracing × 78raycasting × 12
opengl × 11
c++ × 9
3d × 8
mathematics × 7
rendering × 7
collision-detection × 5
aabb × 5
unity × 4
textures × 4
graphics × 4
glsl × 4
lighting × 4
shadows × 4
intersection × 4
2d × 3
rotation × 3
hlsl × 3
3d-meshes × 3
coordinates × 3
c × 3
reflection-rendering × 3
c# × 2
java × 2