Sign in to follow this  
Aroidzap

GLSL version directive

Recommended Posts

Adding version directive to my shaders causes that they not work. I tried adding all versions. None works.
#version 110
#version 120
#version 130 ... 140,150,330,400,410,420,430

Without this directive, shaders works normally. Any suggestion?

Share this post


Link to post
Share on other sites
Ehm... I have not implemented that yet [img]http://public.gamedev.net//public/style_emoticons/default/rolleyes.gif[/img] (glGetShaderInfoLog) ... I will post results in few hours [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img] Edited by Aroidzap

Share this post


Link to post
Share on other sites
so... I've got errors like this:

error C7533: global variable gl_Normal is deprecated after version 120
error C7533: global variable gl_Vertex is deprecated after version 120
...
error C7011: implicit cast from "float" to "vec4"
...
error C7565: assignment to varying ...
error C7564: assignment to attribute ...
[CODE]attribute vec3 tangent;
...
tangent = gl_NormalMatrix * tangent;[/CODE]
...

than some warnings :

warning C7555: 'varying' is deprecated, use 'in/out' instead
warning C7555: 'attribute' is deprecated, use 'in/out' instead
...

Share this post


Link to post
Share on other sites
All of these should be pretty obvious. You need to pick a version of shaders you want to work for and then read up on how to work with them. You cannot claim to use modern (or at least newer) shader versions and use language elements that were deprecated years ago.

I would be very careful when googling for tutorials, a lot them are very old and/or were not very good to begin with. If the tutorial does not explain properly for which version it is, it will probably cause you more pain in the long run. Reading the GLSL specification might be the best solution to get a good and solid grip on the language, but the documents might be a bit long for the impatient. The Wikipedia page for GLSL has the specifications for older and newer versions accessible from one spot ([url="http://en.wikipedia.org/wiki/Glsl"]http://en.wikipedia.org/wiki/Glsl[/url]), the official site only has the latest version easily linked: [url="http://www.opengl.org/documentation/glsl/"]http://www.opengl.org/documentation/glsl/[/url]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this