Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.4:pom-material [2022/06/17 08:04] – [Parallax Occlusion Mapping Material (TGorillaPOMMaterialSource)] admin | 0.8.4:pom-material [2022/06/17 10:46] (current) – [Properties] admin | ||
---|---|---|---|
Line 22: | Line 22: | ||
Because parallax occlusion mapping using a more complex way to build the surface by raytracing it is more intense to the GPU, | Because parallax occlusion mapping using a more complex way to build the surface by raytracing it is more intense to the GPU, | ||
- | which means costs performance in comparison to normal mapping. | + | 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 surfaces | + | We recommend to use POM materials only if camera is getting close to objects and where depth of a surface |
In all other cases normal mapping might be good enough. | In all other cases normal mapping might be good enough. | ||
+ | |||
+ | |||
+ | ===== Properties ===== | ||
+ | |||
+ | ^Property ^Description^ | ||
+ | |NormalMap|[[normalmap-material# | ||
+ | |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 " | ||
===== Example ===== | ===== Example ===== | ||
Line 43: | Line 53: | ||
/// load the regular diffuse color texture | /// load the regular diffuse color texture | ||
FPOMMaterial.Texture.LoadFromFile(' | FPOMMaterial.Texture.LoadFromFile(' | ||
- | /// load a normal map | + | |
+ | /// load a normal map to retrieve the direction of the fragment | ||
FPOMMaterial.NormalMap.LoadFromFile(' | FPOMMaterial.NormalMap.LoadFromFile(' | ||
+ | |||
/// finally load the occlusion map, which is just a black-white texture for the depth. | /// finally load the occlusion map, which is just a black-white texture for the depth. | ||
/// you can use displacement maps or height maps also. | /// you can use displacement maps or height maps also. | ||
FPOMMaterial.ParallaxOcclusionMap.LoadFromFile(' | FPOMMaterial.ParallaxOcclusionMap.LoadFromFile(' | ||
+ | |||
+ | /// 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; | ||
</ | </ |