# 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.

438 questions
Filter by
Sorted by
Tagged with
1 vote
213 views

### Ray Tracing With Continuous Refraction

I want to write a simple ray tracing(?) algorithm in WebGL with continuous refraction. So my idea was, what if you have a material whose optical density varies continuously, if this is physically ...
• 127
353 views

### mapping of a point from a sphere into UV plane

I am reading the book An introduction to raytracing by Eric Haines and it mentions an algorithm to map a point from a sphere into a UV plane, it calls it Inverse Spherical Mapping (page 49). I googled ...
232 views

### How do I get rid of the Artifacts in my Ray tracer?

I have a very weird problem in my raytracer. I have been following along with Ray Tracing in one Weekend by Peter Shirley. I have a very weird problem with artifacts in my renders. This is an image of ...
210 views

### Adding cos(θ) from rendering equation ruins the renderings

I'm following Ray Tracing The Rest of Your Life to implement a ray tracer, but the explains on math (mainly pdf part) got me confused so I followed Rendering Equation to understand the math behind. As ...
• 171
1 vote
124 views

### Defining the proper sdf for this structure

I am making a procedural sdf (just a bunch of cubes) based of an image. The idea is very simple. We have a stencil image: Each texel in the image corresponds to a 3D cube. So to ray trace what I am ...
• 1,696
177 views

### importance sampling rectangular light

I have been struggling very much to wrap my head around this part of Peter Shirley's book. There is no explanation what the angle Alpha represents and to make things worse in the code the cos(Alpha) ...
1 vote
71 views

### Ray tracing Supersampling patterns : pre-computing them?

This wikipedia page explains the principle of patterning in Supersampling. However, I have a question: should the pattern be constant for every pixel? Of course, the pattern will be constant for a &...
114 views

### Problem with Corrupted Pixel/color data on bitmap image in Raytracer

I'm following this book, Computer Graphics from scratch: A programmer's introduction to 3D rendering, to build a simple raytracer and rendering the scene to a bitmap image. I've run into a problem ...
• 31
88 views

### Ray tracing of a diffuse material sphere doesn't work, the sphere just shades black

I made this ray tracer in javascript to run on html with imageData. I have been using the book "Ray Tracing in One Weekend" as a reference (https://raytracing.github.io/books/...
• 101
1 vote
449 views

### Raytracing and transformation

So I'm looking at incorporating instancing to my ray tracer. However what I would like some insight on is what to apply the transformation to?. Most suggest to apply the inverse transformation to the ...
560 views

### Rendering equation - brdf / pdf > 1?

I am creating a path tracer and I got some strange results when calculating the strength of light. I am using a rendering equation inspired by this diagram: When I use the cosine everything gets ...
153 views

### Sparse voxel oct tree tracing, optimization tricks?

I have a working oct-ree raytracer and I am applying it to the sponza. The algorithm I have designed works like this at a high level: Collide with the bounding box of the model, move your ray to that ...
• 1,696
244 views

### Next Event Estimation for Triangle-based Light Sources

I have a question regarding the NEE for light sources that are composed from triangles. I implemented the next event estimation (explicit light source sampling) for spherical light sources but after ...
• 41
1 vote
91 views

### Why my bsdf can not pass Chi2test?

I implemented a MicrofacetTransmission in nori. But it can not pass all Chi2test when alpha is large(>= 0.4 or ?),part of chi2test is passed.And I can not found the problem.Can someone help me? ...
• 31
74 views

### What to do with reflected rays that don't intersect?

I implemented reflection on my ray tracer. I had very few objects in the scene, so the reflected rays would less likely intersect. If most of the rays don't intersect, metallic objects would appear ...
• 21
305 views

I am writing a raytracer which is meant to support shadows. Previously, I have naively implemented hard shadows by casting a shadow ray towards the light (+ offset) and seeing if it hits anything ...
1 vote
155 views

### Are intersections still hardware accelerated if we define a custom intersection program in Optix?

I've stumbled into Optix samples that define their own intersection programs to define how primitives intersect (or don't) with a ray, and others (mostly those only dealing with triangle meshes) that ...
• 75
140 views

### Can meshes be reused in raytracing?

In rasterization, at least in the context of game development, it is a common to have many instances of the same 3D object in a scene (think many identical rocks in different sizes/positions/rotations)...
• 75
70 views

### ray triangle mesh intersection triangles inverted

I'm trying to render a dodecahedron triangle mesh and the triangles seem flipped or mirrored somehow. The first picture is what I should be getting, the second picture is what I'm getting and the last ...
1 vote
130 views

### Time Interval Ray Tracing performance

I found a very nice paper regarding Time Interval Ray Tracing for Motion Blur published in 2017. That was before RTX GPUs were on the market. I have a few questions about an optimal implementation and ...
• 1,136
1 vote
504 views

### question about true Lambertian reflection in Ray tracing in one weekend

I have a question about Peter Shirley's Ray tracing in one weekend. In the True Lambertian Reflection section, when talking about rejection method, he said This distribution scales by the cos^3(ϕ) ...
• 31
135 views

### Is there a mathematical (as opposed to iterative/SDF) test for ray intersection with a grid of circles?

My actual problem is considerably more complex, but can be solved if there is a cheap way to compute the intersection of a ray with a regular grid of circles. If I had a circle centered at every ...
72 views

### Is it possible that a superior, undiscovered 3D rendering method exists?

As far as I know, the only options we have for true 3D rendering are polygonal rendering, ray-marching and raytracing/casting. Why is that? Surely there must be other ways? Is there some paper ...
318 views

### How to avoid curvature artifact in raytracer?

I have a pretty simple raytracer that is rendering some SDFs, but when my camera is close to the object I see curves: I am not entirely sure where they are coming from, as I am using nothing but ...
• 1,696
273 views

