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.

Filter by
Sorted by
Tagged with
30
votes
2answers
9k views

Why does monte carlo ray tracing perform better than distributed ray tracing?

I've heard that the quality of a monte carlo ray tracer (based on path tracing algorithms) is much more realistic than a distributed (stochastic) engine. I try to understand why, but I'm just at the ...
26
votes
2answers
16k views

What is Ray Marching? Is Sphere Tracing the same thing?

A lot of ShaderToy demos share the Ray Marching algorithm to render the scene, but they are often written with a very compact style and i can't find any straightforward examples or explanation. So ...
26
votes
2answers
3k views

Path tracing the Cook-Torrance BRDF

-- Sorry for the long post, but I prefer to do that way because "Devil is in the details." :) I am writing a path tracer from the scratch and it is working nicely for perfectly diffuse (Lambertian) ...
20
votes
1answer
2k views

Anti-aliasing / Filtering in Ray Tracing

In ray tracing / path tracing, one of the simplest way to anti-alias the image is to supersample the pixel values and average the results. IE. instead of shooting every sample through the center of ...
19
votes
1answer
4k views

Why is recursion forbidden in OpenCL?

I'd like to use OpenCL to accelerate rendering of raytraced images, but I notice that the Wikipedia page claims that recursion is forbidden in Open CL. Is this true? As I make extensive use of ...
18
votes
4answers
2k views

How to raytrace Bezier surfaces?

I tried this question on math.SE and surprisingly, the answer was "the equations are too nasty, just feed the function it to a numerical root-finder". But if you consider yourself "a graphics guy" ...
18
votes
2answers
586 views

How do correlated samples influence the behavior of a Monte Carlo renderer?

Most descriptions of Monte Carlo rendering methods, such as path tracing or bidirectional path tracing, assume that samples are generated independently; that is, a standard random number generator is ...
16
votes
2answers
921 views

Subpixel Rendering for a Ray Tracer

In font rendering, it is common to use subpixel rendering. The basic idea here is to break the pixel into its RGB components and then compute a value for each separately. Since each component is ...
15
votes
3answers
2k views

What's the current state-of-the-art algorithm for ray-tracing height-fields?

There have been lots of papers over the years on different techniques for drawing height-field terrain in a ray-tracer. Some algorithms ray-march the grid directly (or via a quadtree); others ...
13
votes
2answers
1k views

How to build a decent lens/camera objective model for path tracing?

I have written a small path-tracer after learning and experimenting on smallpt. The only thing that I did not write (and understood) myself is how the initial rays are computed and fired from the ...
13
votes
3answers
882 views

Non Real Time Raytracing

I've played with real time raytracing (and raymarching etc) quite a bit, but haven't spent that much time on non real time raytracing - for higher quality images or for pre-rendering videos and the ...
12
votes
1answer
4k views

Progressive Path Tracing with Explicit Light Sampling

I understood the logic behind the importance sampling for the BRDF part. However, when it comes to sampling light sources explicitly, all becomes confusing. For example, if I have one point light ...
12
votes
1answer
6k views

Radiosity VS Ray tracing

Radiosity is basically what allows this: In a tutorial of Cornell University about Radiosity it is mentioned that: A ray-traced version of the image shows only the light reaching the viewer by ...
12
votes
2answers
317 views

Ray Transformation to Object Space for Motion Blur

My raytracer supports a wide variety of objects. To intersect them, I use the standard technique of transforming rays into object-space. This works fantastically until I add motion blur. I model ...
12
votes
1answer
271 views

Polarising reflection and refraction for a wrap around water surface

I want to render realistic images of water in an orbiting space habitat. The image does not need to be generated in real time, although I wouldn't want it to take weeks either. I'm looking for an ...
11
votes
3answers
8k views

How is Anti Aliasing Implemented in Ray Tracing?

After reading a few articles online I am can confidently say I am clueless on how Anti-Aliasing works when Ray Tracing. All I understand is that A Single Pixel/Ray is split into 4 sub-pixels and 4 ...
11
votes
3answers
244 views

How can I raytrace a scene that does not fit into memory?

If the scene to be raytraced cannot be stored in memory, then without adding more RAM to the machine it seems unrealistic to render it in a practical time span, due to the need to load different parts ...
11
votes
1answer
880 views

What is the difference between importance sampling and mutiple importance sampling?

I can't understand math equations. I'm a graphic designer. What is "importance sampling"? What is "multiple importance sampling"? Could you explain easily, using illustrations and no math equations? ...
11
votes
1answer
354 views

Ocean Wave Rendering

How could I generate the waves for a water body with whitecaps & foam and variable intensity of the waves? Is the surface a mesh with a normal map? Is there a formula for generating that? Is there ...
11
votes
0answers
401 views

Problem with definition of BSDF and radiance

When I was reading theory behind physical based rendering I noticed that definition of BSDF and radiance has some problems. For example BSDF of purely specular surfaces is zero almost everywhere and ...
10
votes
1answer
3k views

Does cosine weighted hemisphere sampling still require NdotL when calculating contribution for indirect light?

