No problem. Here is a demo using the somewhat latest reasonable version of OpenGL to render a rotating, textured sphere: https://github.com/LWJGL/lwjgl3-demos/commit/4304297afc6275f791d8b3e2850b740b6cfcdb4fSee the Java and shader files in that commit. It uses OpenGL 3.2 Core Profile functions. There hasn't been much improvement in later OpenGL versions for such simple things as rendering a textured sphere. It's still always:- create a vertex and (optionally) index/element buffer- create a shader program- setup vertex specification with these buffers and the vertex attributes imported by the shader program- enable/bind shader- call draw functions
Do you have to use vao/vbos and shaders in opengl 3-4?
Just import the repository as Maven project into your favorite IDE and everything will be settled for you automatically.QuoteDo you have to use vao/vbos and shaders in opengl 3-4?Yes.
You probably meant "lighting". And yes, it is TOTALLY different. There is no fixed-function API anymore to specify light parameters such as position, color, specularity, etc. You have to write GLSL shaders for that.
is it harder in new opengl or harder?
Because from what I've heard, you should have more control of the lighting in opengl
Quote from: msacco on June 22, 2018, 17:40:02is it harder in new opengl or harder?Neither. It is harder. ;-)Quote from: msacco on June 22, 2018, 17:40:02Because from what I've heard, you should have more control of the lighting in openglYou do have more control with shaders, obviously, since you can implement your own custom lighting and shading models with simple linear algebra and arithmetic while not having to rely on fixed-function pipeline flat and phong shading which you merely control parameters of.But it sure has a learning curve attached to it. You know that you also do not have to use OpenGL >= 3. You can still perfectly use what you always used with OpenGL <= 2 and the fixed-function pipeline. It is not going to go away anytime soon. All drivers still perfectly support "legacy" OpenGL which might be absolutely sufficient for what you might want to do, if you do not want to invest into learning modern OpenGL and GLSL.
Well, everyone can only express their own opinions based on their own experience and the path they chose.If you really want to learn it and not achieve some immediate goal with finishing your planet rendering program, then my opinion is: start learning modern OpenGL.I myself started learning the legacy/old fixed-function pipeline OpenGL in 2007 and transitioned to more "modern" OpenGL 2.0 (VBOs and shaders) two years later. This has been at the expense of many many maaaaaaaany hours of googling the web left and right and up and down for OpenGL-related resources, articles, papers, specifications, forum posts, blog articles, literally everything, building dozens of little test and demo programs and throwing them away after reading how that all can be done better. If you get hooked by the thrill of learning it, and the small moments when it makes "click" in your head, then there's no stopping you anymore. The hardest thing but also the most fun is to get an accurate mental model of the object model, state management and the rendering pipeline in modern OpenGL.In modern OpenGL you just have a few core concepts/objects that you use for everything (VAO, buffer objects, textures, samplers, shaders and framebuffer objects). Then there are the different shader stages doing different things. Sooo many things to explore.So, start digging around and building your own mental model of modern OpenGL. I guess, at the beginning literally every starting point is a good point.