Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Filter by
Sorted by
Tagged with
0 votes
1 answer
81 views

Ray-Tracing: Sphere not showing up. Is the intersection correct?

I am currently doing a ray-tracer. For a start, sphere ray-casting only. When trying to rendering a scene with three spheres two rendered as expected. The third did not. In the image bellow, one can ...
user2752471's user avatar
0 votes
0 answers
29 views

How to get exact position back after DDA algorithm

I have implemented the DDA algorithm in a voxel raycaster, which is working well, but I now want to cast from where it hits towards the sun, for basic shadows, but that requires "restarting" ...
Reed Thorngag's user avatar
0 votes
2 answers
176 views

Fastest way to accumulate (reduce) a StructuredBuffer<float> in a compute shader

I've got a RWStructeredBuffer<float> tau I'm writing to in a ray generation shader rayGen. The DispatchRays dimension are (tauWidth, tauHeight, 1) and tau has exactly tauWidth * tauHeight ...
0xbadf00d's user avatar
  • 18.4k
0 votes
1 answer
125 views

UI not updating during render

I've coded a small raytracer that renders a scene (based on Peter Shirley's tutorial, I just coded it in Swift). The raytracer itself works fine, outputs a PPM file which is correct. However, I was ...
easythrees's user avatar
  • 1,826
0 votes
0 answers
43 views

How to use the same name for different types in Metal and Swift while ensuring correct alignment?

I'm writing my ray tracing game engine in Swift and Metal on my Mac. So it is very necessary to make full use of the natural optimize of Metal. My current version can work, but it is incredibly slow ...
deepinFolk's user avatar
1 vote
0 answers
77 views

Why my Metal kernel function accepts a empty value?

I'm developing my own game engine. It is for Apple devices so I write it in Swift + Metal. I firstly write it in C on CPU. After I finished and tested all of the functions and I'm sure that it can ...
deepinFolk's user avatar
0 votes
0 answers
81 views

Inconsistent results with my C# Fast Voxal Traversal Algorithm (Amanatides & Woo)

I'm trying to implement this algorithm in C#, but I have very inconsistent results at the moment, and I can't figure out why. Here is my current implementation : public static IEnumerable<Point> ...
LaGrange's user avatar
1 vote
0 answers
67 views

How to correctly add point light and reflection values in an ray tracing system?

I'm working on a small ray tracing project and I'm trying to add a point light system to my rendering engine. Here's an excerpt of my main ray_color function, which calculates the color of a ray based ...
delmath's user avatar
  • 11
-3 votes
1 answer
85 views

Device doesn't have PIPELINE_EXTENSION_NAME even though rayTracingPipeline is supported

When I give pointers to extension structs to be filled in when I call vkGetPhysicalDeviceFeatures, the rayTracingPipeline flag is 1, meaning it should be supported, and pretty all the flags in ...
Zebrafish's user avatar
  • 16.3k
0 votes
0 answers
19 views

How to render the light source itself in raytracing?

I'm following some articles to render a simple scene consisting of several spheres and light source. My question is, how would you render the light source itself? For example, a round light bulb, or a ...
Solaric's user avatar
  • 41
0 votes
1 answer
131 views

Draw each rendered scanline in windowed raytracer? [closed]

I'm refactoring a raytracer to have a window pop up that shows each scanline produced instead of having to wait for the ppm image to be rendered and open it with some ppm viewer. I've been advised to ...
Niccolò Tiezzi's user avatar
1 vote
1 answer
152 views

Smart pointers vs raw pointers for raytracer [closed]

