raytracing

Literature and tutorials for writing a ray tracer

与世无争的帅哥 提交于 2019-11-27 16:53:07
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 ray tracing. Ideally, the approach would be incremental and tutorial in style, and explain both the programming techniques and underyling mathematics, starting from the basics. Boojum "Ray Tracing from the Ground Up" by Kevin Suffern for getting started. "Physically Based Rendering" by Matt Pharr and Greg Humphreys for a more advanced take on it when you've gotten comfortable with the basics. And if you get

How do I initialize the t-variables in “A Fast Voxel Traversal Algorithm for Ray Tracing”?

一世执手 提交于 2019-11-27 13:43:45
问题 I am trying to implement the algorithm explained on this paper, used to traverse grid cells in order following a straight line, which is useful for ray tracing: http://www.cse.yorku.ca/~amana/research/grid.pdf The paper describes the algorithm as two parts: initialisation and iterative traversal. I can undersand the iterative traversal part, but I'm having trouble understanding how some of the variables in the initialisation part are calculated. I need help initialising tMaxX , tMaxY ,

How to do ray plane intersection?

亡梦爱人 提交于 2019-11-27 13:06:40
问题 How do I calculate the intersection between a ray and a plane? I have been visiting every possible website I can find and this is what I have achieved so far: float denom = normal.dot(ray.direction); if (denom > 0) { float t = -((center - ray.origin).dot(normal)) / denom; if (t >= 0) { rec.tHit = t; rec.anyHit = true; computeSurfaceHitFields(ray, rec); return true; } } This does not work :s My function input is: ray: that contains origin and direction. rec: a container class for storing hit

Using javascript for custom purposes

喜欢而已 提交于 2019-11-27 02:13:45
I am writing a raytracer as a part of my complete 3d engine. I am planning on using javascript for the scripting language instead of writing my own. The question is how can I use it? Btw the raytracer and the UI are written in C#. This shows the two-way interaction between Javascript and c#. Javascript calls a c# method C# gets the result of an expression in Javascript - Type scriptType = Type.GetTypeFromCLSID(Guid.Parse("0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC")); dynamic obj = Activator.CreateInstance(scriptType, false); obj.Language = "javascript"; obj.AddObject("MyClass",new JSAccessibleClass

Literature and tutorials for writing a ray tracer

北城余情 提交于 2019-11-26 18:46:34
问题 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 ray tracing. Ideally, the approach would be incremental and tutorial in style, and explain both the programming techniques and underyling mathematics, starting from the basics. 回答1: "Ray Tracing from the Ground Up" by Kevin Suffern for getting started. "Physically Based Rendering" by Matt Pharr and Greg

Using javascript for custom purposes

大兔子大兔子 提交于 2019-11-26 10:01:30
问题 I am writing a raytracer as a part of my complete 3d engine. I am planning on using javascript for the scripting language instead of writing my own. The question is how can I use it? Btw the raytracer and the UI are written in C#. 回答1: This shows the two-way interaction between Javascript and c#. Javascript calls a c# method C# gets the result of an expression in Javascript - Type scriptType = Type.GetTypeFromCLSID(Guid.Parse("0E59F1D5-1FBE-11D0-8FF2-00A0D10038BC")); dynamic obj = Activator

Algorithm for 2D Raytracer

♀尐吖头ヾ 提交于 2019-11-26 10:00:47
问题 I want to do a programmatical RayTracer in Java for demo purpose while giving a presentation about Ray Tracing in general (also mentioning 3D, this 2D model should only be for easier understanding, and to train my general Java knowledge). My problem is, that i dont know where to start this whole thing. The first thing i would try is to use vectors to trace every pixel on the screen from a given coordinate (eg. the position of my mouse cursor). Then I would calculate if the vector intersects

Precise subpixel line drawing algorithm (rasterization algorithm)

不打扰是莪最后的温柔 提交于 2019-11-26 09:02:47
问题 I need an algorithm which can be (a bit) slower than the Bresenham line drawing algorithm but has to be a lot more exact. With \'exact\' I mean: every touched pixel should be printed. No more, but also no less! Which means using a more thick line or similar is not an option as too many pixels will be involved. Also I don\'t need a graphic framework or similar like it was asked before, I need the algorithm! The application is not really in \'graphics\' it is in the geography area where pixels

Reflection and refraction impossible without recursive ray tracing?

一世执手 提交于 2019-11-25 23:19:01
问题 I am writing a GPU-based real-time raytracing renderer using a GLSL compute shader. So far, it works really well, but I have stumbled into a seemingly unsolvable problem when it comes to having both reflections and refractions simultaneously. My logic tells me that in order to have reflections and refractions on an object, such as glass, the ray would have to split into two, one ray reflects off the surface, and the other refracts through the surface. The ultimate colours of these rays would