Lighting doesn't work when I use ofCreateWindow(settings)

I’m using OF 0.9.3 on Windows 10 64 bit and have checked my GPU’s drivers and capabilities and it’s running OpenGL 4.3

A simple example of the problem is:
When I run the examples/gl/MultiLightExample it runs absolutely fine when I use

ofSetupOpenGL(1024,768, OF_WINDOW);			// <-------- setup the GL context
ofRunApp( new ofApp());

A screenshot of the app running:

However from what I read that is deprecated (or doesn’t use OpenGL 3) and the recommended way of launching the GL context is to now use:

ofGLWindowSettings settings;
settings.setGLVersion(3, 2);
settings.width = 1280;
settings.height = 780;
ofCreateWindow(settings);
ofRunApp( new ofApp());

If I launch the app that way though (with no other changes to the code) the lighting doesn’t work, this is what I get:

As I say there are no other changes to the code apart from the way I launch the main window from main.cpp and my system says it’s capable of running OpenGL 4.3

Does anyone know what the issue is? Should this work or am I missing something?

Thanks

this should be working. lighting in opengl 3+ is calculated using a shader and it might be failing in your machine. do you get any output in the console? if the shader was failing to compile for exmaple you should be seeing some error there

Thanks Arturo, the output in the console is:

'multiLightExample_debug.exe' (Win32): Loaded 'D:\09_software\OFx\Installs\of_v0.9.3_vs_release\of_v0.9.3_vs_release\examples\gl\multiLightExample\bin\multiLightExample_debug.exe'. Symbols loaded.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'D:\09_software\OFx\Installs\of_v0.9.3_vs_release\of_v0.9.3_vs_release\examples\gl\multiLightExample\bin\FreeImage.dll'. Module was built without symbols.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\crypt32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'D:\09_software\OFx\Installs\of_v0.9.3_vs_release\of_v0.9.3_vs_release\examples\gl\multiLightExample\bin\fmodex.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msasn1.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\IPHLPAPI.DLL'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\winmmbase.dll'
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wsock32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msacm32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tiptsf.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nvoglshim32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ig75icd32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\igdusc32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\version.dll'
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\UIAutomationCore.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sxs.dll'. Cannot find or open the PDB file.
'multiLightExample_debug.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.

But I’m also getting this with the ofSetupOpenGL method which works. Is it to do with these missing .dll’s ?

I published the app for release and ran it on another machine and it runs fine - no problem.
It must be to do with my graphics driver on my laptop - it’s a GeForce GT750m with integrated Intel 4600. The driver for the GT750m hasn’t been provided by Asus since my switch to Windows 10 so I’m running on the Intel 4600 which should default and does support OpenGL 4.3. The750m has a ‘code 43’ error in device manager.
It sounds likely it’s something to do with this (I didn’t think so at first as everything else seemed to render correctly so I assumed everyhting was just chanelling to the Intel graphics).

If you think it might be something else, please let me know, otherwise I apologise and hope I haven’t wasted too much of your time

Thanks

i’ve juist checked in windows and it0s working for me fine with both nvidia and intel cards. i’m on windows 8.1 not sure if that would make any difference.

you should be able to use the drivers driectly from nvidia in windows i think.

also the console where any error would appear is the DOS console that opens when the app is run not the one in visual studio

Oh yeah - I wasn’t looking at the DOS console window (my bad, new to this game ;)) but I have checked now, in debug mode, and nothing’s coming up there. No errors.

It’s a long story but my asus laptop doesn’t have the correct driver for the Nvidia chipset since I upgraded to W10. The last one they released was for W8.1 and I updated and can’t go back. I have tried Nvidia’s release drivers but they don’t work (I don’t fully understand it but it seems I need an Asus modified driver for it to work)

My laptop’s using the Intel graphics fine (albeit much less powerful) but I’m assuming this anomaly with OF must be due to it thinking it can use the Nvidia card and not being able to? Then again would it render the geometry at all if trying to channel through the Nvidia card? I don’t know enough about graphics drivers and rendering pipelines at the moment to sniff it out but it seems likely it’s this code 43 on my Nvidia that’s tripping me up. If you think it might be something else though let me know and I’ll dig deeper.

In the meantime I can use another machine for learning.

Thanks for your time!

no if you have no drivers there’s no way it would be using the nvidia card and most of the times in this nvidia optimus systems OF applications usually start on the intel card by default. if there’s no errors from the shader it’s really difficult to say what’s going on and i can’t reproduce it in my machine with similar specs.

one thing to try would be to update the drivers for the intel card. also to try a simpler example that uses shaders and see if that works

Thanks. I’ll try coding a shader example tomorrow (good learning project anyway :)) and see if that works / where it breaks down.
The Intel driver’s up to date (according to device manager anyway).

I’ll post back my results tomorrow