/r/raytracing

Photograph via snooOG

Ray tracing articles, competition entries etc.

A place for sharing news, personal projects, academic papers, videos and anything else about raytracing.

Feel free to ask questions, but please avoid tech-support style questions. This isn't the place to ask how to get RTX working in minecraft. Try/r/pcgamingtechsupport/ or r/minecraftrtx instead.

Also check out /r/vintagecgi for CGI from the 70's-90's

/r/raytracing

4,023 Subscribers

2

Issues with Refraction (possibly backside intersection issues) in my Ray Tracer

Hi All,

I'm relatively new to raytracing (only been doing it about for ≈6 Months) and I am trying to integrate Snell's Law refraction into my tracer. I (to my knowledge) have calculated my refractions correctly, yet I am having issues with the origin point of my refraction rays.

I should clarify my process is coming from the Ohio State University lecture notes that are widely found online.

The issue arises when I generate scenes. I am only seeing any sort of transparency when I move the Refractive Origins far beyond the value of my hits. The hit points are being subtracted by at least 0.6*normals to get any sort of refraction looking result.

I've attached some photos below. Any Help would be appreciated and I could discuss more information in my replies.

Render when origins=hits-1*normals

Associating Code (here its 1*normals)

Render when origins=hits-0.01*normals

Associating Code (here its 0.01*normals)

0 Comments
2024/03/23
18:44 UTC

6

Coding a Ray Tracer

Any tips on how I can improve the output?

3 Comments
2024/03/14
07:16 UTC

0

Weird glitch in Minecraft Bedrock

2 Comments
2024/02/10
20:37 UTC

2

Does anyone out there know how to fix this distracting flickering that goes on with Amid Evil's RT reflections and shadows?

7 Comments
2024/02/08
23:04 UTC

4

How to achieve this effect using raytracing?

13 Comments
2024/01/30
12:52 UTC

3

importance sampling example for a dummy

I know in "layman's terms" how importance sampling works - but I can't understand how to apply it to a simple example:

