hugoam / two

c++ toolkit for rapid development of live graphical apps and games
zlib License
1.67k stars 90 forks source link

Example 03_materials crashes #11

Open hoelzl opened 5 years ago

hoelzl commented 5 years ago

Example 03_materials throws an unhandled exception from nvoglv64.dll when I try to run it. (Built from the latest master (00fc8afc) using VS2017 on Windows 10 Pro 64 bit with GeForce GTX 1080 graphics card, driver version 417.35, 4k monitor.)

Unfortunately the exception details are not particularly helpful (at least to me):

Unhandled exception at 0x00000000678D0AD9 (nvoglv64.dll) in 03_materials_d.exe: Fatal program exit requested. occurred

Neither is the backtrace of the thread that raises the exception:

image

I tried to find debugging symbols, but it seems that nVidia does not provide .pdb files for their drivers.

Backtrace of the main thread:

image

The last two lines of the console log before entering the debugger are:

INFO: loading program filter/prefilter_envmap_v0 with options
INFO: loaded program c:/Users/tc/Programming/Games/Toy/mud/data//shaders/compiled/filter/prefilter_envmap_v0 id 19

I've also attached the full console log in case there is anything helpful in there: 03_materials_console_output.txt

The debug output is as follows: 03_materials_debug_output.txt

hugoam commented 5 years ago

Hi ! This one looks like it might be a GL driver issue. There is a leftover debug line which forces OpenGL mode whereas on windows you would probably want D3D: you can comment this line to try in D3D mode: https://github.com/hugoam/mud/blob/master/src/bgfx/BgfxSystem.cpp#L68

hoelzl commented 5 years ago

Thanks for the quick reply. Switching to D3D does indeed solve the issue.

hugoam commented 5 years ago

Does the crash still happen with last commit, and is it deterministic e.g crashes every time ?

hoelzl commented 5 years ago

The crash used to be deterministic, but with the latest commit (6ed1f1c01595ca312dbe758bc05a19ee64834c05) both OpenGL and D3d seem to work perfectly fine.

Actually, with this commit, example 14_live_gfx_visual is the only one that crashes on startup and 17_wfc crashes when I edit some values in the inspector pane. For some of the other examples the visuals seem to be not quite as intended, but the examples no longer crash or simply show black windows as they did in earlier commits, so your recent fixes have improved things considerably on my machine.

hugoam commented 5 years ago

Great, so this was probably also due to the outdated shaders. That leaves mostly the character skinning issue or is that one fixed also ? Yeah, I'm still working on fixing the remaining examples that are broken and the few remaining bugs, it's been a while since I went on a bug fixing spree.

hoelzl commented 5 years ago

Unfortunately character skinning does not yet work with OpenGL although it's no longer quite as random. I'll add more information to #12.