raytracing

Pinning pointer arrays in memory

I'm currently working on a ray-tracer in C# as a hobby project. I'm trying to achieve a decent rendering speed by implementing some tricks from a c++ implementation and have run into a spot of trouble. The objects in the scenes which the ray-tracer renders are stored in a KdTree structure and the tree's nodes are, in turn, stored in an ...

raytracing with CUDA

I'm currently implementing a raytracer. Since raytracing is extremely computation heavy and since I am going to be looking into CUDA programming anyway, I was wondering if anyone has any experience with combining the two. I can't really tell if the computational models match and I would like to know what to expect. I get the impression t...

Is there a Java-based ray tracing model that can be adapted for use in underwater acoustics?

I am looking for an open-source Java-based raytracing system suitable for use in modeling underwater ray-based acoustics. Such a package might be similar to the Comprehensive Acoustic System Simulation (CASS) with the Gaussian Ray Bundle (GRAB) but I would prefer an open-source, free-to-use or free-to-modify model that I can use in pres...

What is the formula for alpha blending for a number of pixels?

I have a number of RGBA pixels, each of them has an alpha component. So I have a list of pixels: (p0 p1 p2 p3 p4 ... pn) where p_0_ is the front pixel and p_n_ is the farthest (at the back). The last (or any) pixel is not necessary opaque, so the resulting blended pixel can be somehow transparent also. I'm blending from the beginning o...

Calculating which tiles are lit in a tile-based game ("raytracing")

I'm writing a little tile-based game, for which I'd like to support light sources. But my algorithm-fu is too weak, hence I come to you for help. The situation is like this: There is a tile-based map (held as a 2D array), containing a single light source and several items standing around. I want to calculate which tiles are lit up by th...

Textured spheres without strong distortion

I've seen well-textured balls, planets, and other spherical objects in couple of games, last time in UFO: aftermath. If you just splatter a texture into latitude/longditude as u and w -coordinates you'll get lots of ugly texture distortion to poles. I can think myself an one way to implement a spherical map with minimum distortion. By m...

What is the fastest way to find the point of intersection between a ray and a polygon?

Pretty much as the question asks. Answers preferably in pseudo code and referenced. The correct answer should value speed over simplicity. ...

RayTracer project in C#

When I was at university, I took a subject in raytracing (graphics synthesis) and we got a chance to write a 3D ray tracer in C++. That was heaps of fun, except I long ago lost my code in the great hard drive crash of '04'....many files were lost... Is there a RayTracer I can play with in C# that isn't written in one line? Something tha...

Literature and Tutorials for Writing a Ray Tracer

I am interested in finding recommendations on books on writing a raytracer, simple and clear implementations of ray tracing that can be seen on the web, and online resources on introductory raytracing. Ideally, the approach would be incremental and tutorial in style, and explain both the programming techniques and underyling mathematics...

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 into sometime in the next couple of years. A couple of the projects I've found from some u...

Projecting a screen for a camera

I'm trying to learn a little more on vectormath through writing a simple ray tracer and I've been doing some reading on it, but what I haven't been able to find is how to determine the direction of the primary rays. This sounds like a simple problem and probably is, but with my current knowledge I haven't been able to figure it out. I ...

What is the best approach to compute efficiently the first intersection between a viewing ray and a set of objects ?

For instance: An approach to compute efficiently the first intersection between a viewing ray and a set of three objects: one sphere, one cone and one cylinder (other 3D primitives). ...

What's wrong with my soft-shadow code?

I'm trying to write a simple raytracer as a hobby project and it's all working fine now, except I can't get soft-shadows to work at all. My idea of soft-shadows is that the lightsource is considered to have a location and a radius. To do a shadow test on this light I take the point where the primary ray hit an object in the scene and cas...

How do you calculate the Angle of Incidence?

I'm working on a raytracer for a large side project, with the goal being to produce realistic renders without worrying about CPU time. Basically pre-rendering, so I'm going for accuracy over speed. I'm having some trouble wrapping my head around some of the more advanced math going on in the lighting aspects of things. Basically, I have...

When are structs the answer?

I'm doing a raytracer hobby project, and originally I was using structs for my Vector and Ray objects, and I thought a raytracer was the perfect situation to use them: you create millions of them, they don't live longer than a single method, they're lightweight. However, by simply changing 'struct' to 'class' on Vector and Ray, I got a v...

Anyone know of a really good book about Ray Tracing?

Hi there, I need to do some research on ray tracing and create my own ray tracer. Can you guys name any good books on the subject? Thanks! ...

Ray-Polygon Intersection Point on the surface of a sphere

I have a point (Lat/Lon) and a heading in degrees (true north) for which this point is traveling along. I have numerous stationary polygons (Points defined in Lat/Lon) which may or may not be convex. My question is, how do I calculate the closest intersection point, if any, with a polygon. I have seen several confusing posts about Ray T...

Improving raytracer performance

I'm writing a comparatively straightforward raytracer/path tracer in D (http://dsource.org/projects/stacy), but even with full optimization it still needs several thousand processor cycles per ray. Is there anything else I can do to speed it up? More generally, do you know of good optimizations / faster approaches for ray tracing? Edit:...

Are there any rendering alternatives to rasterisation or ray tracing?

Rasterisation (triangles) and ray tracing are the only methods I've ever come across to render a 3D scene. Are there any others? Also, I'd love to know of any other really "out there" ways of doing 3D, such as not using polygons. ...

Best thing for 3D and raytracing

I want to play around with some graphics stuff. Simple animations and things. I want to fool around with raytracing too. I need help finding a library that will help me do these things. I have a few requirements: Must be able to do raytracing Must be for a high level language (python, .NET, etc.). Please no C/C++ Must have good documen...