@Green_Baron: Any book you'd recommend for someone with code experience and works best from a physical book rather than online tutorials, etc.?
And @fleabay , if you ever start a band, you could do far worse than Accidental Trolls as its name.
@Green_Baron: Any book you'd recommend for someone with code experience and works best from a physical book rather than online tutorials, etc.?
And @fleabay , if you ever start a band, you could do far worse than Accidental Trolls as its name.
I second @Green_Baron about "learnopengl.com". This source alone covers 90% of all I need.
Although I still prefer real paper book, I like this website so much. It explains almost like a workshop book.
The website is about OpenGL 3.3, but that should be enough for most general cases including my game.
Superbible Book is like .... the more I read, the more I feel far away.
Yep, learnopengl.com for the first steps. That helped me set things up.
Book to start from:
And then:
Both come with their own little frameworks, nice for looking up how things work, but i'd just browse them and do my own stuff as early as possible. Aren't these well known everywhere ?
well I have read the opengl superbible 7th ed. I don't know how to setup a shader with visual studio 2017
I assume you know how to add an empty textfile to your project and start editing it.
Loading, compiling and linking the components of a shader is described from pp. 219ff in the blue book. Overview: you create a shader object for each shader to load, load the shader's textfile(s) into memory, compile them one by one, create a shader program object and link the shaders into a program. A program consists of several shaders, the minimum is a vertex and a fragment shader, optional are geometry and tessellation shaders. After linking, the shader objects can be discarded if you don't plan to use them elsewhere. Then you can use that program, set its uniform variables, feed vertex- and other data to it.
Additionally to the superbible, a more cookbook style variant of the process of loading, compiling and linking shaders into a program is in the learnopengl.com site, here.
Because you are using GLSL directives in your C++ code. Maybe you told VS to create a new C++ source file and VS tries to compile it. GLSL is not C++ ! Use plain text as the format for a shader file.
You must strictly distinguish between your application code, which is C++ (i assume), and the shader code, which is GLSlang. The application code runs on your CPU, the shader code is executed by the GPU. Your application code calls the shader code by issuing OpenGl draw commands. But before you can draw, your must write the shader code that computes the positions and colour of your pixels on the screen, load the text, compile and link it, check for errors, etc. You do this by calling OpenGL functions (like glCreateShader, glCompileShader, glLinkProgram, ...) from your C++ code. See, read an understand the page on shaders from learnopengl i linked above, in addition to and as a fundament for the Blue Book.