11/8/2022 0 Comments Get normal vector 2d![]() ![]() This technique to use per-fragment normals compared to per-surface normals is called normal mapping or bump mapping. What if we, instead of a per-surface normal that is the same for each fragment, use a per-fragment normal that is different for each fragment? This way we can slightly deviate the normal vector based on a surface's little details this gives the illusion the surface is a lot more complex:īy using per-fragment normals we can trick the lighting into believing a surface consists of tiny little planes (perpendicular to the normal vectors) giving the surface an enormous boost in detail. The brick surface only has a single normal vector, and as a result the surface is uniformly lit based on this normal vector's direction. From the lighting technique's point of view, the only way it determines the shape of an object is by its perpendicular normal vector. If we think about this from a light's perspective: how comes the surface is lit as a completely flat surface? The answer is the surface's normal vector. ![]() What we need is some way to inform the lighting system about all the little depth-like details of the surface. We can partly fix the flat look by using a specular map to pretend some surfaces are less lit due to depth or other details, but that's more of a hack than a real solution. The lighting doesn't take any of the small cracks and holes into account and completely ignores the deep stripes between the bricks the surface looks perfectly flat. Below we can see a brick texture applied to a flat surface lit by a point light. If we were to view such a brick surface in a lit scene the immersion gets easily broken. A brick surface is quite a rough surface and obviously not completely flat: it contains sunken cement stripes and a lot of detailed little holes and cracks. ![]() Most real-life surface aren't flat however and exhibit a lot of (bumpy) details.įor instance, take a brick surface. Textures help, but when you take a good close look at the meshes it is still quite easy to see the underlying flat surfaces. We boosted the realism by wrapping 2D textures on these flat triangles, hiding the fact that the polygons are just tiny flat triangles. Normal Mapping Advanced-Lighting/Normal-MappingĪll of our scenes are filled with meshes, each consisting of hundreds or maybe thousands of triangles. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |