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
3 votes
1 answer
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 ...
Tyler Shellberg's user avatar
2 votes
1 answer
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): ...
countfromzero's user avatar
0 votes
0 answers
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: ...
0xbadf00d's user avatar
  • 193
2 votes
0 answers
54 views

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}=(\...
0xbadf00d's user avatar
  • 193
1 vote
0 answers
190 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 ...
AregevDev's user avatar
0 votes
1 answer
469 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 ...
antaalt's user avatar
  • 11
1 vote
1 answer
78 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 ...
0xbadf00d's user avatar
  • 193
0 votes
2 answers
284 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: ...
Russell356's user avatar
3 votes
1 answer
216 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 ...
0xbadf00d's user avatar
  • 193
1 vote
1 answer
66 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 & ...
TheOrestes's user avatar
3 votes
1 answer
299 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 ...
Russell356's user avatar
2 votes
1 answer
73 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 ...
Karthik's user avatar
  • 25
1 vote
0 answers
158 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 ...
bitWise's user avatar
  • 233
1 vote
1 answer
189 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?
bitWise's user avatar
  • 233
0 votes
0 answers
76 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?
bitWise's user avatar
  • 233
1 vote
1 answer
252 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 ...
bitWise's user avatar
  • 233
0 votes
0 answers
66 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 ...
AnnoyinC's user avatar
  • 312
4 votes
4 answers
1k 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 ...
AnnoyinC's user avatar
  • 312
1 vote
2 answers
481 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 ...
Yamahari's user avatar
  • 115
0 votes
1 answer
896 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 ...
Yamahari's user avatar
  • 115
0 votes
0 answers
53 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 ...
bitWise's user avatar
  • 233
1 vote
0 answers
134 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 ...
bitWise's user avatar
  • 233
0 votes
1 answer
378 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 ...
bitWise's user avatar
  • 233
1 vote
0 answers
98 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 $(\...
MCMastery's user avatar
  • 111
2 votes
0 answers
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: ...
Badnet's user avatar
  • 21
0 votes
0 answers
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: ...
user11237's user avatar
1 vote
0 answers
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 ...
maurock's user avatar
  • 189
2 votes
1 answer
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 ...
Renge's user avatar
  • 123
0 votes
0 answers
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 ...
Abdullah Emad's user avatar
0 votes
0 answers
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)$$...
0xbadf00d's user avatar
  • 193
0 votes
0 answers
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 ...
B0rn2C0de's user avatar
  • 133
1 vote
0 answers
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....
Speterius's user avatar
1 vote
0 answers
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: ...
Karlovsky120's user avatar
3 votes
2 answers
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 ...
Anson Zhang's user avatar
2 votes
1 answer
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 ...
Speterius's user avatar
4 votes
0 answers
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/...
flipflop's user avatar
2 votes
0 answers
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. ...
Zhe Chen's user avatar
  • 119
2 votes
1 answer
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 ...
Jhonny007's user avatar
  • 179
2 votes
1 answer
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 ...
Karlovsky120's user avatar
0 votes
1 answer
107 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 ...
Chris Gnam's user avatar
3 votes
1 answer
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 ...
user avatar
0 votes
0 answers
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. ...
Tim's user avatar
  • 1
2 votes
1 answer
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 ...
Kirill Dmitrenko's user avatar
5 votes
3 answers
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 ...
eclmist's user avatar
  • 222
1 vote
1 answer
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 ...
JimZer's user avatar
  • 113
0 votes
0 answers
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 ...
NikBond's user avatar
  • 101
5 votes
1 answer
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 ...
CalebK's user avatar
  • 243
4 votes
1 answer
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 ...
Abdullah Emad's user avatar
2 votes
1 answer
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 ...
egor's user avatar
  • 23
4 votes
0 answers
164 views

Learning light transport using Q-Learning

I am trying to reproduce the results obtained by Dahm et al. in the paper Learning Light Transport the Reinforced Way. This method takes advantage of the similarity between the Bellman equation (Q-...
maurock's user avatar
  • 189

1 2 3
4
5
9