### What is the attenuation function for a reflected light

In a real-time rendering program, when a light hit a plane and reflected, how to calculate the attenuation(by distance) for the reflected light?
81 views

### Examples of anisotropic surfaces

Being faced with a design choice, I have to decide between supporting anisotropic surfaces or not in my ray tracer. Is there any common use case of this feature other than velvet (so that I may be ...
1 vote
387 views

### How to change a RGB value using a radiance value?

I am new to this awesome community, I am currently writing a ray tracer but I hit a problem... Let's say I have a surface(material doesn't matter) of colour [1, 0, 0] in RGB, and the radiance reaching ...
1 vote
112 views

### Shadow Bug when Raytracing Triangles

Spheres with shadows work fine. But when I try to include triangles with shadows, they are shaded incorrectly (i.e completely black): But when I disable shadows Blinn shading on triangles work fine (...
• 131
105 views

situation: I've implemented a Whitted style ray tracing in C. Everything appear to works except the shadow cast by small object on big far objects The problem : red sphere have radius 0.5 orange ...
• 31
110 views

### How is raytracing performed in anisotropic media?

I wish to determine the path taken by a light ray between two points, $a$ and $b$, through an anisotropic medium. More specifically, this medium has an index of refraction which varies as an ...
• 123
1 vote
62 views

### When sampling direct light, what to do if testing ray been blocked by transparent object?

As the title above. I am trying to sampling direct light and indirect light. But I have many transparent objects in scene, it's very likely to block the testing ray. To my understanding, it's not good ...
• 131
70 views

### Ray tracing tree

Let's suppose that we have a light source. Which of the following are correct for the tree of recursive ray-tracing (ray tree) that create when we make the colors for each pixel in the screen. Which ...
305 views

### Can someone explain why raytracing isn't able to make Global Illumination?

I've watched a few videos about raytracing vs pathtracing, and one thing that consistently pops up is the idea that pathtracing seems to be able to do global illumination, whilst raytracing is not. ...
2k views

### Fundamental drawbacks of rasterization over ray tracing

Are there any fundamental drawbacks/limitations of rasterization as compared to ray-tracing? When I search on the internet, I get vague explanations like rasterization does not provide lighting ...
136 views

### Raytracing, divide by PDF neutralized the effect of D and G terms, what is the problem?

Following some documents on internet, I divide my ray tracing result by PDF. Then it seem the D and G terms disappeared. Only F term is still visible, it looks like Fresnel only. ...
• 131
1 vote
235 views

### Ray tracing Bug with Diffuse material

I am trying to do ray tracing in python (following the tutorial given in Ray Tracing in a weekend). Basically I am shooting rays from eye and the recursively bounce around, each time they hit ...
• 131
1 vote
155 views

### Ray tracing geometries with same position, translation and scale

this is my first post on the Computer Graphics Stackexchange forum. Apologies in advance if I am doing something wrong. I have the problem that I have a scene with overlapping geometries. To be more ...
155 views

### Ray casting and rasterization 101

Recently I've became an intern in company-name and my internship task is(for now) create rasterization using rays. I'm mostly interested in pure math, so basic ...
• 101
461 views

### Path tracing : fireflies/hot pixels when directly sampling lights

I am implementing a pathtracer with both indirect and direct light sampling at each intersection (I believe the "direct light sampling" part is also referred to as "next event ...
• 186
98 views

### What can be the cause of some strange ray shadows artefacts on a perfectly flat surface?

First of all I have to say that I am really new in the world of Computer Graphics. I apologise if some of my questions may appear trivial. I am currently using a non-commercial ray tracing and ...
• 76
1 vote
321 views

### Combining two images based on their depth maps

Lets assume, we have two depth maps with us and their corresponding color maps. Now, our task is to populate a final image that will be displayed. Each pixel in the final image needs to be calculated ...
• 111
73 views

### Unity path tracing makes the pc crash

Good Morning. I'm testing Path Tracing techniques with unity, following this tutorial. http://three-eyed-games.com/2019/03/18/gpu-path-tracing-in-unity-part-3/ But I'm in trouble. Whenever I try to ...
2k views

### Given two 3d vectors, find the rotation matrix between the two

So I am making a raytracer following the very helpful online book of Gabriel Gambetta but I stumble on the rotation matrix part. My linear algebra background is 3Blue1Brown video series "The ...
• 103
110 views

### Magic number meaning in smallpt's camera ray calculation

In smallpt's source at line 90 the direction is multiplied by 140 and I was wondering where that number is coming from. I was hoping for it to be explained in the ...
59 views

### Buggy behavior when applying specular reflection

I'm very new to computer graphics and trying to implement a raytracer based on the book Computer Graphics from Scratch. When I tried to add specular reflection, I don't get the output that look like ...
99 views

### (Ray tracing) Trouble converting to screen coordinates, objects being stretched

I followed along with Ray Tracing in One Weekend and managed to get the final output but I wanted to understand more about creating a camera and "painting" the screen since he didn't go over ...
165 views

### How to link Intel Open Image Denoise in Qt Creator and use it to denoise noisy Monte Carlo path tracing renderings?

I've been trying to link my the Intel Open Image Denoise libraries for about a week and still have no luck as of now. This could partly be because I am also novice in C++ stuff. So I need some help in ...
• 241
1k views

### Transforming a ray from camera space to world space

I am writing a Raytracer and generating rays from the camera. I have a working program but slightly confused about the linear algebra concepts involved in transforming the ray from camera space to ...
66 views

### Moving a vertex through the cursor

There is a way to move a selected point in a mesh with a cursor(assuming a camera that doesn;t change between frames). The way I remember the algorithm (but seems to be wrong) is: Unproject the ...
• 1,696
1 vote