# Tag Info

## Hot answers tagged raytracing

42

TL;DR They belong to the same family of solvers, where sphere tracing is one method of ray marching, which is the family name. Raymarching a definition Raymarching is a technique a bit like traditional raytracing where the surface function is not easy to solve (or impossible without numeric iterative methods). In raytracing you just look up the ray ...

37

The term "distributed ray tracing" was originally coined by Robert Cook in this 1984 paper. His observation was that in order to perform anti-aliasing in a ray-tracer, the renderer needs to perform spatial upsampling - that is, to take more samples (i.e. shoot more rays) than the number of pixels in the image and combine their results. One way to do this is ...

25

It's essentially because not all GPUs can support function calls—and even if they can, function calls may be quite slow or have limitations such as a very small stack depth. Shader code and GPU compute code may appear to have function calls all over the place, but under normal circumstances they're all 100% inlined by the compiler. The machine code ...

24

There are multiple areas in path tracing that can be importance sampled. In addition, each of those areas can also use Multiple Importance Sampling, first proposed in Veach and Guibas's 1995 paper. To better explain, let's look at a backwards path tracer: void RenderPixel(uint x, uint y, UniformSampler *sampler) { Ray ray = m_scene->Camera->...

16

Ray marching is an iterative ray intersection test in which you step along a ray and test for intersections, normally used to find intersections with solid geometry, where inside/outside tests are fast. Images from Rendering Geometry with Relief Textures A fixed step size is pretty common if you really have no idea where an intersection may occur, but ...

16

I'm sadly not able to add a comment to the answer above (not enough reputation), so I will do it like this. I'd like to point out that what Dragonseel describes is simply an integral equation (specifically a Fredholm equation of the second kind). There are many such equations which do have an analytic solution; even some forms of the rendering equation have ...

16

Shapes appearing stretched in the periphery is a consequence of perspective projection. The wider the field of view (FOV) is, the stronger the stretching effect gets. To demonstrate the effect I wrote a quick example on ShaderToy: https://www.shadertoy.com/view/MltBW2 As you can see on the images below (corresponding to FOV of 40, 80 and 120; if I didn't ...

15

Radiosity does not account for specular reflections (i.e. it only handles diffuse reflections). Whitted's ray-tracing only considers glossy or diffuse reflection, possibly mirror-reflected. And finally, Kajiya's path-tracing is the most general one [2], handling any number of diffuse, glossy and specular reflections. So I think it depends on what you means ...

15

First off, here's the Kajiya method I think you're thinking of: Kajiya, Ray Tracing Parametric Patches, SIGGRAPH 82. The tech report version might be more informative. What I hope you get from that is that it's not impossible and it's not conceptually difficult if you don't mind getting your hands dirty with some algebraic geometry and complex numbers. ...

14

The next step up from a pinhole camera model is a thin lens model, where we model the lens as being an infinitely thin disc. This is still an idealization that pretty far from modeling a real camera, but it will give you basic depth of field effects. The image above, from panohelp.com, shows the basic idea. For each point on the image, there are multiple ...

14

This is perfectly possible Although the difference may not especially noticeable, I would expect sampling taking into account the exact pixel geometry to give a slightly more accurate image. You just need to offset your pixel centres per colour component according to the (average) location of the subpixel(s) of that colour. Note that not all pixel layouts ...

14

Raxvan is completely right that "traditional" anti aliasing techniques will work in raytracing, including those that use information such as depth to do antialiasing. You could even do temporal anti aliasing in ray tracing for instance. Julien expanded on Raxvan's 2nd item which was an explanation of super sampling, and showed how you'd actually do that, ...

13

Image 1: A bad case of shadow acne. (Synthetic and a bit exaggerated) Shadow acne is caused by the discrete nature of the shadow map. A shadow map is composed of samples, a surface is continuous. Thus, there can be a spot on the surface where the discrete surface is further than the sample. The problem does persist even if you multi sample, but you can ...

13

The rendering equation is as follows: Now, the integral is over the sphere around the point $x$. You integrate over some attenuated light, incoming from every direction. But how much light comes in? This is the light $L(x',\omega_i)$ that some other point $x'$ reflects in the direction $\omega_i$ of point $x$. Now you have to calculate how much light that ...

13

I think it's safe to say that there are two different ways of doing AA in raytracing: 1: if you have the final image and the depth image it is possible to apply almost all existing techniques that are used in games (FXAA, etc) Those work directly on the final image and are not related to raytracing 2: the second method is to take into account multiple rays ...

12

Overview The appearance of volumes (also called participating media) in nature is caused by tiny particles, such as dust, water droplets or plankton, that are suspended in the surrounding fluid, such as air or water. These particles are solid objects, and light refracts or reflects off of these objects as it would on a normal surface. In theory, ...

12

If the scene does not entirely fit into memory, you are entering the field of out-of-core rendering. There are essentially two approaches here: a) Generate your scene on-demand b) Load your scene on-demand The former approach aligns well with most animation workflows, where models are heavily subdivided using e.g. Catmull-Clark and can become very memory-...

