2
$\begingroup$

If I'm not mistaken, you can make a hybrid renderer which lets a rasterizer solve the visibility problem, then shade all of the projected shapes with a raytracing algorithm. It seems that this isn't commonly done however, what's the reason for that? Oversight?

$\endgroup$
0
$\begingroup$

Disclosure: I work for IMG/PowerVR

Indeed there are rendering systems that can do this: Imagination demonstrated hybrid rendering on their "Wizard" Ray Tracing/Rasterisation system. Scroll down to "Making ray tracing happen" and there is a screen grab of a hybrid demo.

As others have mentioned, there are pros and cons: Some advantages include that rasteriser can be extremely efficient at handling the first set of intersections and, for shadows, you don't spend effort pre-rendering portions of shadow maps that may never be visible in the final render. On the downsides, you are typically constrained to the standard pinhole camera model.

$\endgroup$
3
$\begingroup$

Rasterization is sometimes used for primary rays. However, it limits greatly what you can do - depth of field, motion blur, participating media, refraction, only basic camera models, no adaptive or custom sampling, etc.

$\endgroup$
  • $\begingroup$ Using the z-buffer should enable you to make an approximate of the DOF effect. I don't see how it limits refraction however. Lets suppose you don't actually render the triangles using rasterization, you just tell the raytracer which portions of which triangles to shade given the z buffer (now you have your t-parameter which gives you a hitpoint ), you should be able to just refract that. $\endgroup$ – AnnoyinC Nov 5 at 10:19
  • $\begingroup$ @AnnoyinC This "approximation will be arbitrarily bad. In general dof depends on the aperture of your camera, which you cannot really model very well in rasterization. The issue with refraction, is that if you put a glass panel in front of your camera, your rasterization will effectively just "intersect" the glass panel, which may be made from 2 triangles, so you don't get the usual high gain compared to ray tracing. $\endgroup$ – lightxbulb Nov 5 at 10:29
  • $\begingroup$ @lightxbuld in that example, a pure raytracer would be even slower. It woul raytrace the first intersection, and then the refraction/reflection, so it has to do 2/3 passes for a render. Offloading the first pass to a rasterizer would still provide gains. $\endgroup$ – AnnoyinC Nov 7 at 18:01
  • $\begingroup$ @AnnoyinC I wouldn't be so sure. In rt you may hit the bounding box of this glass quad and be done, in a rasterizer you may have to render millions of tris hidden behind it. $\endgroup$ – lightxbulb Nov 7 at 18:30
  • $\begingroup$ Oh, I see what you mean now. Yeah, I was thinking along the lines of "get a very simple rasterizer to simply get the nearest triangle for each pixel, then use a raytracer as a shader." Then the raytracing shader can concern itself with material properties like transparency. $\endgroup$ – AnnoyinC Nov 7 at 18:43
1
$\begingroup$

There are renderes that do this. Most notably Pixars Renderman prefers to work this way. Hybrid renderers can work in other ways too...

It used to be that hybrid renderers like this were quite common, they still are somewhat in software only implementations. They are slowly being replaced though by a new breed of trace only renderes though. Mostly the reason is that by foregoing the other you get a simpler piece of code.

$\endgroup$
0
$\begingroup$

Because when you test the visibility of a fragment during rasterization you already know (or can easily calculate) all the details that raytracing will give you.

So doing the ray-triangle collision calculation is redundant.

But it is the additional lighting beyond the first hit where raytracing is helpful. However each ray is only a small part of what contributes to the lighting in a scene, so you need a lot of them per fragment. And each ray has relatively large cost to compute.

Those two properties make raytracing not very atractive for real-time rendering without some dedicated acceleration.

$\endgroup$
  • $\begingroup$ "Those two properties make raytracing not very atractive for real-time rendering without some dedicated acceleration" One could probably say the same for rasterisation. ;-) $\endgroup$ – Simon F Nov 5 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.