«Считаем картинку» или программная эмуляция шейдеров на службе офиса
Наверняка, у многих еще остались машины с устаревшими видеокартами, но более-менее мощными процессорами. Сейчас такие популярно называть «машинка для офиса» — на них ставят довольно неслабые двухядерные пентиумы, а видеокарта уходит на последний план, что верно. Если вы являетесь обладателем такого аппарата и хотите увидеть красивости DX9 на своей встроенной видеокарте, или вы — фанатичный до игры, вышедшей пару лет назад, но неимущий студент, обладатель, P4 3000MHZ и несчастной GFMX440. А может быть и вовсе, вы написали крутой DX9 рендерер для своей homebrew стрелялки, но «на погонять» у вас под рукой только дешевый ноутбук 2003 года. Если да, то читаем дальше.
Теперь можно заставить любой (почти) процессор обсчитывать DX8, DX9 сцены с шейдерами, без участия мощностей видеокарты.
Встречайте — Swift Shader 2 от Transgaming inc.
Что умеет обсчитывать эта штука?
Поддерживает все фичи Direct3D, доступные в спецификации Shader Model 2.0.
Почему почти любой процессор?
Потому что надо MMX и SSE
Как быстро это работает?
Я играл в Generals: Zero Hour на аппарате 1300мгц\GF4MX440
Работает ли это в Linux?
На сайте написано, что работает, сейчас нет возможности проверить.
Где взять?
Легально? Вот тут — скачать Спокойно вводите e-mail и ссылка на пятимегабайтовое демо упадет вам в ящик. Или вот, прямая ссылка — www.transgaming.com/products/swiftshader/download/swiftshader_v201_demo.zip
Нелегально? Ищите на зарубежных торрентах)
Стоп. Демо!? Как это демо?
А вот так. Как я вижу — демо отличается только watermark’ом в левом нижнем углу экрана.
Как это пользовать?
В архиве лежат d3d8.dll и d3d9.dll, кидаем их в папку с нужной программой, и запускаем ее 🙂
Если кого заинтересует, пожалуйста, поделитесь результатами тестов скорости.
Программный эмулятор Direct3D, более производительная замена Reference rasterizer из Microsoft DirectX SDK за счет использования SSE расширений и многопоточности. Поддерживает возможности DirectX 9, в том числе пиксельные и вершинные шейдеры v3.0, а также бамп мэппинг. По русски.
Установка: скопировать файлы из архива в папку игры. Настройка: через редактирование SwiftShader.ini или через http://localhost:8080/swiftconfig при запущенном приложении
Системные требования: * x86 CPU, SSE support recommended * Basic video card (даже 2д затычка на подобии s3Trio) * Microsoft Windows 98SE, Windows 2000, Windows XP, or Windows Vista (7 вроде работает) * 128 MB RAM
Искал враппер DX>Glide, а наткнулся на это.
Исполняет инструкции DX8/DX9 ресурсами ЦП. По сути эта дичь может в 3д даже если видеокарта уровня 2д встроенки или затычки.
Как вам уже известно он потребляет не мало ресурсов из-за эмуляции и я попытаюсь это исправить, у самого у меня видеоадаптер ёмкостью 128 мб и поддержкой шрейдеров версии 2.0 понятно же, что на такой видеоадаптере не запустишь From Dust(Симулятор бога)И по этому я как-то нашёл эту программу, когда игру запустил радости не было предела)Но она так лагала, что я просто не выдерживал и выключал её к чёрту.(Хотя и игра и требует 128 мб видеопамяти)Поэтому мне пришлось искать решение и я его нашёл надо было просто конфиги программы поправить)Ведь этот «костыль»(Да именно костыль хоть он и эмулирует шрейдера, но его нельзя назвать программой)может эмулировать количество видеопамяти(Там стандартно стоит 512 мб)И именно из-за этого игры лагают и нагружается процессор.
Кстати свифт на нашем сайте не простой,мы выкапали свифт ини версии 2.1 и сделали из него поддержку Свифта 3.0.
Итак исправление ситуации)
1)Заходите в папку с игрой куда вы закинули те два файлика.
2)Там найдите файл SwiftShader.ini и откройте его.
Кстати TextureMemory это можно сказать сколько эмулируестя видеопамяти поэтому можите изменить на 256
4) Изменяем строчки:
Кстати в самой игре в настройках надо поставить МИНИМАЛЬНЫЕ настройки графики, некрасиво, но за то играть можно)
Ну вроде бы и всё игра должна идти лучше чем при обычных настройках)
NOTE: SwiftShader’s OpenGL ES implementation is no longer supported, and will be removed. Read more about our recommendation to use ANGLE on top of SwiftShader Vulkan here (aka. «SwANGLE»).
SwiftShader libraries can be built for Windows, Linux, and macOS. Android and Chrome (OS) build environments are also supported.
CMake Install CMake for Linux, macOS, or Windows and use either the GUI or run the following terminal commands:
Tip: Set the CMAKE_BUILD_PARALLEL_LEVEL environment variable to control the level of parallelism.
Visual Studio To build the Vulkan ICD library, use Visual Studio 2019 to open the project folder and wait for it to run CMake. Open the CMake Targets View in the Solution Explorer and select the vk_swiftshader project to build it.
The SwiftShader libraries act as drop-in replacements for graphics drivers.
See CONTRIBUTING.txt for important contributing requirements.
The canonical repository for SwiftShader is hosted at: https://swiftshader.googlesource.com/SwiftShader.
All changes must be reviewed and approved in the Gerrit review tool at: https://swiftshader-review.googlesource.com.
Authenticate your account here: https://swiftshader-review.googlesource.com/new-password (use the same e-mail address as the one configured as the Git commit author).
On Windows, this command line requires using the Git Bash Shell.
Changes are uploaded to Gerrit by executing:
When ready, add a project owner as a reviewer on your change.
Some tests will automatically be run against the change. Notably, presubmit.sh verifies the change has been formatted using clang-format 11.0.1. Most IDEs come with clang-format support, but may require upgrading/downgrading to the clang-format version 11.0.0 release version (notably Chromium’s buildtools has a clang-format binary which can be an in-between revision which produces different formatting results).
SwiftShader’s Vulkan implementation can be tested using the dEQP test suite.
The third_party directory contains projects which originated outside of SwiftShader:
subzero contains a fork of the Subzero project. It originates from Google Chrome’s (Portable) Native Client project. The fork was made using git-subtree to include all of Subzero’s history.
llvm-subzero contains a minimized set of LLVM dependencies of the Subzero project.
PowerVR_SDK contains a subset of the PowerVR Graphics Native SDK for running several sample applications.
The SwiftShader project is licensed under the Apache License Version 2.0. You can find a copy of it in LICENSE.txt.
Files in the third_party folder are subject to their respective license.
Authors and Contributors
The legal authors for copyright purposes are listed in AUTHORS.txt.
CONTRIBUTORS.txt contains a list of names of individuals who have contributed to SwiftShader. If you’re not on the list, but you’ve signed the Google CLA and have contributed more than a formatting change, feel free to request to be added.
About
SwiftShader is a high-performance CPU-based implementation of the Vulkan graphics API. Its goal is to provide hardware independence for advanced 3D graphics.
NOTE: SwiftShader’s OpenGL ES frontend is no longer supported, and will eventually be removed. Read more about our recommendation to use ANGLE on top of SwiftShader Vulkan here.
SwiftShader libraries can be built for Windows, Linux, and macOS. Android and Chrome (OS) build environments are also supported.
CMake Install CMake for Linux, macOS, or Windows and use either the GUI or run the following terminal commands:
Tip: Set the CMAKE_BUILD_PARALLEL_LEVEL environment variable to control the level of parallelism.
Visual Studio To build the Vulkan ICD library, use Visual Studio 2019 to open the project folder and wait for it to run CMake. Open the CMake Targets View in the Solution Explorer and select the vk_swiftshader project to build it.
The SwiftShader libraries act as drop-in replacements for graphics drivers.
See CONTRIBUTING.txt for important contributing requirements.
The canonical repository for SwiftShader is hosted at: https://swiftshader.googlesource.com/SwiftShader
All changes must be reviewed and approved in the Gerrit review tool at: https://swiftshader-review.googlesource.com
All changes require a Change-ID tag in the commit message. A commit hook may be used to add this tag automatically, and can be found at: https://gerrit-review.googlesource.com/tools/hooks/commit-msg. To clone the repository and install the commit hook in one go:
Changes are uploaded to Gerrit by executing:
When ready, add a project owner as a reviewer on your change.
Some tests will automatically be run against the change. Notably, presubmit.sh verifies the change has been formatted using clang-format 11.0.1. Most IDEs come with clang-format support, but may require upgrading/downgrading to the clang-format version 11.0.0 release version (notably Chromium’s buildtools has a clang-format binary which can be an in-between revision which produces different formatting results).
SwiftShader’s OpenGL ES implementation can be tested using the dEQP test suite.
The third_party directory contains projects which originated outside of SwiftShader:
subzero contains a fork of the Subzero project. It originates from Google Chrome’s (Portable) Native Client project. The fork was made using git-subtree to include all of Subzero’s history.
llvm-subzero contains a minimized set of LLVM dependencies of the Subzero project.
PowerVR_SDK contains a subset of the PowerVR Graphics Native SDK for running several sample applications.
The SwiftShader project is licensed under the Apache License Version 2.0. You can find a copy of it in LICENSE.txt.
Files in the third_party folder are subject to their respective license.
Authors and Contributors
The legal authors for copyright purposes are listed in AUTHORS.txt.
CONTRIBUTORS.txt contains a list of names of individuals who have contributed to SwiftShader. If you’re not on the list, but you’ve signed the Google CLA and have contributed more than a formatting change, feel free to request to be added.
About
SwiftShader CPU-based implementation of the OpenGL ES and Direct3D 9 graphics APIs