# Filament
This package contains several executables and libraries you can use to build applications using
Filament. Latest versions are available on the [project page](https://github.com/google/filament).
## Binaries
- `cmgen`, Image-based lighting asset generator
- `filamesh`, Mesh converter
- `glslminifier`, Tool to minify GLSL shaders
- `gltf_viewer`, glTF 2.0 viewer that lets you explore many features of Filament
- `matc`, Material compiler
- `material_sandbox`, simple mesh viewer that lets you explore material and lighting features
- `matinfo`, Displays information about materials compiled with `matc`
- `mipgen`, Generates a series of miplevels from a source image.
- `normal-blending`, Tool to blend normal maps
- `resgen`, Tool to convert files into binary resources to be embedded at compie time
- `roughness-prefilter`, Pre-filters a roughness map from a normal map to reduce aliasing
- `specular-color`, Computes the specular color of conductors based on spectral data
You can refer to the individual documentation files in `docs/` for more information.
## Libraries
Filament is distributed as a set of static libraries you must link against:
- `backend`, Required, implements all backends
- `bluegl`, Required to render with OpenGL or OpenGL ES
- `bluevk`, Required to render with Vulkan
- `filabridge`, Support library for Filament
- `filaflat`, Support library for Filament
- `filament`, Main Filament library
- `backend`, Filament render backend library
- `ibl`, Image-based lighting support library
- `utils`, Support library for Filament
- `geometry`, Geometry helper library for Filament
- `smol-v`, SPIR-V compression library, used only with Vulkan support
To use Filament from Java you must use the following two libraries instead:
- `filament-java.jar`, Contains Filament's Java classes
- `filament-jni`, Filament's JNI bindings
To link against debug builds of Filament, you must also link against:
- `matdbg`, Support library that adds an interactive web-based debugger to Filament
To use the Vulkan backend on macOS you must also make the following libraries available at runtime:
- `MoltenVK_icd.json`
- `libMoltenVK.dylib`
- `libvulkan.1.dylib`
## Linking against Filament
This walkthrough will get you successfully compiling and linking native code
against Filament with minimum dependencies.
To start, download Filament's [latest binary release](https://github.com/google/filament/releases)
and extract into a directory of your choosing. Binary releases are suffixed
with the platform name, for example, `filament-20181009-linux.tgz`.
Create a file, `main.cpp`, in the same directory with the following contents:
```
#include <filament/FilamentAPI.h>
#include <filament/Engine.h>
using namespace filament;
int main(int argc, char** argv)
{
Engine *engine = Engine::create();
engine->destroy(&engine);
return 0;
}
```
The directory should look like:
```
|-- README.md
|-- bin
|-- docs
|-- include
|-- lib
|-- main.cpp
```
We'll use a platform-specific Makefile to compile and link `main.cpp` with Filament's libraries.
Copy your platform's Makefile below into a `Makefile` inside the same directory.
### Linux
```
FILAMENT_LIBS=-lfilament -lbackend -lbluegl -lbluevk -lfilabridge -lfilaflat -lutils -lgeometry -lsmol-v -lvkshaders -libl
CC=clang++
main: main.o
$(CC) -Llib/x86_64/ main.o $(FILAMENT_LIBS) -lpthread -lc++ -ldl -o main
main.o: main.cpp
$(CC) -Iinclude/ -std=c++17 -pthread -c main.cpp
clean:
rm -f main main.o
.PHONY: clean
```
### macOS
```
FILAMENT_LIBS=-lfilament -lbackend -lbluegl -lbluevk -lfilabridge -lfilaflat -lutils -lgeometry -lsmol-v -lvkshaders -libl
FRAMEWORKS=-framework Cocoa -framework Metal -framework CoreVideo
CC=clang++
main: main.o
$(CC) -Llib/x86_64/ main.o $(FILAMENT_LIBS) $(FRAMEWORKS) -o main
main.o: main.cpp
$(CC) -Iinclude/ -std=c++17 -c main.cpp
clean:
rm -f main main.o
.PHONY: clean
```
### Windows
Note that the static libraries distributed for Windows include several
variants: mt, md, mtd, mdd. These correspond to the [run-time library
flags](https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-library?view=vs-2017)
`/MT`, `/MD`, `/MTd`, and `/MDd`, respectively. Here we use the mt variant. For the debug variants,
be sure to also include `matdbg.lib` in `FILAMENT_LIBS`.
When building Filament from source, the `USE_STATIC_CRT` CMake option can be
used to change the run-time library version.
```
FILAMENT_LIBS=filament.lib backend.lib bluegl.lib bluevk.lib filabridge.lib filaflat.lib \
utils.lib geometry.lib smol-v.lib ibl.lib vkshaders.lib
CC=cl.exe
main.exe: main.obj
$(CC) main.obj /link /libpath:"lib\\x86_64\\mt\\" $(FILAMENT_LIBS) \
gdi32.lib user32.lib opengl32.lib
main.obj: main.cpp
$(CC) /MT /Iinclude\\ /std:c++17 /c main.cpp
clean:
del main.exe main.obj
.PHONY: clean
```
### Compiling
You should be able to invoke `make` and run the executable successfully:
```
$ make
$ ./main
FEngine (64 bits) created at 0x106471000 (threading is enabled)
```
On Windows, you'll need to open up a Visual Studio Native Tools Command Prompt
and invoke `nmake` instead of `make`.
### Generating C++ documentation
To generate the documentation you must first install `doxygen` and `graphviz`, then run the
following commands:
```
$ cd filament/filament
$ doxygen docs/doxygen/filament.doxygen
```
Finally simply open `docs/html/index.html` in your web browser.
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
filament-v1.14.0-windows.tgz (261个子文件)
gltf_viewer.exe 25.97MB
material_sandbox.exe 25.75MB
matc.exe 5.53MB
matinfo.exe 3.76MB
cmgen.exe 1.56MB
mipgen.exe 1.42MB
filamesh.exe 1.03MB
roughness-prefilter.exe 706KB
normal-blending.exe 610KB
specular-color.exe 353KB
glslminifier.exe 332KB
resgen.exe 325KB
robin_hash.h 43KB
LightManager.h 38KB
DriverEnums.h 37KB
MaterialBuilder.h 28KB
View.h 28KB
Allocator.h 28KB
robin_map.h 25KB
TMatHelpers.h 25KB
StructureOfArrays.h 24KB
Panic.h 23KB
RenderableManager.h 23KB
Texture.h 23KB
Engine.h 22KB
Renderer.h 22KB
robin_set.h 20KB
mat4.h 20KB
Camera.h 20KB
ColorGrading.h 20KB
TVecHelpers.h 19KB
KtxUtility.h 18KB
Options.h 17KB
mat3.h 14KB
FixedCapacityVector.h 14KB
ColorTransform.h 14KB
IndirectLight.h 14KB
PixelBufferDescriptor.h 13KB
Stream.h 13KB
TransformManager.h 13KB
CString.h 12KB
Slice.h 11KB
SingleInstanceComponentManager.h 11KB
Manipulator.h 11KB
KtxBundle.h 11KB
Material.h 10KB
robin_growth_policy.h 10KB
mat2.h 10KB
TQuatHelpers.h 10KB
IBLPrefilterContext.h 10KB
AutomationEngine.h 10KB
FilamentAsset.h 10KB
bitset.h 10KB
algorithm.h 10KB
AssetLoader.h 9KB
MaterialInstance.h 9KB
SwapChain.h 9KB
Path.h 9KB
ToneMapper.h 9KB
half.h 9KB
MaterialEnums.h 8KB
VertexBuffer.h 8KB
SimpleViewer.h 8KB
BufferDescriptor.h 8KB
Settings.h 7KB
TextureSampler.h 7KB
Color.h 7KB
MaterialProvider.h 7KB
Cubemap.h 7KB
RenderTarget.h 6KB
compiler.h 6KB
ImageSampler.h 6KB
Box.h 6KB
ResourceLoader.h 6KB
Skybox.h 6KB
quat.h 5KB
fast.h 5KB
Scene.h 5KB
scalar.h 5KB
SurfaceOrientation.h 5KB
Frustum.h 5KB
NameComponentManager.h 4KB
SkinningBuffer.h 4KB
IndexBuffer.h 4KB
ostream.h 4KB
vec4.h 4KB
MeshReader.h 4KB
CubemapSH.h 4KB
ImageOps.h 4KB
EntityManager.h 4KB
DebugRegistry.h 4KB
BufferObject.h 4KB
Exposure.h 4KB
PresentCallable.h 4KB
vec3.h 4KB
CubemapUtils.h 4KB
LinearImage.h 4KB
Transcoder.h 4KB
Handle.h 4KB
compiler.h 4KB
共 261 条
- 1
- 2
- 3
ljp345775
- 粉丝: 54
- 资源: 43
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0