Skip to main content
7-Bedrock
August 9, 2021
Solved

Which GLSL versions can use in Vuforia Studio?

  • August 9, 2021
  • 2 replies
  • 3022 views

Hi,

 

I try higher version shader in TML (GLSL).

#version 300 es

After I preview the project, I got error message.

Compile error in vertex shader: ERROR: unsupported shader version

 

Best answer by sdidier

Hello William,

 

In a shader with this directive 

#version 300 es

can be only compile in a WebGL 2.0 context.

 

So, it is clear that Vuforia Studio and View are using a WebGL 1.0 context.

 

More details here :

https://stackoverflow.com/questions/51428435/how-to-determine-webgl-and-glsl-version/51527789

 

Another way to check and who is more accurate, is to look in the libthingview_wasm.js file provided in each Project created.

We can found a function named createContext.

In this function, we can see :

var ctx = canvas.getContext("webgl", webGLContextAttributes);

 

So, it is webgl 1.0 used and not webgl 2.0.

 

Best regards,

Samuel

2 replies

16-Pearl
August 9, 2021

can you please provide more details ?

sdidier17-PeridotAnswer
17-Peridot
August 16, 2021

Hello William,

 

In a shader with this directive 

#version 300 es

can be only compile in a WebGL 2.0 context.

 

So, it is clear that Vuforia Studio and View are using a WebGL 1.0 context.

 

More details here :

https://stackoverflow.com/questions/51428435/how-to-determine-webgl-and-glsl-version/51527789

 

Another way to check and who is more accurate, is to look in the libthingview_wasm.js file provided in each Project created.

We can found a function named createContext.

In this function, we can see :

var ctx = canvas.getContext("webgl", webGLContextAttributes);

 

So, it is webgl 1.0 used and not webgl 2.0.

 

Best regards,

Samuel

12-Amethyst
August 30, 2021

Quick clarifiction : View does not use webGL.   

It uses OpenGL ES 2.0  for IOS/Android.    DirectX 11 for hololens.

 

this is equivalent to webGL1.0 in terms of GLSL shader syntax.