5 ms·
> Rays can end up anywhere, no matter where the camera is pointing, isn't that right? Only indirect or secondary rays. Primary rays (the ones from the camera)
by magicalhippo 7y ago
> Rays can end up anywhere, no matter where the camera is pointing, isn't that right?
Only indirect or secondary rays. Primary rays (the ones from the camera) can only hit things that are visible to the camera.
Also, ray-tracing trivially allows for breaking up the rendering in multiple steps.
You could for example have a pre-made acceleration structure for the static part of the world, a less efficient but fast-building one for dynamic objects in the world, cast against either and see which intersection has the shortest distance. This could be done in parallel, and you can be more clever about it too depending on circumstances.
Not saying that's what people do, I've been out of the game for too long, but at least it's an option.
- chrisseaton 7y ago> can only hit things that are visible to the camera Isn't the whole point of ray tracing things like refraction? Otherwise why not just rasterise?
- correct_horse 7y agoI think you're generally correct, but that games studios and animators don't care much about refraction specifically (although it does make for cool tech demos). They care more about reflection and lighting in general (spotlights such as windows, true area lights - no point lights disguised as area lights using emmisive textures)
- BubRoss 7y agoRay tracing can be used for different camera projections, sharp reflections, sharp refractions, sharp shadows and other things like physics. (Also it's rasterize)
- pavlov 7y ago“...rasterize” — that’s American, rasterise is correct in UK and countries that follow their English spelling.
- chrisseaton 7y ago> Ray tracing can be used for different camera projections, sharp reflections, sharp refractions, sharp shadows and other things like physics. I know. But you may need geometry that isn’t trivially visible in order to render these things. > (Also it's rasterize) I’m British. Not everyone does things the American way. Don’t try to push your approach on everyone else.
- BubRoss 7y agoPeople keep giving you the answers and you don't seem to accept them. You said you thought it was just useful for refraction, this is what it is useful for in games, including different camera projections. Another person replied and told you that the acceleration structure can be dynamic with geometry inserted and taken out.
- chrisseaton 7y ago> You said you thought it was just useful for refraction "things like refraction". Not "just".
- BubRoss 7y agoYou said you thought ray tracing was never used for direct rays and only for indirect days along with asking how the rays have access to the full scene geometry and both questions have been answered thoroughly.
- chrisseaton 7y ago> You said you thought ray tracing was never used for direct rays I didn't say this anywhere. You're imagining extra words between what I actually said. Everyone else in this thread understood my question, and they managed to answer it without also ignorantly trying to correct my spelling.
- BubRoss 7y ago
- deleted 7y ago[deleted]
- joshspankit 7y agoOne of the turning points was to actually work backwards: instead of calculating every ray from a light source, then throwing away anything that doesn’t hit the camera, ray tracing now starts with the ray endpoints that end at the camera, thus saving all that work that needs to be thrown out the other way. Reflections do need access to the geometry off-camera, but it’s accessible in some for or another by needing to be available when the player looks at it, as well as needing to exist for gameplay interaction (such as an enemy shooting from off-camera)
- magicalhippo 7y agoActually once you get a sufficient number of triangles, it can be faster to ray-trace than rasterize, as rasterized triangles have to be drawn, while ray-traced triangles can be skipped thanks to the acceleration structure. Anyway, yeah sure the fun is typically doing secondary rays, but you could do those with the tricks I mentioned, and/or with reduced detail (thus faster to update) unless you're doing perfect reflection/refraction.