I am New To GLSL C OpenGL Shader program

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

I am New To GLSL C OpenGL Shader program

ElvJOGL
Hi, The best source of information on OpenGL that I have is this book: OpenGL SuperBible, 6 Edition. I know that there are tutorials on JOGL shaders, but I cannot see to find anything that works. However, in the book that I refer above it shows GLSL program's. My question is, based on the shader language below: #version 430 core //-------------------------------------------------------------------- // "offset" is an input vertex attribute layout (location = 0) in vec4 offset; void main(void){ const vec4[3](vec4( 0.25, -0.25, 0.5, 1.0), vec4(-0.25, -0.25, 0.5, 1.0), vec4( 0.25, 0.25, 0.5, 1.0)); //add "offset" to our hard-coded vertex position gl_Position = vertices[gl_VertexID] + offset; } //-------------------------------------------------------------------- Ok, the shader language above is from the textbook I referred above. My question is: if I were to write the same shader in JOGL GLSL, will it be the same exact coding I used in this example, or will it be different to fit the fact that one is doing OpenGL in JOGL java? Please let me know, because I want to be able to translate the shader code that I get from the book into JOGL java. Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: I am New To GLSL C OpenGL Shader program

elect
This post was updated on .
Hi ElvJOGL and welcome :)

unfortunately there are many outdated jogl samples around

the superbible 6 edition is quite good, although is not the last one, it should already cover opengl 4 as far as they say

if you want something fast and quick, copy and paste this hello triangle sample, add jogl as library and you are good to go.

You can learn modern opengl by studing the bible and at the same time trying to apply the sample shown there on jogl by yourself (actually one of the best way to learn), you may want to use the helloTriangle as base to start from, or you can also take a look to the jogl-samples, a port I made of g-truc ogl-sample

Reply | Threaded
Open this post in threaded view
|

Re: I am New To GLSL C OpenGL Shader program

ElvJOGL
Thank you.

This example is really good.

I think I will make a different post about something else that I am dealing with and my option of using jogl shader programs is looking like the most feasible way I can accomplish what I want to do.

It is in this post: http://forum.jogamp.org/Extending-Functionality-of-Shader-Programs-td4036139.html

Thank you @elect