# 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
590 views

### Ray vs AABB algorithm that also gives which side was hit?

There are plenty of well-known algorithms for determining if a ray hit an Axis-Aligned Bounding Box (AABB), like Andrew Woo's covered in a response here. Using ...
487 views

### Confusion around Lambert's Cosine Law in Ray Tracing in One Weekend

Peter Shirely's Ray Tracing in One Weekend presents the following function to calculate the color of a lambertian material (See chapter's 7 and 8): ...
52 views

### Distribution of the first vertex on a camera subpath in bidirectional path tracing

Suppose we are sampling camera rays of a perspective camera with a finite aperture. The PBRT implementation of the sampling scheme looks like this: ...
• 193
54 views

• 111
581 views

### Implementing GGX VNDF importance sampling with DXR

I am currently implementing the GGX specular BRDF in a DXR raytracer using the importance sampling method describe by Heitz I am sampling the VNDF with: ...
• 21
171 views

### Why does my julia ray tracer return stack overflow error?

I' trying to write a monte carlo ray tracer in julia, but my main function returns stack overflow error. Below is my main function: ...
1 vote
31 views

### Report standard deviation in Rendering results

I noticed that a common metrics for image quality assessment (Monte Carlo path tracing) is MSE between the generated image and a reference one. My question is: why isn't the standard deviation ever ...
• 189
236 views

### Calculate Normals of Boolean Operation for Ray Tracer

I'm working on a small ray tracing project in my free time and I'm currently implementing boolean operations for spheres. My code is setup to calculate the intersection points of each of the spheres ...
• 123
2k views

### Color shading and light calculation for ray tracing

I am currently building a ray tracer and I came across a problem and confusion regarding the light calculations. For lighting, I am using the following mathematical model: Where ...
203 views

### Multiple Importance Sampling in Bidirectional Path Tracing

I'm trying to understand the computation of the path density described in the book Physically Based Rendering. They assume that a path $$x=(x_0,\ldots,x_{n-1})=(q_0,\ldots,q_{s-1},p_{t-1},\ldots,p_0)$$...
• 193
71 views

### Weird Ray tracing artifacts when Code run on widows

I am trying to create a raytracer following peter shirley's in a weekend series. I am getting weird color distortion artifacts when I am running the code on windows. However, the code runs fine when ...
• 133
1 vote
713 views

### How to display image from CUDA / What API to port my project to for real-time raytracing?

I started a raytracing project using the python numba library which provides a just-in-time compiler for CUDA kernels. When the scene is rendered my result is a 1920 x 1080 x 3 RGB array in GPU memory....
1 vote
612 views

### Compute shader only 5 times faster on the GPU than on the CPU

I'm running following compute shader in Vulkan. worldImage is device local memory that holds the world. resultImage is reference to the memory of the swapchain image: ...
• 231
1k views

### Diffuse lighting calculations in ray-tracer

I am trying to write a ray-tracer. The lighting part is proving to work but not accurately. To debug I simplified the scene to a single sphere centered at the origin with a radius of 1 and a point ...
417 views

### Strange sphere reflection effects in ray tracing project. I cannot figure out what causes them

I started a ray tracing project in Python. I made a CUDA kernel and a trace() function for each pixel. It works perfectly when calculating intersections, shadows and lambert shading, however when I ...
683 views

### Proper way of consuming stratified samples in path/ray tracing

I'm working on a (toy-level) path/ray-tracer, currently trying to implement (and understand) improved sampling strategies. The obvious next choice after uniform random sampling would be stratified/...
• 41
420 views

### The termination probability of Russian roulette in PBRT

As described in PBRT 14.5, the path tracer stops bouncing rays at a probability q, which is determined by the throughput of the path. ...
• 119
539 views

### GLSL Compute Shader doesn't run for large inputs

The shader takes an SSBO of Photons that have a position, direction, wavelength and intensity and each thread is responsible for tracing exactly one photon through the grid, where at each grid cell ...
• 179
804 views

### Regular voxel grids and RTX accelerated ray tracing

I've been looking to play with ray tracing, starting with a simplest of minecraft clones (making something more akin to cave game, for starter). I figured I'd define a voxel as a primitive and then ...
• 231
107 views

I am trying to simulate the actual response of a camera given some object that is reflecting light. I've written a ray tracer, and have a BRDF that I need to use, and I have a camera sensitivity in ...
• 215
576 views

### Offline path tracer produces a darker image than expected

I've been going though Peter Shirley's beginner raytracing books. Upon building the Cornell box and rendering an image, I get a much darker / dimmer image than expected. The color values are ...
139 views

### Moving a sphere in a basic ray tracer

I have written a really basic ray tracer. It generates primary rays and sets the colour of the pixel to the colour of the object that I have set myself. The code for which can be seen below. ...
• 1
146 views

### Reddish tint with spectral renderer

I'm trying to implement a spectral path tracer and comparing results from my program with renders of the same scene done with pbrt and ...
664 views

### What is the purpose of the projected solid angle $dA^\perp$ term in the definition of Radiance?

In the definition of Radiance, which according to PBRT is defined as flux per unit solid angle $d\omega$ per unit projected area $dA^\perp$ $$L_i=\frac{d\Phi}{d\omega\ dA^\perp}$$ My original ...
• 222
1 vote
439 views

### Tone Mapping in a physically based rendering ray tracer

I'm implementing a pbr ray tracer. Let's say that I'm at the end of the process: for each pixel pi, I accumulated the radiance value in vector pi = (radR, radG, radB). At this point, these values are ...
• 113
331 views

### Using octree for cheking intersection of ray and meshes

I wrote the code for checking intersection of ray and meshes on scene. It consist of two parts - broad phase and narrow phase. In broad phase I build an oriented bounding box around each mesh and ...
• 101
695 views

### Dealing with interpolated normals within a raytracer

I am trying to render a teapot within a simple raytracing that can handle reflection, refraction, and shadowing from point and directional lights. I am very confused about one detail of the raytracer ...
• 243
775 views

### Camera Model View transformation in Ray Tracing

I am implementing my own simple ray tracing and I came across some sort of confusion. When defining the verticies in the world I multiply them by the modelView transformation system (the matrix ...
127 views

### how many watts are in the SPD of the color white?

Please help. I'm trying to implement a ray tracer, going by the PBRT book and got stuck on an issue that I fail to find the answer to. My scenes are made from objects and light sources. From that, I ...
• 23