12

When shading a point on an opaque surface, you need to gather incoming light and weight it with the bidirectional reflectance distribution function (BRDF) of the material. The naive approach is to distribute samples equally over the hemisphere and probe all directions equally for incoming light. This is called uniform sampling (Fig. 1). While this works in ...

12

For the current state-of-the-art, look for this paper: "Maximum Mipmaps for Fast, Accurate, and Scalable Dynamic Height Field Rendering", Tevs et al. 2008 The basic idea is to skip a lot of space by having knowledge of the maximum value over large areas of terrain. If the ray stays above that, skip to the next large area. If you look at Figure 8, you'll ...

12

According to this paper, the $\frac{1}{\pi}$ in your $f_r$ should be $\frac{1}{4}$: $$f_r = \frac{DFG}{4(n\cdot w_i)(n \cdot w_o)},$$ so you would end up with $$\frac{\pi}{2}L_i(p,w_k)\left(\frac{DFG}{n\cdot w_o}\right).$$

12

I am posting this for anyone wondering about the confusion between the terms $\frac{1}{\pi}$ and $\frac{1}{4}$. The term $\frac{1}{\pi}$ is an error from the original Cook-Torrance reference. In fact, the whole term $\frac{1}{4(n \cdot \omega_i)}$ comes from the Jacobian of the transformation from reflected solid angle to normal solid angle. According to ...

12

You always need to multiply by the cosine term indeed (that's part of the rendering equation). Though when you do indirect diffuse using ray-tracing and thus monte-carol integration (which is the most common technique in this case), you have to divide the contribution of each sample by your PDF. This is well exampled here. Note also that in the mentioned ...

11

Path tracing is the standard technique in non-realtime photorealistic rendering, and you should look specifically into bidirectional path tracing to get effects like caustics, which you can't really get with basic path tracing. Bidirectional path tracing also converges faster to the ground truth as shown in the below image: Also Metropolis light transport (...

11

Generally speaking, path tracing removes a number of assumptions that ray tracing makes. Ray tracing usually assumes that there is no indirect lighting (or that indirect lighting can be approximated by a constant function), because handling indirect lighting would require casting many additional rays whenever you shade an intersection point. Ray tracing ...

11

There are a couple of special cases where mirror-like reflections can be rendered efficiently using rasterization techniques, and these are commonly used in games, although they don't work for the general case. Planar reflections If the reflecting surface is flat or reasonably close to flat, the reflected image can be rasterized in an separate rendering ...

11

Well I researched quite a lot after that and this paper helped a lot. "Space Subdivision algorithms" by Macdonald 1988. So just summing what I understood. Some of them are obvious reasons but after reading the paper make much more sense and I'll try to do the same here. 1) In BVH we are subdividing objects into smaller pieces. So for example a model of ...

10

As you have probably observed, in general, you cannot solve in closed-form the equations for ray trajectories around multiple distorting objects. The standard approach for such things is just to discretize it. This looks like Eulerian integration. Just step your ray a little bit toward the object, calculate gravity from all sources and bend it, then step ...

10

Low-pass filtering is a classic tool from signal theory that will effectively remove noise, as you suggested, but will also cancel out desired high-frequency information in the image such as sharp edges. The image will look blurry. Post-filtering Monte Carlo rendering results is an open field of research and many advances have been made over the years, and ...

10

There is a great paper from 2006 on this topic, Filter Importance Sampling. They propose your method 2, study the properties, and come out generally in favor of it. They claim that this method gives smoother rendering results because it weights all samples that contribute to a pixel equally, thereby reducing variance in the final pixel values. This makes ...

10

The near and far planes of a viewing frustum aren't needed for simple 3D→2D projection. What the near and far planes actually do, in a typical rasterizer setup, is define the range of values for the depth buffer. Depths in the [near, far] range will be mapped into [0, 1] to be stored in the depth buffer. However, the depths aren't simply linearly rescaled. ...

Only top voted, non community-wiki answers of a minimum length are eligible