Content deleted Content added
No edit summary |
m →Approaches to reflection rendering: Add spaces between word and round bracket |
||
(30 intermediate revisions by 18 users not shown) | |||
Line 1:
{{short description|Simulation of reflective surfaces}}
{{
[[Image:Refl sample.jpg|frame|right|[[Ray tracing (graphics)|Ray-traced]] model demonstrating specular reflection
'''Reflection''' in [[computer graphics]] is used to
==Approaches to reflection rendering==
*'''Polished''' - A polished reflection is an undisturbed reflection, like a mirror or chrome.▼
[[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)]]
*'''Blurry''' - A blurry reflection means that tiny random bumps on the surface of the material cause the reflection to be blurry.▼
For rendering environment reflections there exist many techniques that differ in precision, computational and implementation complexity. Combination of these techniques are also possible.
*'''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.▼
[[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 specialized HW exists, such as [[Nvidia RTX]]) and require a different rendering approach from typically used [[rasterization]].
==Examples==▼
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|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 video|title=Off Camera Secrets, Metal Gear Solid: Twin Snakes - Boundary Break|url=https://www.youtube.com/watch?v=fas0zJ8C7GU|time=4:32|date=2016-11-28|access-date=25 April 2020}}</ref>
===Polished or Mirror reflection===▼
[[Image:Mirror2.jpg|frame|right|Mirror on wall rendered with 100% reflection.]]▼
Reflections on non-planar (curved) surfaces are more challenging for real time rendering. Main approaches that are used include:
Mirrors are usually almost 100% reflective...▼
*[[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 pre-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 rays come from pixel data.This requires the data of surface normal and either depth buffer (local space) or position buffer (world space).The disadvantage is that objects not captured in the rendered frame cannot appear in the reflections,which results in unresolved and or false intersections causing artefacts 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=Secrets of CryENGINE 3 Graphics Technology |url=http://www.klayge.org/material/4_1/SSR/S2011_SecretsCryENGINE3Tech_0.pdf |accessdate=27 November 2022}}</ref>
==Types of reflection==
;Polished
▲
;Blurry
▲
;Metallic
▲
;Glossy
▲
{{clear}}
===Metallic
[[Image:Metallic balls.jpg|thumb|400px|right|The large sphere on the left is blue with its reflection marked as metallic. The large sphere on the right is the same color but does not have the metallic property selected.]]
Normal (nonmetallic) objects reflect light and colors in the original color of the object being reflected.
Line 25 ⟶ 42:
{{clear}}
===Blurry
[[Image:Blurry reflection.jpg|thumb|400px|right|The large sphere on the left has sharpness set to 100%. The sphere on the right has sharpness set to 50% which creates a blurry reflection.]]
Many materials are imperfect reflectors, where the reflections are blurred to various
Line 32 ⟶ 49:
{{clear}}
===Glossy
[[Image:Glossy-spheres.jpg|thumb|400px|right|The sphere on the left has normal, metallic reflection. The sphere on the right has the same parameters, except that the reflection is marked as "glossy".]]
Fully glossy reflection, shows highlights from light sources, but does not show a clear reflection from objects.
{{clear}}
▲==Examples of reflections==
===Wet floor reflections===
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==
{{Portal|Computer graphics}}▼
* [[Illumination model]]
* [[Lambertian reflectance]]
* [[Ray tracing (graphics)|Ray tracing]]
* [[Reflection mapping]]
* [[Rendering (computer graphics)]]
* [[Specular reflection]] (optics)
▲* [[Wet floor effect]]
== References ==
{{reflist}}
{{DEFAULTSORT:Reflection (Computer Graphics)}}
[[Category:Computer graphics]]
[[Category:3D computer graphics]]
[[Category:Computer graphic techniques]]
|