I wrote a toy raytracer following the popular raytracing in one weekend series that uses heavily shared_ptr for more or less everything. The codebase in nice and tidy but extremely slow (a 400x400 ...
Niccolò Tiezzi's user avatar
2 votes
0 answers
93 views

How to convert camera space to world space given Camera Vector and Ray vector in camera space

How can i convert a camera space vector to world space, given the camera direction vector, and the camera space vector? All vecs are normalized 3D vectors, and the camera space projection is correct ...
Chase M's user avatar
  • 29
1 vote
3 answers
189 views

Parallelized ray tracer is slower than single thread version

i'm writing a raytracer based on the popular raytracing in a weekend series. i've tried to parallelize it by dividing the image in slices and give each thread a portion of the image to render: void ...
Niccolò Tiezzi's user avatar
-4 votes
1 answer
64 views

Is there a way to find out why the front faces are culled instead of the back in my procedurally generated 3D model?

I have been working on procedural generation of 3d models using threeJS. I have been able to successfully procure a model with the help of marching cubes algorithm and smoothened it with the help of ...
Anto Alex's user avatar
0 votes
0 answers
93 views

PBRT's hello world

I wanted to try to use the code of the Physically Based Rendering Toolkit (PBRT). So I cloned the repo, built the project and then tried to do a "hello world" #include <iostream> #...
roi_saumon's user avatar
0 votes
0 answers
19 views

Raytracer mesh not centering correctly

I have had this bug for a while, and I tracked it down to the way I am trying to rotate and then center a mesh in my raytracer. The way I figured it out is the meshes need to be rotated first, and ...
Adelai Herberger's user avatar
0 votes
1 answer
85 views

Is there a pyramidal beam - AABB intersection algorithm?

I'm trying to figure out an approach for checking whether or not axis aligned bounding boxes (AABBs) intersect with a pyramidal beam. Is there a known algorithm for this? Does anyone have an idea how ...
Chribit's user avatar
  • 83
0 votes
1 answer
133 views

Raytracting in One Weekend OpenMP Parallelization

I've been following the tutorial series "Ray Tracing in One Weekend" which seems relatively canonical in terms of learning ray tracing. I've been trying to speed up the code using OpenMP but ...
C Diamond's user avatar
1 vote
0 answers
36 views

Is shading materials in ray tracing/path tracing associative and/or commutative?

I have been fiddling around a ray tracer in the tutorial Ray Tracing: The Next Week. And I noticed that the author simply multiplies attenuation of materials hit in each intersection: ray scattered; ...
Aperture Initiative's user avatar
0 votes
0 answers
144 views

Is there a more efficient Ray intersection algorithm for rounded Boxes?

I'm currently trying to figure out a rendering approach for implicit geometry which involves a ray intersection algorithm for oriented rounded box primitives. It's just a small toy project and I'm not ...
Chribit's user avatar
  • 83
2 votes
3 answers
71 views

How do I pass an Java Object to my OpenCL kernel?

I'm developing a Java RayTracer with OpenCL. Im currently using JOCL to access the API. So, now I'm trying to make the user interact with the camera, and my plan was to make a camera that would be ...
Anderson Gonçalves's user avatar
0 votes
1 answer
61 views

Raytracer Reflection: object is dimmed, not reflective

i'm implementing a simple raytracer and now I'm trying to implement reflections. but the object are just dimmed, there is no reflection. that's how it looks: my scene Here is my code for the ...
fran.zip's user avatar
0 votes
0 answers
223 views

My DX12 ray tracer is crashing and i can't figure out why

I am trying to code a real-time ray tracer application using DirectX12. I should say that I am almost a complete beginner about graphics programming and have very little idea on what I'm doing (if you ...
HeroOfSkies's user avatar
3 votes
0 answers
148 views

Is there a curve-triangle intersection algorithm?

The problem of calculating the intersection between a ray and a triangle is well-known. For this there exists e.g. the Möller-Trumbore intersection algorithm. For my application I need an algorithm ...
jonewa's user avatar
  • 31
0 votes
1 answer
327 views

Torus intersection formula for raycasting?

I'm currently learning raycasting and I was able to render several objects in terminal using functions like this (vec3 is just a struct with xyz variables) : float hit_sphere(vec3 center, float radius,...
dikiy_opezdal's user avatar
0 votes
1 answer
103 views

Problem with total internal reflection in ray tracing (Ray tracing in a weekend)

I'm following the steps in the book 'Ray Tracing in a weekend' and I'm having some problems with the section 11.3 Total internal reflection. When I try create the image I get this result: This is the ...
Lautaro10263's user avatar
0 votes
0 answers
90 views

Incorrect ray direction calculation

The problem I am having is that the calculation of ray direction for my ray tracer is not correct and therefor the scene is not renderd as the ray directions are not projected in the expected ...
Zirconium409122's user avatar
1 vote
0 answers
48 views

templated class segfaults when using inheritance [duplicate]

I am currently working on a raytracer, and I am trying to output the result using multiple ways at the same time (only through PPM format and using SFML atm). To achieve that, I wrote an IOutput ...
1ups_'s user avatar
  • 47
0 votes
1 answer
250 views

How to correctly index into an index buffer in DXR

I am working through a simple ray-tracing application with DXR. I am using a single vertex and index buffer for multiple geometries, and the acceleration structure is handling that perfectly. ...
space_doctor's user avatar
0 votes
0 answers
111 views

Why is my VkPipeline returning null even with all other values being good?

The code: VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo{ VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO }; pipelineLayoutCreateInfo.pushConstantRangeCount = 1; pipelineLayoutCreateInfo....
Owi's user avatar
  • 1
1 vote
1 answer
204 views

How is the ray_color(...) (ray trace function) correct from the "Ray Tracing in One Weekend: Part 1" book?

The trace ray (named ray_color in the book) function from the ray tracing in a weekend book looks like this color ray_color(const ray& r, int depth, const hittable& world) const { // ...
unusually_crispy_crisps's user avatar
1 vote
1 answer
104 views

How to convert raw RGB luminance using OCIO

I'm currently working on a raytracer in C++, and am struggling to understand color transforms/spaces. I'm trying to use AGX via OCIO, but I cant find any solid explanations as to how I'm to apply the ...
Sel's user avatar
  • 77
0 votes
1 answer
198 views

How can I send large arrays of objects to a fragment shader using WebGL2?

For a university assignment, I've written a raytracer in JavaScript using a Canvas with a 2D context. To make it faster, I'm converting it from a 2D context to a WebGL2 context. In the original code, ...
Killjoy's user avatar
0 votes
0 answers
236 views

VK_ERROR_DEVICE_LOST on create acceleration structure and possible ways to debug it

i'm trying to make a ray tracer in vulkan, so i need to make an acceleration structure. i've seen similar questions and understood that the VK_ERROR_DEVCE_LOST shows up on calling vkQueueWaitIdle when ...
Sirox's user avatar
  • 1
0 votes
0 answers
230 views

How can I use (resource) barriers to sync access to a `RWTexture2D` between different shaders?

Here is my situation: I have a RWTexture2D<float4> out which will always be in state D3D12_RESOURCE_STATE_UNORDERED_ACCESS and another RWTexture2D<float4> tex (initialized in state ...
0xbadf00d's user avatar
  • 18.4k
0 votes
0 answers
88 views

Simultaneous access to the same pixel in a ray generation shader - is it safe?

I have a ray generation shader which adds a random number of rgb values to a RWTexture2D<float3> output : register(u0) at random pixel locations: [shader("raygeneration")] void foo() { ...
0xbadf00d's user avatar
  • 18.4k
1 vote
0 answers
177 views

Path tracer fireflies

I'm trying to make a path tracer but I have no idea how do I solve fireflies problem when sampling from env map. Env maps usually contain really bright and small areas and when some ray hits that ...
Zydak's user avatar
  • 11
1 vote
1 answer
214 views

CreateStateObject returns E_INVALIDARG - How to figure out what precisely the cause is?

I'm trying to compile and run the code published on https://github.com/boksajak/referencePT of the reference path tracer described in Raytracing Gems II. It is based on https://github.com/acmarrs/...
0xbadf00d's user avatar
  • 18.4k
0 votes
1 answer
178 views

BVH structure not working in shaders but work in cpp code

I have been learning about rendering and after learning about raytracing I wanted to explore acceleration structures and write my own BVH implementation. I am testing it out by dispatching shadow rays ...
TooGood's user avatar
  • 19
0 votes
1 answer
43 views

Render only the front faces of 3D objects in a raytracer

I'm working on a raytracer implementation in Python, and I want to ensure that only the front faces of 3D objects are rendered. Currently, the raytracer renders both the front and back faces, and I ...
FrostDream's user avatar
-1 votes
1 answer
95 views

Implementing a Simple Caching Mechanism in Python for Ray Tracing

I'm working on a ray tracing project in Python and I'm looking to implement a basic caching mechanism to improve performance. I want to avoid using functools and classes. custom_cache = {} def ...
FrostDream's user avatar
0 votes
1 answer
56 views

Raytracer Camera Look-At Issue: Limited Rotation Range?

I'm working on a raytracer, and I'm facing an unexpected behavior with the camera's look_at feature. It appears that the camera's rotation is limited to a certain range, and when I set look_at to vec3(...
FrostDream's user avatar
0 votes
0 answers
117 views

Creating a Custom Shape in Python Ray Tracing Project

I'm working on a ray tracing project in Python and want to include custom shapes, such as a human body, in my scenes. While basic shapes like spheres and cuboids are straightforward, I'm struggling to ...
FrostDream's user avatar
2 votes
1 answer
177 views

Implementing Frustum Culling in Python Ray Tracing Camera

I'm working on a ray tracing project in Python and have encountered a performance bottleneck. I believe implementing frustum culling in my Camera class could significantly improve rendering times. ...
user avatar
2 votes
1 answer
295 views

Efficient Rendering Optimization in Ray Tracing - Avoiding Full Scene Rendering

I'm currently working on a ray tracing project using Python and have encountered performance issues with rendering the entire scene each time. I want to implement a more efficient rendering approach ...
user avatar
0 votes
1 answer
84 views

Ray tracing: Sphere have an X mark from light source instead of a circle

I am trying to do ray tracing on a couple of spheres. However, when I put a light source directly in front of a circle, I get a X mark (X mark with 3 lines instead of 4) instead of a circle lighting ...
Jeffrey Chen's user avatar
0 votes
0 answers
99 views

Multithreaded program using 8 threads takes more time to run than 2 threads

I am trying to convert a single threaded raytracing program to a multithreaded program. My idea is the following: Create a new thread for processing the color of each pixel. Since each pixel has 1024 ...
Der Fänger im Roggen's user avatar
0 votes
1 answer
1k views

Creating a window just to get its framebuffer?

I've been writing this small ray-tracing engine in C/C++, and so far I've got basic functionality, where the finished image gets written to an image. However, I want to be able to create a window and ...
Matthew G.'s user avatar
0 votes
0 answers
28 views

Issue with Vector Subtraction in Ray Tracing Python Code

I'm working on a ray tracing project in Python and encountering a TypeError that I'm having trouble resolving. The error occurs in the vec3_sub function, where I'm trying to subtract two vectors. Here'...
FrostDream's user avatar

1
2 3 4 5
22