Questions tagged [raytracing]

Questions specific to raytracing (as opposed to scanline rendering), the 3D graphics technique of intersecting rays from the camera with objects in the scene.

See also:

448 questions
12
votes
1 answer

Can I raytrace gravitational lensing using only a single point source of gravity?

I'd like to simulate the magnification of very distant objects by the lensing effect of a less distant galaxy. Will I need to model large numbers of point masses or can I get away with just a single average point mass? I can see how to raytrace…
11
votes
1 answer

Ray Tracing with Cones: coverage, overlapping and abutting triangles

In his classic paper Ray Tracing with Cones, John Amanatides describes a variation on classical ray tracing. By extending the concept of a ray by an aperture angle, making it a cone, aliasing effects (including those originating from too few Monte…
David Kuri
  • 2,293
  • 13
  • 32
9
votes
1 answer

Raytracing: why are the spheres in the image below appear stretched?

Some context. Above are the code and the resulting image for it in Peter Shirley's Raytracing in one weekend's book. As you can see from the code, he adds in some spheres. And yet in the final image there are 2 ellipsoids side by side. I just…
Manh Nguyen
  • 329
  • 3
  • 8
7
votes
1 answer

Ray tracing scene with 2 lights and sphere

I'm writing my implementation of ray tracer and I've got result which you can see at this image. So you can see that some dark parts are overlapping. And I have them even in the part where it should be bright in my opinion. There are two lights one…
7
votes
2 answers

Why are inverse transformations applied to rays rather than forward transformations to objects?

When computing ray-object intersections against a transformed object, most raytracers apply the inverse transform to each ray and compute the intersection against a non-transformed object. Wouldn't applying the forward transform, putting the object…
Mark
  • 1,612
  • 16
  • 22
6
votes
1 answer

Is there a way to do sphere caustics analytically?

I have a Shadertoy which renders the image below using ray tracing. I'd like to add caustics, but am aware that in general they are a hard solution, especially without bidirectional ray tracing or photon mapping. Does anyone know if there is a way…
Alan Wolfe
  • 7,801
  • 3
  • 30
  • 76
6
votes
1 answer

Controlling reflection and refraction with material properties in ray tracing

As tutors for this year’s programming languages course during our Computer Science studies we’re preparing for the students final project which is the implementation of a ray tracer. We’re implementing one on our own. I’m having trouble…
kleinfreund
  • 165
  • 1
  • 6
6
votes
2 answers

Low Pass filtering

Is it possible that low pass filtering can be applied to Ray tracing ? My guess is that since after the algorithm runs we have an image then low pass filtering helps in order to prevent aliasing from happening. Yet, I am not sure about this. Can…
john john
  • 423
  • 1
  • 3
  • 9
5
votes
1 answer

Grainy image in my simple ray tracer

The wall on the left of the red ball is perfectly reflective wall. In the first image there's a point light that lies on the plane of the reflective wall and in the second image, it's 0.01 units ahead of it. Due to the light being on the…
Newbie
  • 51
  • 2
5
votes
1 answer

Reduce kd-tree's nodes' bounding box sizes to their shapes' extents?

I've implemented a ray tracer that uses kd-trees for acceleration. To help debug kd-tree construction, I also created a crude OpenGL view of the same scene that shows the axis-aligned bounding boxes (AABBs) for each node in the tree (along with the…
4
votes
1 answer

Why is it easier to inverse transform every object in a scene than to transform a camera?

My lecturer for a computer graphics (raytracing) paper has stated that 'It is easier to apply the inverse transform to the world than it is to apply the transform to the camera.' The example given was that is it easier to shift all objects in a…
Laserbreath
  • 143
  • 4
4
votes
2 answers

Defocus blur: Computing the pixel plane distance

I'm following Peter Shirley book, Ray tracing in one weekend. In the last chapter, he talks about how to make defocus blur by using thin len approximation. His camera class accepts a parameter called focus_dist, which he then uses to compute the…
Manh Nguyen
  • 329
  • 3
  • 8
4
votes
1 answer

How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)?

What I'm trying to do is to simulate refraction through biconcave lens described by spheres A, B, C where C is a sphere in between A and B. So far I've gathered that a good approach would be to use CSG when it comes to modeling such object. I'm…
niksbenik
  • 85
  • 1
  • 6
4
votes
1 answer

Ray tracing pseudocode shadow

I don't understand the if (depth > MAX) return Black part. Does it have something to do with shadows, because in other algorithms they shoot a shadow ray towards the light source to check for shadows but they don't have it here?
user2976568
  • 157
  • 4
3
votes
2 answers

Need a fast ray-box intersection that handles if a ray is parallel and in line with a plane of the box

I've seen lots of spins on the ray-box intersection test, and a lot of them seem to boil down to this code: (omitting some details here) invRay.x = 1.0 / ray.x; tx1 = (box.min.x - rayOrigin.x) * invRay.x; tx2 = (box.max.x - rayOrigin.x) *…
Tyler Shellberg
  • 203
  • 1
  • 10
1
2 3 4