DGL https://delphigl.com/forum/ |
|
Shaders problem https://delphigl.com/forum/viewtopic.php?f=19&t=4378 |
Seite 1 von 1 |
Autor: | BTierens [ Mi Jul 27, 2005 19:11 ] |
Betreff des Beitrags: | Shaders problem |
Hi, I want to learn OpenGL shading language and I'm trying to make a shader "hello world" in FreePascal. Shaders are supported but I don't see anyting in my OpenGL window (yes, the quad is in the view frustum ![]() Code:
This are the shaders: shader.txt: void main() { gl_Position = ftransform(); } shader2.txt: void main() { gl_FragColor = vec4(0.4,0.4,0.8,1.0); } |
Autor: | La Boda [ Mi Jul 27, 2005 20:01 ] |
Betreff des Beitrags: | |
Oh, you got the same thing wrong like I when I started into GLSL. Here Vertex-and Fragmentprogramm are a unity! Ya always need the both of them. Here is my Shader-Loading-Function: Code:
|
Autor: | BTierens [ Do Jul 28, 2005 16:56 ] |
Betreff des Beitrags: | |
The demo uses both a vertex and a fragment shader. I changed the code so it looks more like the lighthouse3d hello world but I still don't see the vertex shaded. Did I forget to enable something or to call a OpenGL function? Code:
|
Autor: | La Boda [ Do Jul 28, 2005 17:26 ] |
Betreff des Beitrags: | |
Have your shaders the right lines? You wrote: Zitat: void main()
{ gl_Position = ftransform(); } Is ftransform the same as gl_ModelViewProjectionMatrix * gl_Vertex;? And try some other Colors for glFragColor. Check your shaders with the follwing Code: Code:
Usage: Code:
|
Autor: | BTierens [ Do Jul 28, 2005 18:28 ] | ||
Betreff des Beitrags: | |||
Still the same. Ftransform is the same as gl_ModelViewProjectionMatrix * gl_Vertex; The attachment contains the demo source, shaders and executable.
|
Autor: | Gast [ Sa Jul 30, 2005 08:11 ] |
Betreff des Beitrags: | |
I've managed to write a shaders hello world in FreePascal. Thanks for your help. |
Autor: | La Boda [ Sa Jul 30, 2005 10:19 ] |
Betreff des Beitrags: | |
You are welcome Could you please tell me how you made it? |
Autor: | BTierens [ Sa Jul 30, 2005 14:44 ] |
Betreff des Beitrags: | |
I used your second demo and replaced your shaders by the hello world shaders. Then I replaced the TForm OpenGL surface by SDL. |
Seite 1 von 1 | Alle Zeiten sind UTC + 1 Stunde |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |