Questions tagged [raytracing]

Ray tracing is a physics-based method for simulating photorealistic 3D scenes. Light rays are drawn from the eye through each pixel of the desired image, and the rays' interactions with the scene determine the displayed pixel color.

Ray tracing is a method (both physically-based and non-physically-based) for simulating photorealistic 3D scenes. Light rays are traced from the eye (or camera) through the geometry of the scene and the rays' interactions with the objects determine the final displayed pixel color.

It is capable, among other visual effects, to simulate light scattering, reflection, dispersion and refraction more realistically than other graphics rendering methods.

More information: http://en.wikipedia.org/wiki/Ray_tracing_%28graphics%29

1049 questions
8
votes
2 answers

Detect and Remove Hidden Surfaces of a Mesh

For the past few weeks, I have been working on an algorithm that finds hidden surfaces of complex meshes and removes them. These hidden surfaces are completely occluded, and will never be seen. Due to the nature of the meshes I'm working with, there…
ContingencyCoder
  • 339
  • 6
  • 13
8
votes
3 answers

Fast pixel drawing in WPF

I would like to write a simple ray tracer using WPF. It is a learning project and thus I favour configurability over performance (otherwise I'd go for C++). I still want relatively fast pixel drawing. A previous question on StackOverflow contains…
Gigi
  • 28,163
  • 29
  • 106
  • 188
7
votes
5 answers

RayTracing: When to Normalize a vector?

I am rewriting my ray tracer and just trying to better understand certain aspects of it. I seem to have down pat the issue regarding normals and how you should multiply them by the inverse of the transpose of a transformation matrix. What I'm…
Setheron
  • 3,520
  • 3
  • 34
  • 52
7
votes
3 answers

A few questions about ray tracing with opengl

I need to do a limited form of ray tracing. I do not need reflections. I only need to change the color of a pixel, depending on how it passes by an object, and refraction. I also only need to test for intersections between the ray and spheres and…
user467526
  • 517
  • 5
  • 19
7
votes
1 answer

shuffling and NRooks constraint preservation

I am implementing a raytracer, and I am in the middle of implementing samplers. A sampler is a generator of random points over a square x=0:1, y=0:1. Each sampler holds multiple sets of "random" samples, and each set contains a given number of…
Stefano Borini
  • 138,652
  • 96
  • 297
  • 431
7
votes
7 answers

Computer Graphics: Raytracing and Programming 3D Renders

I've noticed that a number of top universities are offering courses where students are taught subjects relating to Computer Graphics for their CS majors. Sadly this is something not offered by my university and something I would really like to get…
Mike B
  • 12,768
  • 20
  • 83
  • 109
7
votes
2 answers

Ray tracing via Compute Shader vs Screen Quad

I was recently looking for ray tracing via opengl tutorials. Most of tutorials prefer compute shaders. I wonder why don't they just render to texture, then render the texture to screen as quad. What is the advantages and disadvantages of compute…
7
votes
1 answer

Recursion in GLSL prohibited?

I ran into this error when trying to write the following recursive call. I have seen a lot of demos of implementations of recursive Ray tracing in GLSL so I assumed that GLSL supported recursion. Is this not the case? OpenGL is returning a compile…
138
  • 554
  • 5
  • 14
7
votes
1 answer

Why is my Monte Carlo Raytracing so noisy?

I have implemented global illumination using the Monte Carlo method, using the scratch a pixel tutorial as a guide. My final image renders very noisy! The example below is at 64 samples, I have previously used as high as 512 and its still very…
Arthur
  • 347
  • 1
  • 4
  • 14
7
votes
1 answer

Surface Area Heuristic (SAH) kd-tree of triangles - flat cells

I've implemented a SAH kd-tree based upon the paper On building fast kd-Trees for Ray Tracing, and on doing that in O(N log N) by Wald and Havran. Note I haven't done their splicing and merging suggestion right at the end to speed up the building of…
PeteUK
  • 1,062
  • 12
  • 26
7
votes
2 answers

Ray-Triangle Intersection C++

I am testing if a ray intersects a triangle. For the time being, I'm using the following code to test if there is an intersection between a triangle, and the ray from origin to the midpoint of the triangle: Ray *ray = new…
Adrian De Barro
  • 495
  • 2
  • 6
  • 21
7
votes
2 answers

Raytracing (LoS) on 3D hex-like tile maps

Greetings, I'm working on a game project that uses a 3D variant of hexagonal tile maps. Tiles are actually cubes, not hexes, but are laid out just like hexes (because a square can be turned to a cube to extrapolate from 2D to 3D, but there is no 3D…
7
votes
3 answers

3D coordinate of 2D point given camera and view plane

I wish to generate rays from the camera through the viewing plane. In order to do this, I need my camera position ("eye"), the up, right, and towards vectors (where towards is the vector from the camera in the direction of the object that the camera…
Myx
  • 1,792
  • 5
  • 23
  • 37
7
votes
2 answers

Data structure / approach for efficient raytracing

I'm writing a 3D raytracer as a personal learning project (Enlight) and have run into an interesting problem related to doing intersection tests between a ray and a scene of objects. The situation is: I have a number of primitives that rays can…
mikera
  • 105,238
  • 25
  • 256
  • 415
6
votes
3 answers

What is the purpose in this part of the Monte Carlo path tracing algorithm?

In all of the simple algorithms for path tracing using lots of monte carlo samples the tracing the path part of the algorithm randomly chooses between returning with the emitted value for the current surface and continuing by tracing another ray…
Burt Sampson
  • 887
  • 9
  • 7