Warning: Undefined array key "translationlc" in /usr/www/users/fabook/_diggets/doc/v2/lib/plugins/translation/action.php on line 237

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/fabook/_diggets/doc/v2/lib/plugins/translation/action.php:237) in /usr/www/users/fabook/_diggets/doc/v2/inc/Action/Export.php on line 104

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/fabook/_diggets/doc/v2/lib/plugins/translation/action.php:237) in /usr/www/users/fabook/_diggets/doc/v2/inc/Action/Export.php on line 104

Warning: Cannot modify header information - headers already sent by (output started at /usr/www/users/fabook/_diggets/doc/v2/lib/plugins/translation/action.php:237) in /usr/www/users/fabook/_diggets/doc/v2/inc/Action/Export.php on line 104
====== Shared Material (TGorillaSharedMaterialSource) ====== The **TGorillaSharedMaterialSource** is inherited from TGorillaDefaultMaterialSource and representing a container or storage for textures. //Do not link them directly to a 3D component.// Instead use an extended instance of **TGorillaReferenceMaterialSource**, f.e. [[atlas-material|TGorillaAtlasMaterialSource]]. ===== Background ===== Having games like Minecraft in mind, texturing seems very simple when using a single atlas texture. Working with FMX materials makes this a struggle. Because each time you create a material source and use the atlas texture, FMX will load the texture into the GPU. So if you're having an atlas with 8x8 parts, this will create 64 texture with the size of the original one. This is just horrible memory management. That's not what we want. Gorilla3D offers a solution to you: SharedMaterialSource's! You set up a shared atlas material source once, where you load up your atlas texture. Than you only create referenced materials linked to that source. The reference material shader will use the global texture for rendering, instead of registering its own. ===== Usage ===== {{:0.8.4:shared.png?nolink&600|}} The image above shows how a texture atlas (//TGorillaSharedAtlasMaterialSource//) can be referenced in multiple //TGorillaAtlasMaterialSource// instances to display only a explicit frame of that atlas. __Notice:__ TGorillaSharedMaterialSource and TGorillaReferenceMaterialSource are intended to be used as template for extended material sources, like [[atlas-material|TGorillaSharedAtlasMaterialSource]]