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
0
votes
1answer
43 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): ...
0
votes
0answers
30 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: ...
0
votes
0answers
19 views

Computing probabilties when connecting a camera subpath to a single light point

I'm struggling to understand how the connection step in bidirectional path tracing for the strategy with a single light vertex has to be implemented. The following code essentially shows the PBRT ...
2
votes
0answers
35 views
+50

Chart swaps and path inversion in bidirectional path tracing

I've got a hard time to understand how we would implement the following in practice. I'd be great if someone could explain the details for the example below. Assume we're generating a path ${\rm x}=(\...
0
votes
0answers
22 views

Inverse path sampling in (bidirectional) path tracing

In Section 4.1 of the paper Fusing State Spaces for Markov Chain Monte Carlo Rendering, it is described that the CDF $P$ of the distribution of paths of length $k\in\mathbb N$ may be factored into a ...
0
votes
0answers
15 views

Computing inverses in Reversible-Jump Metropolis Light Transport

Say we are sampling a path $\rm x=(\rm x_0,\ldots,\rm x_{n-1})$ of length $n-1$ using bidirectional path tracing. Let $p_s$ denote the area product density corresponding to the used connection ...
1
vote
0answers
53 views

Ray Tracing -Weird Edge Artifact

I am interested in Path Tracing, I currently follow the Ray Tracing in a weekend book. When implementing the metal material, I get a strange artifact on the edge of the sphere that does not appear in ...
0
votes
1answer
58 views

Retrieve real distance from depth buffer for shadow ray (vulkan hybrid rendering)

I'm trying to implement an hybrid renderer based on Vulkan extension VK_NV_ray_tracing. Basically, the rasterizer compute the albedo and depth map of the scene. Then I try to compute the distance from ...
1
vote
1answer
43 views

In bidirectional path tracing, is a camera subpath with $n$ vertices determined by a fixed number of random numbers?

In the Multiplexed Metropolis Light Transport implementation of the book Physically Based Rendering, the proposal samples are generated by the Primary Sample Space Sampler ...
0
votes
2answers
104 views

Why is my raycaster so slow?

I'm trying to write a raycaster similar to Voxlap, but it's many times slower. I've tried octrees, but the performance gains are marginal- only 10 to 20 percent. I use the algorithm from this site: ...
4
votes
1answer
131 views

What is a “light source” in global illumination?

In the context of global illumination and the scattering equation, do we need to understand "light sources" as surfaces with a "purely emissive" material on which no scattering is present? In ...
0
votes
0answers
39 views

Implementation of the Primary Sample Space Sampler in the book Primary Sample Space Sampler

In the Multiplexed Metropolis Light Transport implementation of the book Physically Based Rendering, the proposal samples are generated by the Primary Sample Space Sampler ...
0
votes
0answers
19 views

How do I render from chunks?

I'm trying to implement chunks/octrees to speed up my rendering times. However, objects sometimes disappear, and it segfaults or hangs frequently. Full code: https://pastebin.com/4P3sX6BV - main....
0
votes
1answer
34 views

Mapping sample to a disk

So I have been reading this wonderful book on ray tracing by Kevin Suffern, Ray tracing from Ground Up. I am reading this book after finishing Peter Shirley's first two book on ray tracing & ...
2
votes
1answer
69 views

How can I raycast with chunks?

I am attempting to implement chunks/octrees to speed up my render times. However, sometimes the walls show horizontal or vertical lines (rays hitting the inside of voxels?) or some blocks disappear ...
0
votes
0answers
25 views

Can solid voxelization be done with 1-direction raytracing if the raytracer is watertight? Does the direction matter?

This article and some others mention requiring the following when voxelizing: 1: Shooting rays from multiple directions (maybe with a voting system to decide if the voxel is active?) 2: Shooting ...
2
votes
1answer
38 views

How to decide which child of BVH to visit based on sign of ray's direction vector?

I'm reading about BVH from PBRT. According to the book, in the linear bvh part using morton encoding: An efficient way to perform a front-to-back traversal without incurring the expense of ...
1
vote
0answers
138 views

Strange behaviour when tracing rays through hemisphere patches

