Reflection (computer graphics): Difference between revisions

Content deleted Content added
AnomieBOT (talk | contribs)
m Dating maintenance tags: {{Full citations needed}}
m Approaches to reflection rendering: Add spaces between word and round bracket
 
(18 intermediate revisions by 14 users not shown)
Line 1:
{{short description|Simulation of reflective surfaces}}
{{FullMore citations needed|date=AprilNovember 20202022}}
[[Image:Refl sample.jpg|frame|right|[[Ray tracing (graphics)|Ray-traced]] model demonstrating specular reflection.]]
'''Reflection''' in [[computer graphics]] is used to emulaterender [[reflection (physics)|reflective]] objects like [[mirror]]s and shiny surfaces.
 
Accurate reflections canare becommonly accomplishedcomputed e.g. by ausing [[Ray tracing (graphics)|ray tracetracing]] rendererwhereas by following a ray from the eye to the mirror and then calculating where it bounces from, and continuing the process until no surface is found, or a non-reflective surface is found. Approximateapproximate reflections can usually be computed faster by using simpler methods such as [[environment mapping]]. ReflectionReflections on a shiny surfacesurfaces like wood or tile can add to the photorealistic effects of a [[3D rendering]].
 
*'''Polished''' - A polished reflection is an undisturbed reflection, like a mirror or chrome.
*'''Blurry''' - A blurry reflection means that tiny random bumps on the surface of the material cause the reflection to be blurry.
*'''Metallic''' - A reflection is metallic if the highlights and reflections retain the color of the reflective object.
*'''Glossy''' - This term can be misused. Sometimes, it is a setting which is the opposite of blurry (e.g. when "glossiness" has a low value, the reflection is blurry). However, some people use the term "glossy reflection" as a synonym for "blurred reflection". Glossy used in this context means that the reflection is actually blurred.
 
==Approaches to reflection rendering==
[[File:CG reflections comparison.png|thumb|right|upright=1|Comparison of accurate reflections computed with [[path tracing]] (left), approximate reflections with [[environment mapping]] (middle), and screen space reflections (right).]]
For rendering environment reflections there exist many techniques that differ in precision, computational and implementation complexity. Combination of these techniques are also possible.
 
[[Image and object order rendering|Image order rendering]] algorithms based on tracing rays of light, such as [[Ray tracing (graphics)|ray tracing]] or [[path tracing]], typically compute accurate reflections on general surfaces, including multiple reflections and self reflections. However these algorithms are generally still too computationally expensive for real time rendering (even though specilizedspecialized HW exists, such as [[Nvidia RTX]]) and require a different rendering approach from typically used [[rasterization]].
 