When converting from uniform hemisphere sampling to cosine weighted hemisphere sampling I am confused by a statement in an article. My current indirect contribution is calculated as: ...
10
votes
1answer
373 views

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 ...
10
votes
1answer
1k views

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 (...
9
votes
3answers
3k views

How are volumetric effects handled in raytracing?

How are volumetric effects such as smoke, fog, or clouds rendered by a raytracer? Unlike solid objects, these don't have a well-defined surface to compute an intersection with.
9
votes
1answer
3k views

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 ...
9
votes
2answers
4k views

Cause of shadow acne

I know how shadow mapping works but I am not getting the cause of shadow acne! Can anyone tell me cause of shadow acne in a simple way and how is it related to depth map resolution?
9
votes
1answer
506 views

Modelling Young's double slit experiment

Young's double slit experiment is very simple to set up and simple to explain, but it is an example of both diffraction and interference, neither of which are modelled by conventional raytracing. It ...
9
votes
1answer
86 views

What are the side effects of biasing brightness in continuous spectrum raytracing?

I want to model rays with a continuous range of frequencies so that I can get raytraced images with colour separation on refraction. I can model a light source with a specified frequency distribution ...
9
votes
1answer
160 views

Sphere intersection occlusion (for hybrid raytracing)

Thinking about hybrid raytracing, hence the following question: Suppose I have two solid spheres $s_1$ and $s_2$. We know their centres and radii, and we know that they have some overlapping volume ...
9
votes
1answer
1k views

Asset creation for signed distance field rendering?

In traditional computer graphics, most 3D models are rendered by rasterizing or ray tracing against a subdivided mesh of primitives, usually triangles or quads. More recently, some real-time ...
9
votes
2answers
384 views

Total emitted power of diffuse area light

I am reading the book Physically Based Rendering (Pharr, Humphreys). In the chapter on lights, they talk about approximating the total emitted power of different kinds of lights. For example, a point ...
8
votes
1answer
776 views

How does everyone count “Rays per Second”?

Recently I'm developing a Monte-Carlo path tracer. To measure my tracer's performance, I decided to implement a simple mechanism to count how many rays can it trace in a second. Then here comes the ...
8
votes
0answers
695 views

More accurate Fresnel approximation for a RGB-based Path Tracer

I'm writing a path tracer and, for the moment, spectra related data (spectral power distributions and spectral reflectance curves) are stored as RGB tuples. In the Cook-Torrance specular BRDF I am ...
7
votes
2answers
1k views

Rendering equation - why unsolvable directly?

Why is the rendering equation, introduced by Kajiya in 1986, not solvable directly/analytically?
7
votes
4answers
1k views

Should ideal specular multiply light colour with material colour?

Ideal specular reflection is like a perfect mirror. I'm looking at the code to SmallPt and see that one of the spheres has an ideal specular material: ...
7
votes
5answers
399 views

Why does the 1/r² term appear with point sources?

I'm currently reading some books on radiometry. They mention that radiance is constant along a ray. It doesn't change with distance. However, I've seen some raytracer and they put the 1/r² factor when ...
7
votes
2answers
2k views

A recent approach for subsurface scattering

I read "A Practical Model for Subsurface Light Transport" and "A Rapid Hierarchical Rendering Technique for Translucent Materials". If I understand correctly, the former does not consider the case ...
7
votes
1answer
296 views

Ray casting in fan configuration produces point cloud with curvature, how to eliminate curvature?

I'm attempting to perform an intersection test using ray casting (not sure if correct term so please forgive me if not) and am outputting the intersections as a point cloud, and the point cloud shows ...
7
votes
1answer
1k views

Energy Conservation for Blinn-Phong BRDF

I am trying to sample from the Blinn-Phong BRDF. For testing, I use a spherical light source (Lambertian emission) sitting on a specular plane. Here's a reference image using energy-conserving Phong ...
7
votes
2answers
1k views

Am I missing something for ambient occlusion?

I'm trying to implement ambient occlusion in Python 3 and I'm seeing shadows beneath my reflective spheres but they seem very faint. I'm not sure if that means I've missed something, or if I just have ...
7
votes
1answer
586 views

Subsurface Scattering Without Rays?

Some games claim to use subsurface scattering but my current understanding of sss is only achieved with ray tracing. How would you sub surface scatter without ray tracing? Do some claim to use sss but ...
7
votes
2answers
498 views

How to handle a parametric equation in raytracing?

After taking a look at the Mobius strip, I noticed its equation is really simple and tried to add it into my Raytracer. I tried a "naive" way by simply generating N...
7
votes
1answer
2k views

Area Lights in Path Tracing

I have been following the scratchapixel ray tracing tutorials online which have been great at explaining the theory behind everything & how to implement it. However, I reached the point where I ...
7
votes
1answer
552 views

How to implement a realtime 2D light renderer with fog/colored light on the GPU?

Since long ago I wanted to implement a 2D lightning algorithm based on an idea I saw on YouTube. The video is realtime, but it runs on the CPU and the resolution is pretty low. I'm curious if anyone ...
7
votes
1answer
507 views

The meaning of early ray termination and front-to-back traversal in ray tracing

I'm new to computer graphics. These days I've been trying to understand how ray tracing using an acceleration data structure works. I came across the term "early ray termination" several times, I ...
7
votes
1answer
136 views

2D sampling with multidimensional transformations

I'm currently learning mathemetical concepts of distribution and the way to use them in a ray tracer with the book "Physically Based Rendering". Let's start by uniformly sampling an hemisphere: As ...
7
votes
1answer
436 views

Estimating the area of a triangle-circle intersection

I am trying to implement Ray Tracing with Cones (Amanatides 1984). Instead of rays, cones are shot into the scene and intersected with geometry. Since multiple triangles can occupy the cone's aperture,...
7
votes
2answers
568 views

Raytracing Problem - Casting Shadows

So I was tasked to create a model of the Cornell Box. I've managed to do everything up until casting shadows, in which case some shadows are cast when there should not be any. Here are pictures of ...
7
votes
1answer
193 views

An Effective way to explain Ray Tracing?

In my CS class in high school I'm doing a presentation on Computer Graphics and I wanted to talk about Ray Tracing. I was wondering what would be the easiest way to do this without confusing my ...
7
votes
1answer
1k views

Path weight for direct light sampling

I originally wrote a pathtracer that just bounces by the BRDF and each sample is added to a buffer that divides by the current number of frames. Now I'd like to do next event estimation at each ...