TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #197 · 4 јан.

Подразумеваемые неймспейсы или неявные пакеты. Этот функционал добавлен в Python 3.3 Что он означает? Ранее, до 3.3 пакетами считались лишь директории, в которых есть файл __init__.py. Этот файл одновременно являлся свидетельством того, что директория это Python-пакет, и служил "телом" этого пакета. То есть местом, где можно написать код, как это делается внутри модуля. Этот код исполняется в момент импорта пакета, так что его принято называть "код инициализации пакета". Начиная с версии 3.3 Любая директория считается пакетом и Python будет пытаться использовать любую директорию для импорта. Конечно, не любую в файловой системе, а только те что находятся в sys.path. Это значит, что теперь __init__.py нужно делать только если: 🔸 вам требуется создать код инициализации пакета 🔸 нужна совместимость со старыми версиями Python На мой взгляд это немного упрощает разработку, делает её чище, но с другой стороны убивает некоторую однозначность происходящего. Например, я создал репозиторий со своей библиотекой и рядом положил код примеров или тестов. repo_name/ my_library/ __init__.py main.py examples/ exam1.py exam2.py В этом репозитории пакетом является только my_library, остальные директории это не пакеты, это просто дополнительный код в файлах. Директория examples не добавлена в sys.path, в ней нет рабочих модулей. Но если она лежит рядом с my_library, то Python вполне сможет импортнуть из неё модули, так как посчитает что examples это валидный пакет. Конечно, пример несколько надуманный. Никто не будет добавлять корень репозитория в sys.path. Но, я думаю, суть ясна. Иногда директория это просто директория а не пакет! #basic#pep

Hashtags

Резултати

Пронајдени 1 слични објави

Пребарај: #unrealengine5

当前筛选 #unrealengine5清除筛选
GameDev News

@gamedevnewz · Post #16 · 09.07.2024 г., 12:31

👾Why Games on Unreal Engine 5 Are Indistinguishable from Reality 🎮 Not long ago, Unreal Engine 5 was released to the public, allowing everyone to try out the new features of the engine, the main ones being the new global illumination technology, Lumen, and the Nanite rendering system, which we will discuss now. The demos and games made on Unreal Engine 5 look truly impressive; in some cases, the graphics are indistinguishable from real life. Let's take a closer look at these technologies. Lumen is a fully dynamic global illumination and reflection system designed for use in Unreal Engine 5 on next-generation gaming consoles. By default, it is the global illumination and reflection system in UE 5. Lumen allows for diffuse interreflection with infinite bounces and indirect specular reflections in large, detailed environments that can scale from millimeters to kilometers. Nanite is a micro-polygon rendering system. With it, the PC does not render each model based on the number of its polygons. Thanks to this, images are rendered with a resolution of one polygon per pixel, meaning the higher the resolution of your monitor, the higher the number of polygons (detail of the model). Although, at the moment, the combined use of these technologies causes certain problems, for example with vegetation and other thin objects (Lumen degrades the quality of foliage rendered using Nanite). Of course, lighting and rendering alone are not enough when it comes to ultra-realistic graphics. Textures and the detail of the mesh itself play a significant role as well. #GameDevelopment#UnrealEngine5