I have implemented a ray tracer using reinforcement learning. But I see some problems. I tried to divide the planes into rectangular grids. I searched the moire effect and realized that I can solve my ...
1
vote
1answer
94 views

A pseudocode to parallelize a path tracer?

Where can I find a pseudocode to parallelize a path tracer using multiple cpu threads? How should I change the normal path tracer to be capable of parallelization?
0
votes
0answers
71 views

What is the name of this effect and how could I solve it?

I've implemented the algorithm in the paper "Learning the light transport the reinforced way". What is the name of this effect and how should I solve it?
0
votes
1answer
65 views

What is the PDF for path tracing in the paper "Learning the light transport the reinforced way

It's the algorithm which combines path tracing and reinforcement learning. I can't understand what $p_\omega$ is. The algorithm is clear. The actions are the directions and the states are the hit ...
0
votes
0answers
36 views

Temporal anti-alliasing breaks the entire image

I'm kind of lost here as I'm faced with a graphical bug the origin of which I don't even know. In an attempt to recreate a shadertoy I saw that had TXAA, I made a function TemporalAA that takes in 3 ...
2
votes
4answers
112 views

Why isn't rasterization combined with raytracing more often?

If I'm not mistaken, you can make a hybrid renderer which lets a rasterizer solve the visibility problem, then shade all of the projected shapes with a raytracing algorithm. It seems that this isn't ...
1
vote
2answers
57 views

Inverted Normals in Raytracer

I am having the following issue. I am working on a ray tracer for school and I am trying to render a sphere where the radiance of a intersection point is the dot product of the ray direction and the ...
0
votes
0answers
31 views

Factorize probability densities in Bidirectional Path Tracing

Say we have fixed a length $k$ for paths we want to sample using bidirectional path tracing as described in the Physically Based Rendering book. Let $q_{s,\:t}$ denote the probability density of ...
0
votes
1answer
81 views

Perspective Raytracing

Given the up and focal vector of the perspective camera, the position of the camera and the vertical and horizontal opening angle of the FOV. How can I calculate a ray for given screen space ...
0
votes
0answers
48 views

The correct way to apply 3d rotations?

I am trying to reproduce the results of 2017 paper "Learning the light transport the reiforced way" by Duhm and Keller. I already know how to generate random samples inside the equally-sized patches ...
1
vote
0answers
82 views

How does multiple importance sampling work and how should I generate the samples?

Is my understanding of MIS algorithm true? I first generate a random number $x\in U(0,1)$ and $w_1=\frac{p_1(direct)}{p_1(direct)+p_2(hemisphere)}$, and then if $x < w_1$ generate the sample ...
0
votes
1answer
61 views

How can I implement next event estimation?

I am trying to implement next event estimation to reduce the noise of path tracer and I need a pseudocode. Edit: I know how to sample direct illumination but the visibility function is the real ...
1
vote
0answers
43 views

Oren-Nayar Reflectance

I'm trying to implement Oren-Nayar reflectance and I don't quite understand the Wikipedia article on it. In the article, it has this diagram: I can't figure out what $(\theta_i, \phi_i)$ and $(\...
2
votes
0answers
61 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: ...
0
votes
0answers
60 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
0answers
25 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 ...
2
votes
1answer
54 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 ...
0
votes
0answers
205 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 ...
0
votes
0answers
62 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)$$...
0
votes
0answers
33 views

Probability of choosing the current strategy in the pbrt implementation of Multiplexed Metropolis Light Transport

In the description of the Multiplexed Metropolis Light Transport implementation of pbrt it is claimed that "the inverse probability of choosing the current strategy $(s,t)$ [...] is equal to <...
0
votes
0answers
49 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 ...
0
votes
0answers
38 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
0answers
105 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: ...
2
votes
2answers
77 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 ...
2
votes
1answer
61 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 ...
4
votes
0answers
118 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/...
2
votes
0answers
100 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. ...
2
votes
1answer
163 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 ...
1
vote
1answer
202 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 ...
0
votes
1answer
52 views

Physically realistic received irradiance values given some BRDF?

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 ...
2
votes
1answer
84 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 ...
0
votes
0answers
47 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
vote
1answer
61 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 ...