Lets say I have a function f that for x e [0,0.5[ is 1 and for x e [0.5, 1[ is 0. So I "know" the expected value should be 0.5, but I want to calculate that with monte carlo and importance sampling.

Now if I use 100 samples from a random distribution ~50 will be 1, the rest 0 → (50*1 + 50*0) / 100 = 0.5. Cool!

But what if my samples weren't uniformly distributed and instead samples in the lower range ([0,0.5[) have a 80% chance, while the other range has 20%. I know I have to weight the samples by the inverse probability or something, but I never get the right result (here 0.5). For 100 samples with this distribution we'd get around:
(~80*1 / 0.8 + ~20*0 / 0.2) / 100 = 1

Or I can multiply - also wrong:
(~80*1 * 0.8 + ~20*0 * 0.2) / 100 = 0.64

2 Comments
2024/01/27
21:25 UTC

3

A Zig Implementation of Raytracing

0 Comments
2024/01/12
18:09 UTC

11

Building's facade in indirect light, and then in direct light (runs at 180fps)

0 Comments
2024/01/07
22:43 UTC

3

Raytrace Shadows Using VEX in Houdini

1 Comment
2024/01/06
17:09 UTC

2

3d graph/ray intersection algorithm

I am trying to build a simple raytrace 3d graphing program in c++ and am looking for any algorithms for intersection of a ray and a 3d graph.

4 Comments
2024/01/06
03:06 UTC

2

Pathtracer template for Shadertoy with TAA and reprojection

0 Comments
2023/12/30
16:55 UTC

8

Half life 1 with Full Path tracing

1 Comment
2023/12/19
18:51 UTC

1

How does the path tracer know the light position and illumination in Wavefront .obj?

Hi!

In the path tracing algorithm, in every ray-object intersection, the shadow ray must be found from that point to the light source. In addition, the light path should end once it hits a light source.

  • If I assume the scene has multiple area light with emissive properties, then I guess it is encoded in the material (.mtl) file of the wavefront .obj file. Is it okay to use the vertex position data to find the light source from the intersection point?

  • But if I imagine a scene with multiple point light sources (explicit), then how the position and illumination of the light sources are defined? How the ray-object intersection point will find it?

4 Comments
2023/12/17
21:25 UTC

0

coding or designing pc parts

yo. im 16 and im decent in code languages(python, c++, opencl) i live in hungary, and i still got 1 and a half years left of secondary school. after i graduate i plan on going uni i study maths and physics in advanced classes, but my knowledge is far far more than what we learn in school.

so i started to focus on raytracing implicaions. and as a fact, ray tracing is something, which uses more of the hardware than other programs. and i dont want to be a script writer, i want to work as a gpu designer. (ik that its still divided to many many parts)

so my question is, how much do i have to study tracing for this job?

0 Comments
2023/12/15
17:47 UTC

11

I think you guys might find this interesting, something broke during gameplay, CP2077 image before denoising

9 Comments
2023/12/10
12:41 UTC

2

Path tracing: how samples are arranged?

Hi! In path tracing, we need N number of samples per pixel. Now, how these N numbers are arranged? I guess I can choose a random number (white noise), a regular sampling grid, or a blue noise (quasi-pseudo-random number) in 0-1 range in the pixel (like the figure below). Am I right?

If the above case is right, when those samples arrive at the intersection point, over the hemisphere, will they also follow the same random pattern? Or do the random points generated on the hemisphere follow any other pattern? How to preselect that pattern over the hemisphere?

9 Comments
2023/12/08
16:49 UTC

5

Camera space Ray Tracing

Hello, I am trying to implement rendering in camera space following https://pharr.org/matt/blog/2018/03/02/rendering-in-camera-space

I tried implementing my camera based on PBRT-V4's implementation but I can't make it work. I believe my transformations are messed up somewhere.

Anyone tried implementing that?

1 Comment
2023/12/04
20:44 UTC

0

What would it take (by us people or NVIDIA) to resolve this RTX issue?

I see this a lot in games like Fortnite with lumen on, or Half-Life with path-tracing on... and it's always an issue with the global illumination aspect of RTX implementation.

What and how could we fix this spotty, smeary, and glitchy 'artifact' on all games that use RTX? Preferably, I'd love it if there was a global solution (meaning it works off the GPU and doesn't need to be a fix made for that game) or if I could just know what the issue is so I can look into it myself.

Check out the image below to get a reference. Pay attention to the spottiness of the image.

Half-Life: RTX

4 Comments
2023/11/24
05:08 UTC

4

Can someone suggest some good resources to read up on RT cores? The NVIDIA blog posts don't really have anything on it.

2 Comments
2023/11/22
21:10 UTC

2

i'm in need of some help, ray tracing in one weekend

so i've been trying to make a loop on the last scene, one which the camera would go around the scene and render images from some points, git hub link bellow so you guys can see how my code is at this moment.

https://github.com/RGHV001/Ray-Tracing/tree/main/ImagemFinalComThreadsVideoTarefa1

so the error i keep getting is:

Unhandled exception at 0x00007FF77C963F66 in Raytrancing_V5.exe: 0xC0000005: Access violation writing to location 0x000002140380D3C0

(could be a bit mistranslated, since my vs is in portuguese)

it shows up on line 41 of color.h

pos[0] = (unsigned char)(255 * clamp(r, 0.0, 0.999));

my current guess is that the loop on the main function is somehow breaking the code, since it renders the first image just fine, but the error shows up when it was supposed to start doing the second one. The thing is, i have no idea why this could be happening, any help is truly appreciated, thanks in advance.

3 Comments
2023/11/21
08:35 UTC

2

Weird artifacts on Cornell box scene

I'm writing a raytracer using Vulkan to do hardware raytracing, and I cannot figure out what is causing these weird artifacts on my image. The normal and UV maps look completely fine, and different scenes render without the artifacts. Does anyone have any idea what might be causing this? I'm happy to provide more details and/or code. Thank you!

https://preview.redd.it/h8rbb6jcsx0c1.png?width=1000&format=png&auto=webp&s=0ec7530c729925d07c479f0ea2c69be91188836c

6 Comments
2023/11/17
16:42 UTC

1

Cyberpunk 2077 - RT OVERDRIVE vs RTX OFF COMPARISON #3

1 Comment
2023/11/07
16:33 UTC

0

Cyberpunk 2077 - RT OVERDRIVE vs RTX OFF COMPARISON #2

0 Comments
2023/11/07
06:38 UTC

2

Great comparison of RT Overdrive (path tracing) vs rasterized (no ray tracing)

0 Comments
2023/11/06
10:16 UTC

3

Help with raytracing in UE5

Hey all!

I tried to post at the unreal engine sub, but couldn't because of low karma (lurker acc) The question is however relevant to raytracing.

I am currently writing my thesis project on using ue5 as a daylight analysis tool. I am trying to find a way to access illuminance (lux) values on the surfaces and then create a gradient shader in order to be able to visualise these values in real time while designing.

I have spent a lot of time trying to get it from blueprints and I have come to the conclusion that it's not possible as of build 5.3.

My next step is looking into the source code, to figure out how UE solves the rendering equation and performs ray tracing. I have found most of the relevant information online and in the code.

My question however is this, which is arguably more related to ray tracing, rather than UE itself:

After performing the ray bounces from the camera to the lights, and getting the relevant information from the different surfaces, the rendering equation is solved using the Monte Carlo approximation. To my knowledge, the rendering equation gives us the spectral radiance of the light at a specific point facing a certain direction (in this case, the pixel the ray crosses from). How is the information we get from this solution, computer along with the different colour values of the viewable surfaces into a final colour of the pixel, and is it possible to perform a backwards operation and go from pixel colour to lux?

Sorry for the long and possibly naive post, but I am an architect engineer so I am not very familiar with coding or computer graphics. Any help will be greatly appreciated!

3 Comments
2023/10/30
17:27 UTC

4

New Ray Tracing Repository in C++ with Phong Implementation and SFML Integration

Hello, everyone!

I'd like to share an exciting project I've been working on recently. It's my GitHub repository called Appel, which is an implementation of ray tracing in C++ with support for the Phong lighting model and the use of the SFML library to generate stunning images.

GitHub Repository Link: Appel - Ray Tracing in C++

The project includes several interesting features:

  • Ray tracing implementation for realistic scene rendering.
  • Phong lighting model for shadows, reflections, and refractions.
  • Utilization of the SFML library for image creation and visualization.
  • Customization and experimentation with different scenes and materials.

I would greatly appreciate it if you could check out the repository, give it a star ⭐️ if you find it interesting, and, if possible, contribute feedback or suggestions. I love to see the community getting involved in computer graphics projects, and I hope this project serves as a source of inspiration and learning for everyone.

If you have any questions or would like to discuss anything specific about the project, please feel free to comment on this post or open an issue on GitHub.

Thank you for checking it out, and I hope you enjoy the project!

https://preview.redd.it/0vfe4bu9wlrb1.png?width=1920&format=png&auto=webp&s=b5fcf99d69aa575bee41a88de198c3a75172d3b5

0 Comments
2023/10/01
15:04 UTC

2

Does Sampling (Path Tracing) affect the rendering performance?

Hi!

Each robust sampling technique has visible results in a path-tracing algorithm. For example, we can notice how the output result is different while using uniform and necessary sampling. However, does this sampling algorithm have any performance benefit (in the context of frame rate and rendering time per frame)?

9 Comments
2023/09/27
10:48 UTC

Back To Top