Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
1answer
115 views

Can a glass plate act like a lens?

I am trying to implement rough dielectrics on my renderer. I compared the results of my renderer and Mitsuba renderer. However, a thin glass plate which is a cube scaled by (0.4, 0.4, 0.01) magnifies ...
-1
votes
1answer
70 views

How to test my triangle intersection implementation?

I've been thinking about this question for a quite long time.And my implementation seems to be correct for some cases but wrong with few others. How can I comprehensive test the algorithm? Is there ...
3
votes
1answer
163 views

Do we ever consider the size of the pixel to calculate the color in Ray Tracing?

From what I'm reading, it looks like a ray tracer views a pixel as one color and computes that color using the ray starting in the center of that pixel. Yet a pixel has a width and a height. Do we ...
2
votes
3answers
469 views

How is a projector handled in a Ray Tracing environment?

I want to create a scene where a room includes a projector and a white screen. How is a Ray Tracing environment functioning in such a setup? Is the light from the projector going through a slide and ...
1
vote
1answer
158 views

Issues with Multi-threaded Raytracing

I'm having some issues with my multi-threaded ray tracing implementation. It seems to only render about half of the image. Here is the picture: Here is the code: ...
4
votes
0answers
223 views

Wrong output while implementing GGX importance sampling

I'm receiving a non-energy conserving output while trying to importance sample the GGX Distributionof the Microfacet model, which is generally 3-4 times bigger than the resulting PDF I'm following ...
4
votes
0answers
98 views

What techniques are used to build ray intersection acceleration structures on the GPU?

What improvements and alternatives have been developed since HLBVH was introduced in the 2010 paper HLBVH: Hierarcihcal LBVH Construction for Real-Time Ray Tracing of Dynamic Geometry by J. Pantaleoni ...
3
votes
1answer
474 views

Ray tracing: transforming ray to object's local space for intersection test

Im writting a raytracer, for which I want to be able to test intersections with implicit surfaces (in my case spheres). Without applying any transformation it works great, but I would like to upgrade ...
1
vote
1answer
107 views

What is the algorithm used in pbrt-v3 for triangle intersection?

Where's this algorithm come from? Any references? And a specific question, when the authors compute the transformation from world space to ray-triangle intersection coordinate space, what's the ...
2
votes
1answer
90 views

Rays (~1k) intersecting triangle meshes (~100k) with ca. 100 vertices each

I am looking for a way to efficiently compute ray-triangle intersections for a large number of rays (~1k) and a large set of triangle-mesh bodies (~100k) with each composed of several hundred faces. ...
1
vote
1answer
87 views

Light Falloff through a grid

I'm playing with a grid-based lighting system, where light is transported and accumulated through a grid. I initially tried attenuation based on ...
1
vote
0answers
74 views

Ray Tracer Shadowing

So I'm working on an assignment where we have to design a simple ray tracer. The program has two objects that it can use, sphere and cube. It can render the cube and spheres, it also does shading on ...
1
vote
1answer
203 views

Tone mapping bright images

I am rendering the sun in an image, and the sun comes out white and is basically very unrealistic. I have tried searching for tone mapping algorithms but I'm very lost. Can someone guide me to do ...
1
vote
1answer
112 views

What's wrong with my computation of the intersection of a ray with a sphere

