google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.73k stars 1.88k forks source link

1.9.9 pre-built libs for Windows, how to initialize and load GLTF #3362

Closed pkovacs86 closed 3 years ago

pkovacs86 commented 3 years ago

Hello,

I would like to use 1.9.9 Windows pre-built libraries for loading GLTF file into a scene. SDL window creation: https://github.com/MTASZTAKI/ApertusVR/blob/0.9.1/plugins/render/sdlWindow/apeSdlWindowPlugin.cpp#L25 Filament init: https://github.com/MTASZTAKI/ApertusVR/blob/0.9.1/plugins/render/filamentRenderWindows/apeFilamentWindowsRenderPlugin.cpp#L419 Then the rendering loop can be found here: https://github.com/MTASZTAKI/ApertusVR/blob/0.9.1/plugins/render/filamentRenderWindows/apeFilamentWindowsRenderPlugin.cpp#L455 Any modification in the scene processed by that function: https://github.com/MTASZTAKI/ApertusVR/blob/0.9.1/plugins/render/filamentRenderWindows/apeFilamentWindowsRenderPlugin.cpp#L468 The GLTF file open, read, parse, and adding to the scene: https://github.com/MTASZTAKI/ApertusVR/blob/0.9.1/plugins/render/filamentRenderWindows/apeFilamentWindowsRenderPlugin.cpp#L155

Somehow only a black screen is showed but seems everything is parsed and loaded and the render loop is running image

May I miss something?

Thank you Peter

prideout commented 3 years ago

There are many things that could cause a black screen. :)

It sounds like verified that filament::Renderer::render(..) is indeed getting called? If Filament initialized successfully, you should see "FEngine (64 bits) created" in the console.

Since ApertusVR uses CMake anyway, it may be worthwhile for you to build Filament yourself as a subproject, this would let you dig deeper, try a debug build, enable GL errors, etc.

Note that we now have a discussion tab for general Q&A.

bejado commented 3 years ago

I don't see where you're setting the viewport. Try adding a call to mpFilamentView->setViewport({0, 0, width, height}).

Some additional details about your system would also be helpful (OS version, GPU model, etc).

pkovacs86 commented 3 years ago

Dear Ben,

Many thanks for your suggestion. Now it works. image

BR Peter