Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
0.8.4:pom-material [2022/06/15 20:41] – created admin0.8.4:pom-material [2022/06/17 10:46] (current) – [Properties] admin
Line 1: Line 1:
 ====== Parallax Occlusion Mapping Material (TGorillaPOMMaterialSource) ====== ====== Parallax Occlusion Mapping Material (TGorillaPOMMaterialSource) ======
  
-The parallax occlusion mapping material **TGorillaPOMMaterialSource** is inherited from the TGorillaDefaultMaterialSource and supports multiple lights, fog, shadows and much more features.+The parallax occlusion mapping material (short: POM) **TGorillaPOMMaterialSource** is inherited from the TGorillaDefaultMaterialSource and supports multiple lights, fog, shadows and much more features.
  
 ===== Definition ===== ===== Definition =====
  
 Parallax occlusion mapping (POM) is an enhancement of the parallax mapping technique. Parallax occlusion mapping is used to procedurally create 3D definition in textured surfaces, using a displacement map (similar to a topography map) instead of through the generation of new geometry.[1] This allows developers of 3D rendering applications to add 3D complexity in textures, which correctly change relative to perspective and with self occlusion in real time (self-shadowing is additionally possible), without sacrificing the processor cycles required to create the same effect with geometry calculations.[2] Parallax occlusion mapping (POM) is an enhancement of the parallax mapping technique. Parallax occlusion mapping is used to procedurally create 3D definition in textured surfaces, using a displacement map (similar to a topography map) instead of through the generation of new geometry.[1] This allows developers of 3D rendering applications to add 3D complexity in textures, which correctly change relative to perspective and with self occlusion in real time (self-shadowing is additionally possible), without sacrificing the processor cycles required to create the same effect with geometry calculations.[2]
- 
-Parallax occlusion mapping was first published in 2005 by Zoe Brawley and Natalya Tatarchuk in ShaderX3.[1] Natalya Tatarchuk conducted presentations of the technology at SIGGRAPH in 2005.[3] It was used in ATI's 'Toy Shop Demo' to showcase the Radeon X1800's Ultra-Threaded SM 3.0 technology.[4] It is used in video games and rendering engines such as Unigine,[5] CryEngine 2,[6] and CryEngine 3 and Unreal Engine 4.[7] It has also been used to create stereoscopic images from single images.[8] 
  
 [[https://en.wikipedia.org/wiki/Parallax_occlusion_mapping]] [[https://en.wikipedia.org/wiki/Parallax_occlusion_mapping]]
Line 17: Line 15:
 Here a rendering with normal mapping: Here a rendering with normal mapping:
  
-{{:0.8.4:normalmapping.jpg?400|}}+{{:0.8.4:normalmapping.jpg?800|}}
  
 And the same texture, normal map + height map rendered with parallax occlusion mapping: And the same texture, normal map + height map rendered with parallax occlusion mapping:
  
-{{:0.8.4:pom.jpg?400|}}+{{:0.8.4:pom.jpg?800|}} 
 + 
 +Because parallax occlusion mapping using a more complex way to build the surface by raytracing it is more intense to the GPU, 
 +which means, it costs performance in comparison to normal mapping. 
 + 
 +We recommend to use POM materials only if camera is getting close to objects and where depth of a surface is important. 
 + 
 +In all other cases normal mapping might be good enough. 
 + 
 + 
 +===== Properties ===== 
 + 
 +^Property ^Description^ 
 +|NormalMap|[[normalmap-material#normal_maps|Normal maps]] are a special kind of texture that allow you to add surface detail such as bumps, grooves, and scratches to a model which catch the light as if they are represented by real geometry.| 
 +|NormalIntensity|The normal intensity defines the intended depth effect. The larger the value, the more depth the algorithm is trying to produce.| 
 +|ParallaxOcclusionMap|A parallax occlusion map is simply just a height or displacement map, defining the length of the depth vector.| 
 +|ParallaxLevels|The number of parallax levels defining the raytracing steps to produce the depth effect. The larger this value gets, the more it reduces performance. Values around 16 are quite good in most cases.| 
 +|ParallaxDiscardEdges|Due to depth effects it might come to overlapping effects at edges. You can discard those edge fragments to see the depth effect also "around" an edge.| 
 + 
 +===== Example ===== 
 + 
 +<file pascal> 
 +uses 
 +  Gorilla.Material.POM; 
 +   
 +[...] 
 +   
 +var FPOMMaterial : TGorillaPOMMaterialSource; 
 + 
 +FPOMMaterial:= TGorillaPOMMaterialSource.Create(GorillaViewport1); 
 +FPOMMaterial.Parent := GorillaViewport1; 
 + 
 +/// load the regular diffuse color texture 
 +FPOMMaterial.Texture.LoadFromFile('pom_wood.png'); 
 + 
 +/// load a normal map to retrieve the direction of the fragment 
 +FPOMMaterial.NormalMap.LoadFromFile('pom_normal.png'); 
 + 
 +/// finally load the occlusion map, which is just a black-white texture for the depth. 
 +/// you can use displacement maps or height maps also. 
 +FPOMMaterial.ParallaxOcclusionMap.LoadFromFile('pom_disp.png'); 
 + 
 +/// increase the depth effect 
 +FPOMMaterial.NormalIntensity := 0.15; 
 + 
 +/// increase the raytracing steps for more detail, but with higher values it reduces performance. 
 +FPOMMaterial.ParallaxLevels := 24; 
 + 
 +/// in our example we do not want to discard edges 
 +FPOMMaterial.ParallaxDiscardEdges := false; 
 +</file>