I am learning GLSL and trying to raytrace a sphere. Here is a fragment shader. It correctly discards fragments which are not on the sphere, but when I try to calculate the point of intersection (and ...
5
votes
1answer
154 views

Reduce kd-tree's nodes' bounding box sizes to their shapes' extents?

I've implemented a ray tracer that uses kd-trees for acceleration. To help debug kd-tree construction, I also created a crude OpenGL view of the same scene that shows the axis-aligned bounding boxes (...
4
votes
2answers
148 views

Inconsistent shading in pathtraced image

I am currently building a pathtracer, which has support for vertex normals and face normals. There seems to be an issue when it comes to rendering objects with triangles exported from Blender. ...
4
votes
1answer
152 views

Classify acceleration structure using surface area heuristic

My professor gave me the following example exam question: Given 4 spheres with diameter = 1. Their centers are located on coordinates (2,4,0), (4,2,0), (4,6,0) and (6,4,0), as seen in the ...
2
votes
1answer
337 views

How can I implement this BSDF?

I am trying to implement a path tracer, but I have some problem. The class Spectrum is color. I implemented a mirror material like this: ...
1
vote
1answer
49 views

How to get the nearest polygon face and height of intersection point

I have multiple 3D polygons meshes (sketchup format) in the world, for any specified point (x,y,z), how do I get the direct closest polygon face below this point? and how to get the height for the ...
1
vote
0answers
41 views

Is this the correct application of model transformation?

Suppose I want to perform translate in the following order: Scale by $S$ Rotate by matrix $R_1$ Rotate by matrix $R_2$ Translate by $T%$. When I apply the matrix, should the overall transformation ...
1
vote
2answers
108 views

AABB bounding boxes

Here's a constructor to construct a axis-aligned bounding box given two opposite vertices on the bounding box, from Pharr's Physically Based Rendering, Third Edition. ...
4
votes
1answer
122 views

How do you deal with clipping when rendering to a limited colorspace?

In my naïve raytracer experiment I work internally with RGB values, and after all the tracing has been done, I end up with raw RGB triplets that I need to write down to some image format with a ...
1
vote
0answers
49 views

How does anti-aliasing work, in general, for raytracing? [duplicate]

I am working on a raytracing Java program for fun. Here's one rendering: As you can see I still have to implement anti-aliasing (and there are huge geometry problems I won't get in to). How would ...
3
votes
1answer
502 views

Probability density function while using spherical coordinates

I'm following this tutorial where at somepoint the derived PDF for spherical coordinates for a Lambertian surface is \begin{array}{l} p(\theta, \phi) = \dfrac{\sin \theta}{2 \pi}. \end{array} But as ...
4
votes
1answer
243 views

Simple Intersection Algorithm for Ray and 3D Bézier Curves of Varying Thickness

I'm trying to get an algorithm for intersecting a "tube" (a 3D cubic Bézier curve extruded by a possibly-changing radius) with the following required properties: Computes intersections of ray and a ...
6
votes
1answer
328 views

Ray tracing - partial derivatives for texture lookup

I'm doing some ray tracing on GPU using a fragment shader... How can I calculate texture coordinates partial derivatives with respect to screen coordinates so I could perform filtered texture lookup ...
2
votes
1answer
283 views

Vector Math for Raytracer

So i am working through the book "Raytracing in one weekend". At the point where i am at we want to check if a ray hits a sphere. For that we have the equation: ...
6
votes
1answer
172 views

How to prevent moire artifacts in this light casting algorithm?

I am writing a 2D light casting algorithm with OpenGL compute shaders. The algorithm is simple: For each light source shoot out light rays from it, the ray begins at the light coordinates, it ends at ...
4
votes
1answer
133 views

Ray intersection with Sun positions throughout the year

I need to highlight(colour) sun reflections(through the year) off a mirror surface. It was easy having one Sun like in the below image but how about if it is to determine if a ray hits the entire ...
7
votes
1answer
176 views

An Effective way to explain Ray Tracing?

In my CS class in high school I'm doing a presentation on Computer Graphics and I wanted to talk about Ray Tracing. I was wondering what would be the easiest way to do this without confusing my ...
3
votes
2answers
776 views

Raytracing in OpenGL using Compute Shaders

I Recently posted this question on SO but didn't got any response so i thought to post it here since it's somewhat related to Raytracing. I am making a real time ray tracer in OpenGL using Compute ...
3
votes
1answer
438 views

Please, help me to understand why my raytracing camera rotates in wrong directions?

I'm trying to build a raytracer and I use this article on how to build camera system. The problem is that when, after calculating ray direction in camera space, I multiply it by camera-to-world ...
4
votes
1answer
634 views

Compute sphere tangent for normal mapping

I'm implementing normal mapping on my toy pathtracer. I need to compute the tangent (and bitangent) of any sphere point in order to create the matrix that will transform tangent space to world space. ...
2
votes
0answers
385 views

