Published : 009 – The OpenGL Render Pipeline with guest Robert Menzel

I just published a new Episode in my OpenGL & Vulkan Podcast:

009 – The OpenGL Render Pipeline – with guest Robert Menzel
Robert Menzel explains the Render Pipeline

http://opengl-trainer.de/podscats/folgen/009_The_Render_Pipeline_with_Guest_Robert_Menzel.mp3

Blog of Robert Menzel: http://renderingpipeline.com/

Additional Info: https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/

Render Pipeline
OpenGL-4.0-Programmable-Shader-Pipeline1

 

Find it on iTunes:
https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml

Published : 008 Textures – lets get started

I just published a new Episode in my OpenGL & Vulkan Podcast:

008 Textures lets get started
Introduction to OpenGL Textures.

http://www.opengl-trainer.de/podscats/folgen/008_Textures_lets_get_started.mp3

Read Pixel Order
pixel order

 

 

 

 

 

 

 

 

 

Create a Texture from Byte Array

GLuint texture;
unsigned char * data;

glGenTextures( 1, &texture );
glBindTexture( GL_TEXTURE_2D, texture );

glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );

glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data);

Texture Coordinates

texturecoordinates

 

 

 

 

 

 

Find it on iTunes:
https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml

Free OpenGL Online Workshop

OpenGL

Free OpenGL Online Workshop for Beinners – Part I

I will offer a free OpenGL Online Workshop for Beginners in late
November 2015   and / or in   December 2015.
Date depending on attendees feedback.

Possible Dates:
26.11.2015  or 27.11.2015

Duration:
4 to 6 hours

Topic:
I will give a basic Introduction to OpenGL for People that just get started.
– Geometry / Primitives
– Rendering in general
– Textures
– FreeGLUT / GLEW
– Animation
….

Participate:
Workshop will be in English.
You should have basic knowledge of Programming, best C/C++ or JAVA.
I will do the Workshop in a Skype Group Call, so you only need Skype or a modern Browser.
You don´t really need to register, but submit you E-Mail to me so i can invite you to the Skype Call.
Submit E-Mail here: http://www.opengl2go.net/workshop.html

Feedback:
Fell free to give me Feedback or Topic requests for the Workshop.

Published : 007 – Shaders in more detail

I just published a new Episode in my OpenGL & Vulkan Podcast:

007 – Shaders in more detail
A closer Look at shaders and how they work.

http://www.opengl-trainer.de/podscats/folgen/007_Shaders_in_more_detail.mp3

Vertex Shader ( simple – passthrough )

  attribute  vec3 v_in_Position;
  uniform    vec3 lightPos;
  varying    vec4 ex_Color;
  void main(void)
  {
      gl_Position = v_in_Position;
  }

Fragment Shader ( simple – all green Pixel )

  precision mediump float;
  uniform    vec3 lightPos;
  varying    vec4 ex_Color; 
  void main(void)
   {
       precision highp float specialVal = 0.0000003453;
       gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
   }

Create Shader Objects

VertexShaderId = glCreateShader( GL_VERTEX_SHADER );
glShaderSource( VertexShaderId, 1, &VertexShader, NULL );
glCompileShader( VertexShaderId ) ;

// check for errors

FragmentShaderId = glCreateShader( GL_FRAGMENT_SHADER );
glShaderSource( FragmentShaderId, 1, &FragmentShader, NULL);
glCompileShader( FragmentShaderId );

Create Programm Object

ProgramId = glCreateProgram();
glAttachShader( ProgramId, VertexShaderId );
glAttachShader( ProgramId, FragmentShaderId );
glLinkProgram( ProgramId );

Get Shader variable Locations

s_vertexLoc   = glGetAttribLocation  ( ProgramId ,”v_in_Position” );
s_colorLoc     = glGetAttribLocation  ( ProgramId , “in_Color” );
s_normalLoc  = glGetAttribLocation  ( ProgramId , “in_normal” );

s_MatrixLoc = glGetUniformLocation ( ProgramId , “pers_Matrix” );
s_lightLoc     = glGetUniformLocation ( ProgramId , “lightPos” );

Prepare for drawing

 glVertexAttribPointer( s_vertexLoc , 3, GL_FLOAT, GL_FALSE, 0, Vertices );
glVertexAttribPointer( s_colorLoc , 4, GL_FLOAT, GL_FALSE, 0, Colors );
glVertexAttribPointer( s_normalLoc , 3, GL_FLOAT, GL_FALSE, 0, Normals );

glUniformMatrix4fv( s_MatrixLoc, 1, GL_FALSE, &modellMatrix );

GLfloat Light[] = { 0.0 , 0.0 , 0.8 };
glUniform3fv( s_lightLoc ,1 , (GLfloat*)&Light );

 

Find it on iTunes:
https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml

Published: 006 – Introduction to Shaders

I just published a new Episode in my OpenGL & Vulkan Podcast:

006 – Introduction to Shaders
A quick Introduction to Shaders and GLSL.

http://www.opengl-trainer.de/podscats/folgen/006_Introduction_to_Shaders.mp3

Vertex Shader ( simple – passthrough )

 1 void main(void)
 2 {
 3     gl_Position = my_in_Vertex;
 4 }

Fragment Shader ( simple – all green Pixel )

 1 void main(void)
 2 {
 3     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
 4 }

Find it on iTunes:
https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml

Published: 005 – VULKAN – Part 1

I just published a new Episode in my OpenGL & Vulkan Podcast:

005 – VULKAN – Part 1
First preview at the Vulkan API thats coming.

http://www.opengl-trainer.de/podscats/folgen/005_VULKAN_Part_1.mp3

Vulkan

Find it on iTunes:
https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml

Published : 004 – OpenGL Primitives and how to draw from Arrays

I just published a new Episode in my OpenGL & Vulkan Podcast:

004 – OpenGL Primitives and how to draw from Arrays.
In This Episode we introduce the OpenGL Primitives and how you structure your Arrays to draw from them.

http://opengl-trainer.de/podscats/folgen/004_OpenGL_Primitives_and_how_to_draw_from_Arrays.mp3


OpenGL Primitives :

 

gl-primitives

Simple drawing:

    ….
glBegin(GL_TRIANGLES);

glVertex3f(100.0f, 100.0f, 0.0f);
glVertex3f(150.0f, 100.0f, 0.0f);
glVertex3f(125.0f, 50.0f, 0.0f);

glEnd();
….
glBegin(GL_LINES);

glVertex3f(100.0f, 100.0f, 0.0f); // origin of the FIRST line
glVertex3f(200.0f, 140.0f, 5.0f); // ending point of the FIRST line
glVertex3f(120.0f, 170.0f, 10.0f); // origin of the SECOND line
glVertex3f(240.0f, 120.0f, 5.0f); // ending point of the SECOND line

glEnd( );

 

Drawing from a Array:


GLfloat vertices[] = {…}; // 36 of vertex coords

glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer( 3, GL_FLOAT, 0, vertices );

glDrawArrays( GL_TRIANGLES , 0 , 3 );

glDisableClientState( GL_VERTEX_ARRAY );


Find it on iTunes:

https://itunes.apple.com/de/podcast/opengl-vulkan-podcast/id1047136194?l=en

Use RSS Podcast link:
http://opengl-trainer.de/podscats/OpenGL_Vulkan_Podcast.xml