News for hackers. Stuff that matters.
Re:OpenGL in 2014 by pjmlp on Sunday September 21, 2014 @08:47AM (#8347004)
So in which section are APIs for loading defined?

I am having some problems locating the page.

Re:OpenGL in 2014 by wlievens on Sunday September 21, 2014 @09:18AM (#8347076)
That would be an API for asset management. OpenGL doesn't do that. It does do textures and shaders though.
Re:OpenGL in 2014 by pjmlp on Sunday September 21, 2014 @09:39AM (#8347130)
Which was my point, other graphics APIs do offer such support.
Re:OpenGL in 2014 by bsenftner on Sunday September 21, 2014 @10:14AM (#8347193)
That's not the job of a graphics API. It's a convenience utility that is not really feasible for OpenGL because it runs on so many platforms. You're asking for platform specific features on a cross platform library.
Re:OpenGL in 2014 by pjmlp on Sunday September 21, 2014 @10:53AM (#8347286)
What is platform specific about loading assets?

OpenGL is specified as a C API.

Such asset loading API could be defined just on top of ANSI C IO functions.

What about forcing every single OpenGL developer to write the same set of shader loading/compling/linking code?

Re:OpenGL in 2014 by orbifold on Sunday September 21, 2014 @11:25PM (#8349091)
Compared to what OpenGL has to accomplish, asset loading is orthorgonal. There is a number texture formats that most graphics cards support natively, the OpenGL API already exposes more than those and the Driver converts them on the fly. It is trivial to implement a bmp loader and slightly harder to load something like textures compressed with DXT, there are obviously third party libraries that do that for you. There are simply too many potential texture sources, to integrate that into an api. The same goes for 3d model loading, there are simply too many model formats and how you organize your vertex data is application specific anyways. The reason the shader loading / linking and compile code has to be written by the Developer is also fairly obvious, OpenGL does not want to support cross platform File IO and in real world projects 100s of shaders are actually dynamically linked in different combinations into render pipelines to create desired effects, the effects themselves are often creates in some kind of flow-based programming environment that is translated into shaders behind the scenes. Basic shader loading/compiling/linking on the other hand is trivial to implement.

Finally Window/Context creation is also platform specific and therefore can't really be specified.

Re:OpenGL in 2014 by pjmlp on Monday September 22, 2014 @05:04AM (#8349781)
> OpenGL does not want to support cross platform File IO and in real world projects 100s of shaders are actually dynamically linked in different combinations into render pipelines to create desired effects, the effects themselves are often creates in some kind of flow-based programming environment that is translated into shaders behind the scenes.

Which other APIs support with effects, scene description files, ....

> Basic shader loading/compiling/linking on the other hand is trivial to implement.

Hence why every single OpenGL newbie keeps copy-pasting it from somewhere.

> Finally Window/Context creation is also platform specific and therefore can't really be specified.

So why did they get to the trouble of creating EGL?

Re:OpenGL in 2014 by teach on Sunday September 21, 2014 @08:10PM (#8348760)
OpenGL is just for drawing. If you want asset management, you'll probably find it in SDL[0], which is also cross-platform and used heavily by almost everyone that uses OpenGL.

[0] https://www.libsdl.org/

Re:OpenGL in 2014 by pjmlp on Monday September 22, 2014 @04:59AM (#8349775)
Including myself and no, SDL doesn't do assets.