Reflections on planar surfaces, such as planar mirrors or water surfaces, can be computed simply and accurately in real time with two pass rendering — one for the viewer, one for the view in the mirror, usually with the help of [[stencil buffer]].<ref>{{cite journal |last1=Kligard |first1=Mark |title=Improving Shadows and Reflections via the Stencil Buffer |date=1999 |pages=7 |url=https://www.researchgate.net/publication/238248138_Improving_Shadows_and_Reflections_via_the_Stencil_Buffer 238248138|journal=[[ResearchGate]]|accessdate=25 April 2020}}</ref> Some older video games used a trick to achieve this effect with one pass rendering by putting the whole mirrored scene behind a transparent plane representing the mirror.<ref>{{cite AV media video| title =Off Camera Secrets, Metal Gear Solid: Twin Snakes - Boundary Break|url =https://www.youtube.com/channel/UCHTnEwQKNwm49CQeCVZogMwwatch?pagev=1&sort_by=popularfas0zJ8C7GU|time =4:32|date=2016-11-28|access-date =25 April 2020}}</ref>
 
Reflections on non-planar (curved) surfaces are more chalengingchallenging for real time rendering. Main approaches that are used include:
 
*[[Environment mapping]] (e.g. [[cube mapping]]): a technique that has been widely used e.g. in video games, offering reflection approximation that's mostly sufficient to the eye, but lacking self-reflections and requiring prerenderingpre-rendering of the environment map.<ref name="randima">{{cite book |last1=Fernando |first1=Randima |last2=Kilgard |first2=Mark |title=The Cg tutorial. The definitive guide to programmable real-time graphics |date=2003 |publisher=Addison-Wesley Professional |isbn=9780321194961}}</ref>{{rp|174}} The precision can be increased by using a spatial array of environment maps instead of just one. It is also possible to generate cube map reflections in real time, at the cost of memory and computational requirements.<ref name="Hongtongsak">{{Cite web |last=Hongtongsak |first=Kevin |title=Dynamic Cubemapping |url=https://people.engr.tamu.edu/sueda/courses/CSC471/2016S/demos/khongton/index.html |access-date=2024-03-09 |website=people.engr.tamu.edu}}</ref>
*[[Screen space reflections]] (SSR): a more expensive technique that traces reflection rays income screenfrom space (as opposed to worldpixel space in edata.g. ray tracing). This isrequires donethe fordata eachof renderedsurface pixelnormal ofand theeither reflecteddepth surface,buffer using(local thespace) surfaceor normalposition andbuffer scene(world depthspace). The disadvantage is that objects not captured in the rendered frame cannot appear in the reflections, which results in unresolved and or false intersections andcausing incompleteartefacts such as reflection vanishment and virtual image. SSR was originally introduced as Real Time Local Reflections in [[CryENGINE 3]].<ref>{{cite web |last=Kasyan |first=Nickolay |last2=Schulz |first2=Nicolas |last3=Sousa |first3=Tiago |date=18 August 2011 |title=Unity-Technologies:Secrets Screenof spaceCryENGINE Reflections3 Graphics Technology |url=httpshttp://githubwww.comklayge.org/Unity-Technologiesmaterial/PostProcessing4_1/wikiSSR/Screen-space-ReflectionsS2011_SecretsCryENGINE3Tech_0.pdf |accessdate=2527 AprilNovember 20202022}}</ref>
 
==Types of reflection==
==Examples==
 
;Polished
*'''Polished''' - A polished reflection is an undisturbed reflection, like a mirror or chrome surface.
;Blurry
*'''Blurry''' - A blurry reflection means that tiny random bumps on the surface of the material causecauses the reflection to be blurry.
;Metallic
*'''Metallic''' - A reflection is metallic if the highlights and reflections retain the color of the reflective object.
;Glossy
*'''Glossy''' - This term can be misused.: Sometimessometimes, it is a setting which is the opposite of blurry (e.g. when "glossiness" has a low value, the reflection is blurry). However, some people useSometimes the term "glossyis reflection"used as a synonym for "blurred reflection". Glossy used in this context means that the reflection is actually blurred.
 
===Polished or mirror reflection===
[[Image:Mirror2.jpg|frame|right|Mirror on wall rendered with 100% reflection.]]
Mirrors are usually almost 100% reflective...
{{clear}}
 
Line 50 ⟶ 55:
{{clear}}
 
==Examples of reflections==
==See also==
 
===Wet floor reflections===
* [[{{anchor|Wet floor effect]]}}
The ''wet floor effect''<ref>{{cite web|url=http://twinsparc.com/a/wetfloor/|title=WetFloor|author=Nate|archive-url=https://web.archive.org/web/20080531144057/http://twinsparc.com:80/a/wetfloor/|archive-date=2008-05-31}}</ref>{{better source needed|date=November 2022}}
is a [[Computer graphics|graphic]] [[Special effect|effect]]s technique popular in conjunction with [[Web 2.0]] style pages, particularly in [[logo]]s. The effect can be done manually or created with an auxiliary tool which can be installed to create the effect automatically. Unlike a standard computer reflection (and the [[Java (programming language)|Java]] water effect popular in first-generation web [[Digital image|graphics]]), the wet floor effect involves a [[gradient]] and often a slant in the reflection, so that the mirrored image appears to be [[Levitation (physics)|hovering]] over or resting on a wet floor.
 
==See also==
* [[Illumination model]]
* [[Lambertian reflectance]]
Line 58 ⟶ 69:
* [[Rendering (computer graphics)]]
* [[Specular reflection]] (optics)
* [[Wet floor effect]]
 
== References ==
Line 64 ⟶ 74:
 
{{DEFAULTSORT:Reflection (Computer Graphics)}}
{{Computer graphics}}
[[Category:Computer graphics]]
[[Category:3D computer graphics]]
[[Category:Computer graphic techniques]]