r/GraphicsProgramming • • Jan 29 '23

The Impossible In Real Time Graphics

What is somthing that a computer cant render in realtime?

2 Upvotes

28 comments sorted by

21

u/waramped Jan 29 '23 edited Jan 29 '23

A mirrored room half full of sloshing water with a dynamically shape shifting area light shining in from above.

Edit: u/Erik1801 has defeated me :(

15

u/[deleted] Jan 29 '23

i think i can do that if the resolution is 1x1

0

u/haxiomic Jan 30 '23

The VR graphics community does sort of thing for breakfast https://twitter.com/shr_id/status/1590979294146490368

7

u/waramped Jan 30 '23

That's very cool, but there are no caustics or other light refraction or reflection which is what I was getting at. :)

I want to play that tho.

1

u/haxiomic Jan 30 '23 edited Jan 30 '23

@Michael_Moroz_ is worth checking out, he's the engineer behind Zibra Fluids in Unity

https://twitter.com/Michael_Moroz_/status/1590041775737294848

https://twitter.com/Michael_Moroz_/status/1595076099670933504

4

u/AndrewPGameDev Jan 30 '23

Here's a paper: https://users.cs.duke.edu/~reif/paper/tygar/raytracing.pdf that shows that raytracing is either in PSPACE or undecidable, which in both cases would mean that even rendering a single pixel in a given (worst-case) scene would be impossible (in PSPACE it would be practically impossible, while if undecidable it would be literally logically impossible).

If we limit ourselves to real time, there are many more scenes we can't render in real time. Scenes with a lot of caustics, scenes that rely heavily on dispersion (think prisms splitting light into different colors), scenes that have extremely complicated geometry, and scenes that also have to simulate very complicated physical systems (like sloshing water) are some examples of scenes that are more difficult to render. Depending on the device you're trying to render them and the quality you're willing to accept, it may or may not be possible.

3

u/captainAwesomePants Jan 30 '23

Just to be a technical nitpicker, being in PSPACE is not a problem. Most problems are in PSPACE. The paper suggests that raytracing is PSPACE-hard, which means that the problem is at least as hard as the hardest problem in PSPACE, and that's much worse.

1

u/wm_lex_dev Feb 01 '23

Isn't ray-tracing an approximation of real-world phenomena? It seems strange for a sort-of-physical phenomenon to be undecidable.

3

u/the_Demongod Jan 30 '23

Wave simulations in general require orders of magnitude more computational power than raytracing, so anything involving real-time acoustic propagation or situations where the wavelength of light can no longer be considered small relative to the scene geometry.

6

u/[deleted] Jan 29 '23

basically anything physically accurat

6

u/thesubcutaneousphony Jan 29 '23

Hmm I wouldn't say basically anything. Controlling for some lighting we can model real life indistinguishably see: https://www.graphics.cornell.edu/online/box/compare.html

Here is a comparison of a rendered scene vs the same scene in real life. Pretty cool no? The rendering equation is physically based and we can approximate it well with a lot of advanced ray tracing techniques. Obviously you have to do some monte Carlo estimation and early stopping, since you can't bounce rays forever.

2

u/crimson1206 Jan 29 '23

That’s (highly likely) not real time though. Would be interesting to see what the most physically accurate real time hacks would look like compared to a path tracer for such a simple scene

-3

u/[deleted] Jan 29 '23

I am taking the shit out of OP here a bit. Nothing we render is actually accurat in any capacity because we are doing Pathtracing. Right rays are emitted from the Camera. Which is not how anything works. So by default no render engine can 100% be accurat. You see that with Caustics especially.

Obviously, our current approximations are rock solid. Like General Relativity or the Laws of Thermodynamics.
The framing of the question is just not very useful.

Even so, we dont actually know why a lot of stuff happens. For example, the IOR of a Material is a fraction the speed of light. Right inside of a Medium such as Glass the speed of light is physically slower. We broadly know why it happens but there is no analog or good way to explain it outside of a set of Wavefunctions of Quantum Field Theory that have to be evaluated for an infinit number of possible states.
Saying "IOR of 1.4 means we deflect the ray like this" is fine, just not the way to works in reality. Hence why just doing IOR / Refraction does not yield any refraction patterns. Like the splitting of Wavelengths. If we actually simulated the Quantum Mechanical effect, we wouldnt have to do any Dispersion approximations as it would all just be baked in.

5

u/Gravitationsfeld Jan 29 '23

As long as the renderer is guaranteed to converge to an unbiased reault it's completetely irrelevant what direction the rays are cast from. It's mathematically identical. It's like saying 3 * 5 and 5 * 3 are different.

-5

u/[deleted] Jan 29 '23

Mathematically, yes. Physically ? No. Big differnce sadly.

3

u/crimson1206 Jan 29 '23

What would be the difference then?

The point of unbiased/consistent estimators is that they converge to the actual quantity they are supposed to estimate. So assuming that the underlying equation you integrate is physically correct (which it mostly is) path tracers will get physically correct images

0

u/[deleted] Jan 29 '23

(which it mostly is)

thats the issue. They arent. People seem to get pretty pissed so ill keep it short. I come from a physics background with FX being my current work. So, it is not accurat to say that for example the render equation is a perfect analog to the real thing.
It dosnt take things like Wavelength, diffraction and other light effects into account. And it shouldnt. Those are the effects that come from Quantum mechanical effects. Hence why for example dispersion has to be simulated using an entirly differnt approach.

3

u/crimson1206 Jan 29 '23 edited Jan 29 '23

That doesn’t answer the question what difference the ray cast direction makes.

With a physics background I’d expect a bit more awareness of what physical models are supposed to do. You make some assumptions leading to simplifications while trying to keep realism. Sure some basic models don’t take some effects into account, that doesn’t mean that all of rendering is physically inaccurate (which is pretty much what you are stating).

And as stated in another comment wavelength dependent effects don’t need to come from quantum level models you can also get them by explicitly taking wavelength into account in the rendering equation (which is not an entirely different approach)

0

u/[deleted] Jan 29 '23

physical models are supposed to do.

Thats why we have two differnt sets of physics. The real question is what you want a model to do. For example, maybe you have seen it, but i made a post yesterday or so about a Black hole rendering project. In there Geodesics are calculated using the math of GR. But that integration cannot take place over infinitly many steps. This results in the final image being inaccurat on a fundamental level. It is not a physical analog but rather just a approximation of ONE aspect of the real thing.

This entire conversation is a bit besides the point because my argument was never that modern renderes are not good. Just that they are fundamentally not accurat. No model is. Not even General Relativity.

That doesn’t answer the question what difference the ray cast direction makes.

One rather obvious one is the apparent brightness. When casting rays from the camera you have to use the Dot product with the surface normal to get a brigthness value for nearby lights.
Something you dont have to do when light is emitted from actual lights.
In any case, that dot product is a very good approximation but fundamentally not accurat to the real thing.

1

u/crimson1206 Jan 29 '23

Yeah I think we were just using different definitions of words which made this whole discussion a bit pointless lol

Yeah I saw your post (and actually answered a few of your questions about volume interactions), it looked really cool^

Can you elaborate a bit about the "something you don’t have to do when light is emitted from an actual light"? I’m not really sure what exactly you mean here

→ More replies (0)

3

u/thesubcutaneousphony Jan 29 '23

There is a difference between simple path tracing and other ray-tracing methods. You don't just have to shoot rays from the camera. Bidirectional light tracing combines light emitted rays with camera emitted rays with smart methods. Photon mapping also works in a similar way caching light on diffuse surfaces which naive path tracing can't account for. Also regarding the deflection of light due to wavelengths, we can account for it with chromatic abbarations which does exactly what you mentioned, splits the light into wavelengths. To be pedantic, yes we can't simulate all of the physics due to computational requirements in Monte Carlo ray tracing. But given infinite recursions the rendering equation would be solved. Maybe the correct way to go about solving physically based ray-tracing is with neural radiance fields, which try to fit scenes with corresponding images with volumetric ray tracing. Some problems with this still but they are looking pretty nice so far.

Also regarding the IOR, I have also had confusions about this. I'm not too familiar with light physics myself.

1

u/crimson1206 Jan 29 '23

You don’t need to go down to the quantum model to get dispersion. You sample wavelengths in the path tracer and use wavelength dependent IoRs to get accurate results

0

u/[deleted] Jan 29 '23

I am not saying you have to. We seem to have differnt ideas of accurat. Because analogs are not accurat.
If you want it accurat, yes you have to do the field equations. If you want something that looks 99.9% the same and computes a gazillion times quicker, you do a roughy statistical approximation.

2

u/crimson1206 Jan 29 '23

Ok yes we do indeed have different interpretations of accurate. And I can very certainly say that your definition of accurate is not what people usually mean when they say physically accurate.

At the end of the day QM is also just a model. So even our best current models wouldn’t be physically accurate if we go with your definition of exactly matching what’s happening in reality

1

u/[deleted] Jan 29 '23

say that your definition of accurate is not what people usually mean when they say physically accurate.

that is true.

At the end of the day QM is also just a model. So even our best current models wouldn’t be physically accurate if we go with your definition of exactly matching what’s happening in reality

and thats what physics is all about.

1

u/RCL_spd Feb 09 '23

Translucency is really hard, especially if ordered (e.g. one translucent object encompassing another, but neither strictly behind nor in front, like a torus with a sphere inside). Not impossible, but can present challenges for the performance and/or generality.