Browsing this Thread:
1 Anonymous Users
GLSL shaders |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
875
![]() |
Is it possible to compile GLSL shaders with the current version of Mesa? I have two programs which use glShaderSourceARB and glCompileShaderARB, but none of them works. They fail with some generic error message (fragment/vertex shader failed to compile).
Posted on: 1/6 5:05
|
|
Transfer
|
||
Re: GLSL shaders |
||
|---|---|---|
|
Joined:
1/15 16:24 From Hungary
Group:
Member Posts:
2
![]() |
I'm interested in same functions. Can I use GLSL shaders under AROS?
Posted on: 1/18 4:52
|
|
Transfer
|
||
Re: GLSL shaders |
||
|---|---|---|
Joined:
2008/1/7 12:41 From Poland
Group:
Member Posts:
2098
![]() |
Hi,
GLSL is working though I don't remember this version is available. There is Cube2 and DOOM3 ports that use it as well I written a simple code in tests/mesasimplerendering which also use shaders. BSzili: try using functions without ARB suffix
Posted on: 1/18 5:57
|
|
|
_________________
Krzysztof "There is no such thing as software for free. If it is not the user who covers the cost of software creation with money, it is the developer who covers this cost with his own free time." www.aros3d.org www.twitter.com/ddeadwood |
||
Transfer
|
||
Re: GLSL shaders |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
875
![]() |
AFAIR both Supermodel and Darkplaces use the non-ARB versions of these functions. but they can't compile shaders either.
edit: Doesn't Doom3 use ARB assembly shaders? Cube2 also supports assembly shaders beside GLSL.
Posted on: 1/18 11:01
|
|
Transfer
|
||
Re: GLSL shaders |
||
|---|---|---|
Joined:
2008/1/7 12:41 From Poland
Group:
Member Posts:
2098
![]() |
@BSzili
I seem to remember that there are some gl error reporting functions that allow you to read the output of compiler and linker so that you can get more information on what is failing. Edit, here is my simple code: fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragmentShader, 1, &fragmentShaderSource, NULL); glCompileShader(fragmentShader); glGetShaderInfoLog(fragmentShader, BUFFER_LEN, &len, buffer); printf("Fragment shader compile output: %s\n", buffer); vertexShader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertexShader, 1, &vertexShaderSource, NULL); glCompileShader(vertexShader); glGetShaderInfoLog(vertexShader, BUFFER_LEN, &len, buffer); printf("Vertex shader compile output: %s\n", buffer); shaderProgram = glCreateProgram(); glAttachShader(shaderProgram, vertexShader); glAttachShader(shaderProgram, fragmentShader); glLinkProgram(shaderProgram); glGetProgramInfoLog(shaderProgram, BUFFER_LEN, &len, buffer); printf("Shader program compile output: %s\n", buffer);
Posted on: 1/18 11:42
|
|
|
_________________
Krzysztof "There is no such thing as software for free. If it is not the user who covers the cost of software creation with money, it is the developer who covers this cost with his own free time." www.aros3d.org www.twitter.com/ddeadwood |
||
Transfer
|
||
Re: GLSL shaders |
||
|---|---|---|
|
Joined:
2011/9/25 1:23 From Hungary
Group:
Member Posts:
875
![]() |
It turns out that supermodel already had the glGetShaderInfoLog() function.
// Attempt to compile fragment shader
This is the output I'm getting: Quote: 0:28:(11) error: syntax error, unexpected IDENTIFIER, expecting INT constant. The output is same for the fragment and the vertex shader. edit: And the line which causes the error: Quote: #version 120 edit #2: Well, what do you know, getting rid of that line from the shader helped the problem. So our Mesa implementation doesn't know about the #version directive?
Posted on: 2/5 1:22
Edited by BSzili on 2013/2/5 1:56:23
Edited by BSzili on 2013/2/5 2:03:14 |
|
Transfer
|
||
You can view topic.
You cannot start a new topic.
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.


Transfer
supermodel1.jpg (319.49 KB)