What's the nature of Monte Carlo noise?

Monte Carlo rendering is just a process of sampling and reconstruction to evaluate the rendering equation. Why is it called noise rather than error?
5
votes
1answer
293 views

About the use of Russian Roulette in Smallpt

I was taking a look at Smallpt (http://www.kevinbeason.com/smallpt), more specifically at the Russian Roulette part. Actually, RR is used in two places along the code: first, to determine ray ...
5
votes
1answer
379 views

Loading a material via assimp

I'm writing a raytracer and I'm using the assimp library to load objects. I have an object's material specified in a .mtl file: ...
6
votes
1answer
448 views

How can a diffused(frosted) glass be modelled in path tracing

How can a diffused(frosted) glass be modelled in path tracing? Currently I am able to define a window poly line as a clear glass material where it transmits or reflects the ray. I am not clear though ...
5
votes
0answers
107 views

Computation of conservative AABB for clipped triangle

I'm currently trying to implement a fast algorithm for KD-Tree construction using SAH, as described in this paper: On building fast KD-trees for ray tracing, and on doing that in O(N log N) I found ...
7
votes
1answer
132 views

2D sampling with multidimensional transformations

I'm currently learning mathemetical concepts of distribution and the way to use them in a ray tracer with the book "Physically Based Rendering". Let's start by uniformly sampling an hemisphere: As ...
5
votes
2answers
1k views

A recent approach for subsurface scattering

I read "A Practical Model for Subsurface Light Transport" and "A Rapid Hierarchical Rendering Technique for Translucent Materials". If I understand correctly, the former does not consider the case ...
4
votes
0answers
235 views

Mathematics of Sub Surface Scattering

Can somebody help explain the mathematics of Sub Surface Scattering in a Path Tracer based on the Diffuse Approximation in A Practical Model for Subsurface Light Transport ? I would like someone to ...
6
votes
1answer
78 views

How is measured BRDF data recorded?

How is measured BRDF data recorded? Like the MERL BRDF Database. What kind of equipment is used and what are the key values that need to be recorded? I know one place this data was used was in the ...
2
votes
2answers
468 views

How to find Light Direction from a Point on a surface to an Area Light

How can I a find the Light Direction/Ray from a Point on a surface to an Area Light? Is there a universal technique to do this for all types of lights (circle, rectangle, sphere & tube)? Although ...
1
vote
0answers
88 views

Explain Radiance Estimate for photon mapping

I'm adding photon mapping to my current raytracer to add indirect lighting. Can someone explain how the radiance estimate works in simple terms and with some simple math? I have read a lot of ...
12
votes
1answer
3k views

Progressive Path Tracing with Explicit Light Sampling

I understood the logic behind the importance sampling for the BRDF part. However, when it comes to sampling light sources explicitly, all becomes confusing. For example, if I have one point light ...
1
vote
1answer
488 views

How can I utilize all cores of CPU In my ray tracer with std::thread?

I have been working on a ray tracer and I was trying to use multiple threads to maximize the performance. I tried couple of approaches but there's no difference in performance. Here's my shot... <...
6
votes
2answers
654 views

How am I able to perform perspective projection without a near plane?

I'm learning about 3D computer graphics, but I'm having a hard time understanding why the near plane of a viewing frustum can not be placed at z position $0$ (right at the camera). I can understand ...
4
votes
0answers
305 views

Problem with specular BRDF (Monte Carlo & Path Tracing)

Above on the left is my attempt and on the right is what I'm aiming for.As you can see my sphere with the specular brdf has a weird dark ring In my radiance function I am recursing through the ...
4
votes
1answer
305 views

Tracing shadow rays in a scene with mirrors

In my real time ray tracer, I shoot primary rays from the eye, and at hit points, I trace to a single light source to determine if the object is shadowed or lit. Pretty straightforward stuff so far. ...
4
votes
1answer
163 views

Visualize the output of a Trowbridge-Reitz Half Vector Sampling Function

I am attempting to visualize the raw output from PBRT's half-vector sampling function, based on the trowbridge-reitz distribution. I'm isolating only the distribution and the associated functions ...