News for hackers. Stuff that matters.
Re:Duke Nukem 3D Mirror Universe by Someone1234 on Friday March 19, 2021 @12:22PM (#26515196)
I agree. But it does raise an interesting philosophical question: At what level of advancement does a hack stop being a hack.

Like most would agree that Ray-Tracing is the "real deal" relative to shadow mapping, but with how far shadow mapping has come can it really be considered a "hack" still?

Re:Duke Nukem 3D Mirror Universe by seanwilson on Friday March 19, 2021 @01:12PM (#26515821)
> Like most would agree that Ray-Tracing is the "real deal" relative to shadow mapping, but with how far shadow mapping has come can it really be considered a "hack" still?

Even ray tracing isn't the real deal and isn't trying to closely simulate reality. You need to use hacks in ray tracing for soft vs sharp shadows, for light patterns on glass objects like wine glasses (caustics), to get illuminated surfaces to spread their colour to other objects (colour bleeding) and more.

Phonton mapping gets closer but is even more expensive:

https://en.wikipedia.org/wiki/Photon_mapping

Phonton mapping is trying to model the path of all photons being emitted from light sources back to the camera vs ray tracing that works backwards by tracing rays out of the camera back to the light sources i.e. ray tracing is an optimisation.

Re:Duke Nukem 3D Mirror Universe by gmueckl on Friday March 19, 2021 @05:29PM (#26518305)
This post deserves a long reply.

You seem to think that ray tracing as a very limited thing. I guess it stems from the fact that the nomenclature has become a bit murky in recent years. Ray tracing often is used to refer to the initial algorithm developed by Whitted. This has pretty much all these limitations you mention, but it is an obsolete method. What usually gets mixed in with ray tracing in marketing and non-expert discussions is also path tracing and its various variations. These methods are capable of solving the rendering equation exactly for a huge range of scenarios. Unfortunately, some variants deal with certain situations better than with others and there is no overall best algorithm. But you can most certainly trace absolutely perfect soft shadows or complex caustics with these methods. Color spills are a walk in the park even for simple unidirectional path tracing. The main limiting factor right now is that these are all Monte Carlo methods and need to draw high numbers of samples for each pixel to converge. This is why fast and accurate denoisers are such a huge deal at the moment. They are another hack, a last one that ideally fades away as the number of rays per second increases. Beyond that, it "just" comes down to modelling surfaces and materials accurately enough to get a photorealistic image.

As you mention photon mapping: it has pretty severe limitations, notably around the handling of specular paths and the biased artifacts created by the filter kernel (loght leaks, certain SDS-type paths aren't covered). There are some improvements like (A)PPM which converge to unbiased solutions with infinite runtime. At that point, path tracing based methods become more attractive w.r.t. runtime, memory requirements and implementation complexity.

Re:Duke Nukem 3D Mirror Universe by seanwilson on Friday March 19, 2021 @06:25PM (#26518746)
> You seem to think that ray tracing as a very limited thing.

My point was mainly that ray tracing is still a hack like polygon based rasterization is, that's a combination of clever tricks to get something to look good enough with modest resources.

Re:Duke Nukem 3D Mirror Universe by gmueckl on Friday March 19, 2021 @07:26PM (#26519198)
I'd advise you to be more precise in your wording. The terminology is a bit tricky. Path tracing (which I assume you're actually referring to) as a an algorithm isn't a hack at all. It's a direct Monte Carlo solution to the rendering equation which has a pretty straight, albeit long, derivation from Maxwell's equations. Ray tracing hardware (that is, hardware accelerated ray-geometry intersection computation) is still quite constrained computationally. That's why we see little actual path tracing in real time renderers at this time and more of the slightly more correct rasterization based hacks that include ray intersection queries instead of screen space/cubemap based guestimates. Calling them ray tracing is technically somewhat misleading in my opinion.
Re:Duke Nukem 3D Mirror Universe by account42 on Monday March 22, 2021 @05:25AM (#26538488)
You got that backwards, photon mapping is a hack in the same sense as shadow mapping while ray trasing is the real deal (although implementations will likely resort to hacks for perfromance reasons). Soft shadows are simply a matter of making light sources have a non-zero volume and while tracing rays from the camera instead of the lights is an optimization, it is a valid one that (given infinite rays) produces the correct result and is not a hack.
Re:Duke Nukem 3D Mirror Universe by core-questions on Friday March 19, 2021 @02:46PM (#26516973)
Is anyone doing realtime photon mapping, maybe using some of that RTX stuff?
Re:Duke Nukem 3D Mirror Universe by mike_d on Friday March 19, 2021 @04:11PM (#26517723)
Re:Duke Nukem 3D Mirror Universe by Frost1x on Friday March 19, 2021 @03:05PM (#26517155)
Here's where it gets tricky. I do a lot of modeling and simulation work that is often incorporated in interactive 3D environments and the conversation I have over and over where people fail to realize is that you're always taking shortcuts to simulate some aspect of reality.

The point of games is to get as close to reality that people suspend disbelief and can immerse themselves into the virtual reality you've created. Sometimes enough realism and immersion can be had at cheaper computational costs so these hacks (gross simplifications) are the way to go. Sometimes though, you realize if you can better model aspects of reality more accurately, you can get even better immersion a d suspension of disbelief.

In the world where more sophisticated computational models are utilized in these environments because the results are important, used beyond suspension of disbelief and actually need to map reality because the simulation is trying to accurately represent some aspect of reality for a real world decision to be made, you still have to take clever computational shortcuts. As far as we know that will always be true unless you build a simulation environment that can fully represent our reality which might never be possible from an engineering or even scientific standpoint.

So the discussion I often have is: what deviations from reality are we willing to tuck into our models and simulations? We already can't do all of existing science and we can't do what's beyond existing science so what tradeoffs can we accept in the subset of science for our simulation.

Even raytracing doesn't go far enough because it takes a lot of shortcuts with reality. Pretty much none of these engines take into account relativistic distortions of light (some work has been done) and they frankly don't need to for almost every application outside of visualizing gravitational lensing and black holes accurately. In sure some bright physicist reading this is aware of even more faults in light and photon models and simulation approaches I'm completely unaware of. The onion peels quite far. The most obvious missing aspect for all environments is that we always simplify the actual geometry of the space because we have to.

Re:Duke Nukem 3D Mirror Universe by gmueckl on Friday March 19, 2021 @05:42PM (#26518409)
Well, there is a very obvious limit to the fidelity of your simulation if presence is your goal: human perception. You don't need to crank up any details beyond what you can possibly perceive when using the simulation. Gravitational space distortions are the least worrisome effects in that regard. Light diffraction and polarization play a much larger role in our environment, although not often and if it happens, the untrained eye tends not to notice. I am talking about things like birefringent materials (quartz crystals) and diffraction effects like light reflected off of a CD or shining through a thin piece of cloth.

You can repeat the same process with each kind of sensory input a human can perceive and get to pretty hard limits on the requirements to get "perfect" realism. Human perception hasn't been researched in enough detail yet to give accurate bounds in all cases, but this is actively being worked on. The known bounds are mostly really conservative ones.

Re:Duke Nukem 3D Mirror Universe by schoen on Friday March 19, 2021 @11:58PM (#26520709)
I wonder if there's a problem where, in a realistic enough simulation, people could find or build objects that should be equivalent to instruments like telescopes and microscopes, and then expect them to work properly! (Or more generally, instruments that enhance their senses, like an ear trumpet or parabolic microphone.)
Re:Duke Nukem 3D Mirror Universe by nyanpasu64 on Friday March 19, 2021 @07:49PM (#26519316)
Missing features in most game engines include spectral rendering (supported in some programs) and diffraction effects/Fourier optics (I think only really supported in radar design programs, not visual renderers).
Re:Duke Nukem 3D Mirror Universe by _jal on Friday March 19, 2021 @12:30PM (#26515314)
This starts drifting way off topic, but hacks are typically characterized by being "clever". Which is hard to define, but is usually surprising in some way.

I think it stops being a hack when the surprise is gone - when you've explored the mechanism, understand the tradeoffs, where it does make sense and doesn't, etc.

Re:Duke Nukem 3D Mirror Universe by meheleventyone on Friday March 19, 2021 @12:56PM (#26515655)
I'd say a hack is a technique with caveats that let's you work around a limitation. Ray tracing is still too computationally expensive so the current raster pipeline is all a hack to work around that fact. It's also an incredibly well established and close to ground truth hack but there are lots of caveats where things go astray. Off the top of my head transparency is still largely problematic.
Re:Duke Nukem 3D Mirror Universe by dfxm12 on Friday March 19, 2021 @02:11PM (#26516599)
At what level of advancement does a hack stop being a hack.

Maybe when it becomes documented or otherwise supported?

Re:Duke Nukem 3D Mirror Universe by tshaddox on Friday March 19, 2021 @02:43PM (#26516941)
I think when we talk about something being a hack, we have a context in mind and a goal in mind, and the "hack" is just the way we achieved this goal that wasn't immediately obvious within this context. Of course, once this non-obvious solution becomes well-known, it's incorporated into the context and thus is no longer thought of as a "hack."