Comments (18)
For anyone like me who wanted to get filament working with Qt, I've created a simple hello world example based on @cgmb's repo which you can find here. I've only tested it on Linux, but in theory since both Qt and Filament are cross platform it should work on Windows too (with some tweaks to the Makefile).
from filament.
I recently integrated filament into my GLFW application. A "Getting Started" guide would definitely have saved me time. There were a few specific things I noticed:
-
The README is missing the creation of
vertexBuffer
andindexBuffer
. IMO, those are of similar importance to the other parts of setup that are included. -
The sample apps are very nice, but they depend on the ~2000 LOC in
samples/app/
. Evensamples/vk_hellotriangle.cpp
is hard to follow because some important initializations are done inside abstractions in the sample app. I like having those larger examples, but a Getting Started guide with a complete ~200 LOChellotriangle.cpp
with no dependencies and very little abstraction would be a wonderful addition. -
The ways transforms are done in the samples seems different from what's stated in the class documentation for
TransformManger
, which shows usingTransformManger::create
.TransformManger::getInstance
says it can return an invalid instance if the component doesn't exist, but none of the samples seem to callcreate
, so it's not clear why a valid component is returned. I like the way the samples do it, but I would not have assumed this would work based on the docs:
auto& tcm = engine->getTransformManager();
tcm.setTransform(tcm.getInstance(renderable),
math::mat4f::rotate(M_PI_4, math::float3{0, 0, 1}));
from filament.
We definitely need to write better samples and documentation. Right now a good starting point is android/samples/hello-triangle
(except it's in Kotlin not C++ :).
For #3, the reason it works is that we automatically create a transform component for renderables when we load meshes in the sample apps (MeshAssimp.cpp
and MeshIO.cpp
). Which emphasizes your point about creating simpler sample apps so it's easier to understand what's going on.
from filament.
Looking more closely you are right some samples use the transform manager without creating the component first. I'll check what's going on there.
from filament.
Nevermind I remember now. When creating a Renderable, a TransformManager component is automatically added if the entity doesn't have one alredy. We need to document this.
from filament.
As a side note, one cool thing about GitHub wikis is that they are cloneable, so we can use our favorite text editors to work on the wiki:
https://gist.github.com/subfuzion/0d3f19c4f780a7d75ba2
from filament.
@cgmb, at some point I decided that creating a Renderable would always create a Transform component -- because that's what we want 99% of the time. I didn't update the doc at the time. So, for Renderables, it should never be invalid.
from filament.
I recently integrated filament into my GLFW application. A "Getting Started" guide would definitely have saved me time. There were a few specific things I noticed:
- The README is missing the creation of
vertexBuffer
andindexBuffer
. IMO, those are of similar importance to the other parts of setup that are included.- The sample apps are very nice, but they depend on the ~2000 LOC in
samples/app/
. Evensamples/vk_hellotriangle.cpp
is hard to follow because some important initializations are done inside abstractions in the sample app. I like having those larger examples, but a Getting Started guide with a complete ~200 LOChellotriangle.cpp
with no dependencies and very little abstraction would be a wonderful addition.- The ways transforms are done in the samples seems different from what's stated in the class documentation for
TransformManger
, which shows usingTransformManger::create
.TransformManger::getInstance
says it can return an invalid instance if the component doesn't exist, but none of the samples seem to callcreate
, so it's not clear why a valid component is returned. I like the way the samples do it, but I would not have assumed this would work based on the docs:auto& tcm = engine->getTransformManager(); tcm.setTransform(tcm.getInstance(renderable), math::mat4f::rotate(M_PI_4, math::float3{0, 0, 1}));
Hi, @cgmb I'm trying to use filament with GLFW,
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
window = glfwCreateWindow(TargetWidth, TargetHeight, "Hello World", NULL, NULL);
winHandle = glfwGetWin32Window(window);
engine = Engine::create();
swapChain = engine->createSwapChain(winHandle);
......
......
while (!glfwWindowShouldClose(window))
{
update();
if (renderer->beginFrame(swapChain))
{
renderer->render(view);
renderer->endFrame();
}
}
'
But I'm getting the 'wglMakeCurrent( )' failed error
class utils::PostconditionPanic
in virtual void filament::PlatformWGL::makeCurrent(Platform::SwapChain *, Platform::SwapChain *):184
in file E:\FilamentSpace\filament-master\filament\src\driver\opengl\PlatformWGL.cpp
reason: wglMakeCurrent() failed. hdc = 00000000001D0B56
Please help me if you have any idea about cause for this error...
from filament.
Sorry @Raki, my target platform is Linux and I only ever hacked things together before I had to move on. But, I did get my hello triangle working with GLFW on Ubuntu. The code is very, very rough, and I have no idea if it will be of any use at all, but now it's there for anyone interested.
from filament.
Sorry @Raki, my target platform is Linux and I only ever hacked things together before I had to move on. But, I did get my hello triangle working with GLFW on Ubuntu. The code is very, very rough, and I have no idea if it will be of any use at all, but now it's there for anyone interested.
@cgmb Thank you for the response and the example. I will go through it. I am sure it will be of some help :-) to me.
from filament.
@Raki and others if you are still struggling with this, here is a solution:
You are passing Win32 HWND handle to createSwapChain(), instead you should pass the window's HDC handle.
from filament.
So it is unclear to me what I need to delete to clean up, and when I can do so.
When I delete an entity, do I need to delete all components manually as well, or are they automatically deleted? It seems to me that sometimes if i repeatedly create/delete entities, I hit a point where I crash in TransformManager where it is trying to setup an entity to be it's own parent. I am not however deleting transform components when I delete the entities. Should I? The documentation on TransformManager doesn't say.
from filament.
@pixelflinger can give you more info
from filament.
We also should add more API docs (libmath and let mostly)
from filament.
Thank you @nitronoid!
from filament.
@Raki and others if you are still struggling with this, here is a solution:
You are passing Win32 HWND handle to createSwapChain(), instead you should pass the window's HDC handle.
@kavaari Thank you for the suggestion. As per the filament-20190426-windows build, if we pass HDC handle, app is crashing. It is working fine with Win32 HWND. (Also need to introduce a delay of 17ms in glfw renderloop without the delay command buffer is being flooded)
from filament.
The issue is caused when creating your own context and using the createSwapChain(void* nativeWindow)
function. Instead use the createSwapChain(int width, int height, int flags)
version. See these comments and this repository that demonstrates a fix
from filament.
@cgmb Thanks for the example, after smashing my head on the wall for days I found the calls I was missing.
from filament.
Related Issues (20)
- build failed with setting `-DBUILD_SHARED_LIBS=ON` to CMake HOT 1
- Can we render 3d Model using camera by Google filament?
- Build Android release Failed HOT 3
- gltf instances sample app crashes on MacOS HOT 4
- iOS View::Pick() cannot obtain the node info of gltf HOT 1
- Under the ANGLE_D3D11 backend in Windows Chrome, the official demo displays random flickering noise.
- The tree model is not rendered correctly HOT 1
- Dynamic lights stop working on Android when updating to 1.49.x HOT 2
- Partial shadow disappears at VSM blur case HOT 5
- Minimizing the window causes a crash on the Debug configuration when using Vulkan.
- 【MAC】Building Filament for Desktop failed HOT 3
- incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1 HOT 1
- Some point light are not displayed when have many point light in the scene HOT 1
- After loading glb model on android, how to control model rotation through code, like gesture operation
- model jitter HOT 8
- Phone overheating HOT 1
- Translucent objects are not rendered consistently (was: Model rendering issue) HOT 2
- QML software, running filament, if it runs for a long time, such as night, the software will crash HOT 1
- How to use mat
- Setting emissiveFactor results in abnormal display HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from filament.