Login  Register

I am New To GLSL C OpenGL Shader program

Posted by ElvJOGL on Feb 09, 2016; 3:26pm
URL: https://forum.jogamp.org/I-am-New-To-GLSL-C-OpenGL-Shader-program-tp4036135.html

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.