Forums
GL3 Shader Error (could not load gl3 shader) - Printable Version

+- Forums (https://www.vdrift.net/Forum)
+-- Forum: Community (https://www.vdrift.net/Forum/forumdisplay.php?fid=3)
+--- Forum: Help (https://www.vdrift.net/Forum/forumdisplay.php?fid=5)
+--- Thread: GL3 Shader Error (could not load gl3 shader) (/showthread.php?tid=1657)

Pages: 1 2


GL3 Shader Error (could not load gl3 shader) - kidice - 08-23-2012

Hi everyone!

i get an GL3 Shader Error (see log below) when i start vdrift, so it switches to GL2 for rendering. Is there a way to fix this, so i can use GL3 instead of GL2?
Another problem is that vdrift uses the CPU instead of GPU to render the scene, although it recognises my graphics card.

i have a nvidia quadro 2000 and using driver version 297.03. Vdrift (development version) is running on a windows 7 x64 operating system.


Here's the log:

Code:
INFO: Starting VDrift: development-full, Revision: latest, O/S: Windows
INFO: Home directory: C:\Users\student
INFO: Settings file: C:\Users\student\Documents\VDrift/VDrift.config
INFO: Data directory: data
INFO: Temporary directory: C:\Users\student\Documents\VDrift/tmp
INFO: Log file: C:\Users\student\Documents\VDrift/log.txt
INFO: Disabling antialiasing
INFO: Video card information:
      GL Vendor: NVIDIA Corporation
      GL Renderer: Quadro 2000/PCIe/SSE2
      GL Version: 4.2.0
      Texture units: 4 full, 32 partial
      Maximum texture size: 16384
      Maximum varying floats: 124
INFO: Initialized GLEW 1.7.0
INFO: Loading data/shaders/gl3/vdrift1.rhr...
INFO: Loaded data/shaders/gl3/vdrift1.rhr
ERROR: Unable to compile shader deferredaa.frag from file data/shaders/gl3/deferredaa.frag:
       0(903) : error C7532: global function textureGather requires "#version 400" or later
       0(903) : error C0000: ... or #extension GL_ARB_gpu_shader5 : enable
       0(904) : error C7532: global function textureGatherOffset requires "#version 400" or later
       0(904) : error C0000: ... or #extension GL_ARB_gpu_shader5 : enable
      
ERROR: Initialization of GL3 renderer failed; that's OK, falling back to GL 1 or 2
INFO: Using GLEW 1.7.0
INFO: Maximum color attachments: 8
INFO: Maximum draw buffers (1 required): 8
INFO: Loaded shader package simple
INFO: Loaded shader package simple, variant simple_premult
INFO: Loaded shader package simple, variant simple_gamma_premult
INFO: Loaded shader package simple, variant simple_gamma
INFO: Loaded shader package simple, variant simplecar
INFO: Loaded shader package tonemap
INFO: Loaded shader package gbufferfill
INFO: Loaded shader package gbufferfill, variant gbufferfillcar
INFO: Loaded shader package lightaccumulate, variant lightaccumulate_initial
INFO: Loaded shader package lightaccumulate, variant lightaccumulate_omni
INFO: Loaded shader package depthgen
INFO: Loaded shader package depthgen, variant depthgennoalpha
INFO: Loaded shader package distancefield
INFO: Loaded shader package deferredskybox
INFO: Loaded shader package deferredskyboxblend
INFO: Loaded shader package softparticle
INFO: Loaded shader package ppdepthadjust
INFO: Loaded shader package ppdepthadjust, variant ppcopy
INFO: Loaded shader package ppdepthadjust, variant ppcopy_gamma
INFO: Loaded shader package deferredshadows
INFO: Loaded shader package ssao
INFO: Loaded shader package ssao_blur
INFO: Loaded shader package deferredaa
INFO: Successfully enabled shaders
INFO: Initialized render output: full_scene_depth (FBO)
INFO: Initialized render output: full_scene_color (FBO)
INFO: Initialized render output: full_scene_tonemapped (FBO)
INFO: Initialized render output: normal_xy (FBO)
INFO: Initialized render output: material_properties (FBO)
INFO: Initialized render output: diffuse_albedo (FBO)
INFO: Initialized render output: log_luminance (FBO)
INFO: Initialized render output: log_luminance_tiny (FBO)
INFO: Maximum anisotropy: 16
INFO: 1 joystick found:
INFO:     0. Logitech G27 Racing Wheel USB
INFO: Loading car controls from: C:\Users\student\Documents\VDrift/controls.config
INFO: Update status file C:\Users\student\Documents\VDrift/updates.config will be created
INFO: Update status file C:\Users\student\Documents\VDrift/updates.config will be created
INFO: Sound initialization information:
INFO: Obtained audio device:
      Frequency: 44100
      Format: 32784
      Bits per sample: 16
      Channels: 2
      Silence: 0
      Samples: 2048
      Size: 8192
      Sound initialization successful
INFO: Loaded fonts successfully
INFO: Loaded GUI successfully
INFO: Force feedback enabled.
INFO: Loading track from path: data/tracks/garage
INFO: Loaded surfaces file, 7 surfaces.
INFO: No lap sequence found. Lap timing will not be possible.
INFO: Car loading was successful: Audi TT
INFO: Got quit message from GUI. Shutting down...
INFO: Profiling summary:
      render: 77.6241 %
      scenegraph: 12.1619 %
      sound: 0.185457 %
INFO: Shutting down...
INFO: Exiting

Here's the profiling, where you can see that the rendering is done on the cpu:
[Image: unbenanntyjv.png]

thanks for your help!


- NaN - 08-23-2012

You are running with GL2 renderer on your GPU. The CPU numbers are showing the time spent on the CPU side(render, scene, sound, physics, ai). GL2 doesn't have GPU timing support, there is nothing to show.

About the data/shaders/gl3/deferredaa.frag error. It is funny because the shader is from NVidia it seems:
Code:
COPYRIGHT (C) 2010, 2011 NVIDIA CORPORATION. ALL RIGHTS RESERVED.

You could try changing "#version 130" to "#version 400" in deferredaa.frag.


- kidice - 08-23-2012

hi nan!

thanks for your help and the information about the gl2 renderer.
i don't get any errors after changing the version of the dferredaa.frag from 130 to 400. But the profiling still don't show any information about the rendering of the gpu.

edit: debugging vdrift showed me, that vdrift is still using the gl2 renderer...

edit2: okay, just recompiled vdrift and now it works without problems! thank you!


RE: GL3 Shader Error (could not load gl3 shader) - arturo - 02-18-2018

Hi NaN, I have a somewhat different error here:

Code:
ERROR: Linking of shader program failed:
       error: vertex shader output `eyespacePosition' has invariant qualifier, but fragment shader input lacks invariant qualifier
       
ERROR: Unable to create shader program
ERROR: Initialization of GL3 renderer failed; that's OK, falling back to GL 1 or 2

Is there a solution?


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-18-2018

(02-18-2018, 09:58 AM)arturo Wrote: Hi NaN, I have a somewhat different error here:

Code:
ERROR: Linking of shader program failed:
       error: vertex shader output `eyespacePosition' has invariant qualifier, but fragment shader input lacks invariant qualifier
       
ERROR: Unable to create shader program
ERROR: Initialization of GL3 renderer failed; that's OK, falling back to GL 1 or 2

Is there a solution?

Not sure. From what I see the invariant qualifier is only used on gl_Position.

The latest OpenGL spec also says that only outputs can be marked invariant, inputs don't have to.

Try removing "invariant gl_Position;" from the vert files in shaders gl3, to see what happens.

If this doesn't work, try replacing "in vec3 eyespacePosition;" with "invariant in vec3 eyespacePosition;" in the frag files.


RE: GL3 Shader Error (could not load gl3 shader) - arturo - 02-19-2018

(02-18-2018, 03:28 PM)NaN Wrote: Try removing "invariant gl_Position;" from the vert files in shaders gl3, to see what happens.

If this doesn't work, try replacing "in vec3 eyespacePosition;" with "invariant in vec3 eyespacePosition;" in the frag files.

Sorry, I can't find shaders gl3: there is a gl3v folder within src/graphics; also within graphics there are some files called vertex... Are these the ones I should look into?

I'm a bit lost...


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-20-2018

The shader files are in the data dir: data/shaders/gl3


RE: GL3 Shader Error (could not load gl3 shader) - arturo - 02-20-2018

Thanks NaN, your first suggestion did the trick and now I see things in GL3!

I am not sure whether I like it, though. Even with the option "very far" chosen for "view distance", I have objects popping up that I had not with GL2. In Spa 2008 these are only the little signs telling the distance in meters before each turn, while in Le Mans I have trees and everything popping up all over the place.


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-20-2018

(02-20-2018, 12:53 PM)arturo Wrote: Thanks NaN, your first suggestion did the trick and now I see things in GL3!

I am not sure whether I like it, though. Even with the option "very far" chosen for "view distance", I have objects popping up that I had not with GL2. In Spa 2008 these are only the little signs telling the distance in meters before each turn, while in Le Mans I have trees and everything popping up all over the place.

The gl3 renderer has object screen size culling (objects that only cover a few pixels are not rendered). It might be a bit too aggressive.

This is something that probably should also be added to gl2 and made adjustable by the player.


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-21-2018

I've pushed a fix for the object pixel size culling calculation. It should fix the pop up issues.

Will add it to the gl2 renderer too.


RE: GL3 Shader Error (could not load gl3 shader) - arturo - 02-22-2018

Great, that solved my GL3 problem in Spa 2008!
However, in Le Mans I still get as many pop-up trees and buildings as before.
But I can use GL2 there, which always worked fine.


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-22-2018

(02-22-2018, 04:27 AM)arturo Wrote: Great, that solved my GL3 problem in Spa 2008!
However, in Le Mans I still get as many pop-up trees and buildings as before.
But I can use GL2 there, which always worked fine.

Hmm, that is weird. Can you share a couple screenshots (one shortly before and one after pop up)? At what resolution are you playing?


RE: GL3 Shader Error (could not load gl3 shader) - arturo - 02-22-2018

I'm using the highest resolution, 2560x1600.
You can see the giant screen on the right side and the tree just behind it as they grow up.

[Image: MM9Mye6l.png]


[Image: LUudIYnl.png]



RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-23-2018

Thanks.

The good news is that it's not the culler. It would make the whole tree and screen pop in/out.

I think it's the sky dome mesh rendered incorrectly.


RE: GL3 Shader Error (could not load gl3 shader) - NaN - 02-23-2018

Yeah, as a performance optimization the gl3 renderer draws sky/background geometry after drawing track objects. Should be fixable.

Maybe we should get rid of such skydomes altogether and switch to skyboxes (cubemaps).


Edit:
I've pushed a possible fix to data (modifies shaders/gl3/deferred.conf and simple.vert).