تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
بدءًا من الإصدار alpha04 من مكتبات Jetpack XR، تم إجراء
تعديلات مهمة على كيفية تقديم ملفات أصول البيئة المكانية للحصول على
أفضل أداء وجودة مرئية. تؤثر هذه التغييرات في التوافق
وتتطلّب تحديث التطبيقات الحالية التي تحدّد البيئات المكانية.
لتوفير بيئات مكانية، تحتاج إلى مكوّنين رئيسيين:
ملف glb. أو gltf. لهندسة البيئة (على سبيل المثال، سطح الارض
والأجسام المجاورة) وملمس السماء الأساسي الذي يراه المستخدمون
ملف ZIP منفصل يحتوي على معلومات الإضاءة المستندة إلى الصور (IBL)
تم إنشاؤه من صورة EXR ذات نطاق ديناميكي عالٍ باستخدام أداة cmgen يُستخدَم ملف ZIP
لاحتساب الإضاءة، مثل الانعكاسات على الأجسام، وليس
لنسيج صندوق السماء المرئي نفسه.
لماذا هذا النهج؟
توفّر بنية مواد العرض المعدّلة هذه المزايا التالية:
أحجام الملفات أصغر: مقارنةً بالطرق السابقة، مثل استخدام ملف سكاي بوكس (HDR) واحد عالي الدقة لعرض المعلومات المرئية ومعلومات الإضاءة، تعمل هذه الطريقة على تقليل حجم الملفات.
تحسين الأداء: يتيح لك فصل نسيج صندوق السماء المرئي (المضمّن في glb) عن بيانات IBL (في ملف ZIP) تحسين كل عنصر بشكل مستقل. ويؤدي ذلك إلى انخفاض معدل نقل البيانات لقراءة ذاكرة الزخرفة
وانخفاض استهلاك الطاقة.
الإضاءة المحسَّنة: من المفيد للأداء استخدام مورد صندوق سماء بدرجة دقة أقل
خصيصًا لخريطة الإضاءة بدون
التأثير بشكل كبير في النتائج المرئية للإضاءة على الأجسام.
لمزيد من المعلومات عن إضافة بيئة مكانية في تطبيقك، اطّلِع على دليلنا حول
إضافة بيئات إلى تطبيقك.
تحسين glb
يمثل glb الشكل الهندسي حول المستخدم، ويمكنك تضمين
الهيئة المرئية لصندوق السماء. بالنسبة إلى الأشكال الهندسية، يجب محاولة الحفاظ على أحجام الملفات عند 80 ميغابايت أو أقل.
ولإجراء ذلك، هناك عدد من الفرص لجعل بيئتك أكثر فعالية مع الحفاظ على الجودة العالية. على سبيل المثال، يجب أن تكون كثافة الشبكة
الأكثر كثافة بالقرب من المستخدم، ويمكنك تقليل الكثافة
للشبكات البعيدة عن المستخدم.
مسافة العرض: تبلغ مسافة العرض للبيئات في Android XR 200 متر
من نقطة المستخدم، ويجب أن يلتزم نسيج صندوق السماء بهذه المقياس. ويمنح ذلك تجربة مثالية لأنّ التأثير البصري للبعد النسبي يصبح
غير محدّد على هذه المسافة.
طول المستخدم: يمكن أن تختلف المواقع الجغرافية، ولكن ضَع المستخدم على تلة بارتفاع
حوالي 1.5 متر لتجنُّب اقتصاص عناصر واجهة المستخدم الأكبر حجمًا في
التطبيقات.
عدد المضلّعات: يجب الانتباه إلى عدد المضلّعات في ملفات glb، لأنّ ارتفاع عددها قد يؤدي إلى استهلاك طاقة غير ضروري. يجب ألا يتجاوز عدد رؤوس كلّ قسم من الأسطح الهندسية
10,000 رأس.
ضغط KTX: يمكنك تحسين أداء وحدة معالجة الرسومات لملف glb من خلال
التأكّد من أنّ ملف glb يستخدم خرائط mip وصور ktx2.
ابحث عن ملف .tgz الذي يحتوي على الإصدار المُنشئ مسبقًا من cmgen لنظامك الأساسي
واسحبه.
تتوفّر الأداة المُسبقة الإنشاء ضمن الدليل /bin من ملف .tgz الذي تم استخراجه.
مواد العرض التي يجب إعدادها لإنشاء ملف zip .لميزة "الإعلانات الصورية على شبكة البحث":
ملف EXR بدقة منخفضة يتطابق مع نسيج صندوق السماء
يجب أن يكون ملف إدخال نسيج صندوق السماء ملف EXR. على الرغم من أنّ أداة cmgen متوافقة مع
تنسيقات أخرى، ننصح باستخدام ملفات EXR لأنّها توفّر معلومات متعلقة بالملف الشخصي
الديناميكي العالي، وهي معلومات ضرورية لتقديم الإضاءة الداخلية الحقيقية (IBL) العالية الجودة.
يؤدي استخدام تنسيقات أخرى، مثل PNG، إلى إضاءة أقل دقة.
يجب أن تكون نسبة العرض إلى الارتفاع للصورة المصدر (EXR) 2:1 وأن تكون أبعادها
مضاعفة. استخدِم ملف EXR بدقة 1024 × 512 بكسل. ملاحظة: قد يبدو أنّ دقة 1024 x 512 منخفضة جدًا، ولكنّ ذلك مفيد لتحسين الأداء. بالنسبة إلى الإضاءة السينمائية، تكون النتائج المرئية التي تظهر للمستخدم مشابهة جدًا
لمواد العرض ذات الدقة العالية جدًا للإضاءة السينمائية.
ملف png باللون الأسود الخالص
يجب أن تكون نسبة عرض إلى ارتفاع مادة العرض هذه أيضًا 2:1. استخدِم حجمًا أبعاده 100 x 50 بكسل.
ويكون هذا المظهر بمثابة نسيج محسّن لمواكبة الإضاءة الداخلية. لن ينظر المستخدِمون إلى ذلك، لذلك نركّز على تحسين أداء مادة العرض.
يعرض ما يلي مثالاً على استخدام cmgen لإنشاء ملف zip .لـ IBL.
في هذا المثال، نستخدم ملفَي الإدخال my_360_skybox_1024_x_512.exr و
black_skybox.png، وننشئ ملفًا بتنسيق .zip باسم my_ibl.zip.
# Produce black cubemaps for the texture of the IBL asset.
./cmgen--format=rgb32f--size=128--extract=./skybox_ibl./black_skybox.png
# Produce lighting cubemaps and a Spherical Harmonics from EXR
./cmgen--format=rgb32f--size=128--deploy=./skybox_ibl--ibl-ld=.--ibl-samples=1024--extract-blur=0.0--sh-irradiance--sh-shader--sh-output=./skybox_ibl/sh.txt./my_360_skybox_1024_x_512.exr
# Copy all of the black cubemaps into the other folder.
cp-rf./skybox_ibl/black_skybox/*./skybox_ibl/my_360_skybox_1024_x_512
# Rename the directory to reflect that these are old assets.
mv./skybox_ibl/black_skybox./skybox_ibl/black_skybox_old
# Rename the directory to reflect that these are your cubemap assets.
mv./skybox_ibl/my_360_skybox_1024_x_512./skybox_ibl/black_skybox
# Change into the child directory.cd./skybox_ibl
# Zip all of the cubemap and the Spherical Harmonics assets together.
zip-qmy_ibl.zipblack_skybox/*
# Return to the directory you started in.cd..
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Optimize environment assets\n\nBeginning with the alpha04 release of the Jetpack XR libraries, there are\nimportant updates to how you should provide spatial environment assets for\noptimal performance and visual quality. These changes are a compatibility impact\nand require updating existing apps that set spatial environments.\n\nTo provide spatial environments, you need two main components:\n\n- A .glb or .gltf file for the environment's geometry (for example, the ground plane, nearby objects) and the primary visual skybox texture that users see.\n- A separate ZIP file containing Image Based Lighting (IBL) information generated from a high dynamic range EXR image using the cmgen tool. The ZIP file is used for lighting calculations, such as reflections on objects, and not for the visual skybox texture itself.\n\nWhy this approach?\n------------------\n\nThis updated asset structure provides these advantages:\n\n- **Smaller file sizes:** Compared to previous methods, such as using a single high-resolution HDR skybox file for both visual display and lighting information, this approach reduces file sizes.\n- **Improved performance:** Separating the visual skybox texture (built into the glb) from the IBL data (in the ZIP file) lets you optimize each component independently. This results in lower texture memory read bandwidth and lower power consumption.\n- **Optimized lighting:** Using a lower resolution skybox resource specifically for the lighting map is beneficial for performance without significantly impacting the visual results of the lighting on objects.\n\nTo learn more about adding a spatial Environment in your app, see our guide on\n[adding environments to your app](/develop/xr/jetpack-xr-sdk/add-environment).\n| **Note:** It's important to provide an IBL asset if your app sets a custom environment, especially if your app has any 3D objects. This is because, if your app provides a glb/glTF but no IBL ZIP file, the 3D objects in the user's environment appear with incorrect lighting (for example, too bright or dim, reflecting objects that the user can't otherwise see).\n\nOptimize your glb\n-----------------\n\nYour glb represents the geometry around the user, and you include the visual\ntexture of your skybox. For your geometry, you should try to maintain file sizes\nat or smaller than 80MB.\n\nTo do this, there are a number of opportunities to make your environment more\nefficient while maintaining high quality. For example, the density of your mesh\nshould be the most dense near the user, and you can decrease the density for\nmeshes that are farther from the user.\n\n- **View distance:** The view distance for environments in Android XR is 200m from the point of the user, and your skybox texture should adhere to this constraint. This provides an optimal experience because parallax becomes indiscernible at that distance.\n- **User height:** Geography can vary, but position the user on a mound at\n around 1.5 meters of height to avoid clipping with larger UI elements in\n apps.\n\n- **Polycount:** Be sensitive to the polycount in your glb files, as a high\n polycount can lead to unnecessary power consumption. Each patch of geometry\n shouldn't exceed 10,000 vertices.\n\n- **KTX compression:** Optimize the GPU performance of your glb file by\n ensuring that your glb uses mipmaps and ktx2 textures.\n\nWhat you'll need to optimize your IBL\n-------------------------------------\n\nDownload the cmgen command line utility:\n\n- You can find the latest release in [the Filament repository](https://github.com/google/filament/releases/).\n- Find the .tgz containing the prebuilt version of cmgen for your platform and extract it.\n- The prebuilt tool is under the /bin directory of the extracted .tgz file.\n\nAssets to prepare to generate the .zip file for IBL:\n\n- A low-resolution EXR that matches your skybox texture\n - Your skybox texture input should be an EXR file. Although cmgen supports other formats, EXRs are recommended because they provide the high dynamic range information that's critical to provide high quality IBL. Using other formats like PNG results in less precise lighting.\n - The source image (EXR) needs to have a 2:1 ratio and dimensions that are a power of 2. Use an EXR that's 1024 x 512 pixels. Note: It may seem that 1024 x 512 is too low of a resolution, but this is beneficial for performance. For IBL, the visual results for the user are very similar to much higher IBL resolution assets.\n- A solid black png\n - This asset must also be a 2:1 ratio. Use a size of 100 x 50 pixels.\n - This serves as an optimized texture to accompany the IBL. Users won't look at this, so we focus the asset on optimizing for performance.\n\nThe following shows an example of using cmgen to create the .zip file for IBL.\nIn this example we use input files named my_360_skybox_1024_x_512.exr and\nblack_skybox.png, and we create a .zip file named my_ibl.zip \n\n # Produce black cubemaps for the texture of the IBL asset.\n ./cmgen --format=rgb32f --size=128 --extract=./skybox_ibl ./black_skybox.png\n\n # Produce lighting cubemaps and a Spherical Harmonics from EXR\n ./cmgen --format=rgb32f --size=128 --deploy=./skybox_ibl --ibl-ld=. --ibl-samples=1024 --extract-blur=0.0 --sh-irradiance --sh-shader --sh-output=./skybox_ibl/sh.txt ./my_360_skybox_1024_x_512.exr\n\n # Copy all of the black cubemaps into the other folder.\n cp -rf ./skybox_ibl/black_skybox/* ./skybox_ibl/my_360_skybox_1024_x_512\n\n # Rename the directory to reflect that these are old assets.\n mv ./skybox_ibl/black_skybox ./skybox_ibl/black_skybox_old\n\n # Rename the directory to reflect that these are your cubemap assets.\n mv ./skybox_ibl/my_360_skybox_1024_x_512 ./skybox_ibl/black_skybox\n\n # Change into the child directory.\n cd ./skybox_ibl\n\n # Zip all of the cubemap and the Spherical Harmonics assets together.\n zip -q my_ibl.zip black_skybox/*\n\n # Return to the directory you started in.\n cd .."]]