I recently started getting into graphics programming (2nd try, first try was many years ago) and I'm working on a 3d rendering engine which I hope to be able to make a 3D game with sooner or later. I have plenty of C++ experience, but not a lot when it comes to graphics, and while it's definitely going much better this time, I'm having trouble figuring out how assets are usually handled by engines.
I'm not having trouble with handling the GPU resources, but more so with how the resources should be defined and used in the system (materials, models, etc).
This is my plan now, I've implemented most of it except for the XML parts and factories and those are the ones I'm not sure of at all:
I have these classes:
For GPU resources:
Geometry: holds and manages everything needed to render a geometry: VAO, VBO, EBO. Texture: holds and manages a texture which is loaded into the GPU. Shader: holds and manages a shader which is loaded into the GPU. For assets relying on GPU resources:
Material: holds a shader resource, multiple texture resources, as well as uniform settings. Mesh: holds a geometry and a material. Model: holds multiple meshes, possibly in a tree structure to more easily support skinning later on? For handling GPU resources:
ResourceCache<T>: T can be any resource loaded into the GPU. It owns these resources and only hands out handles to them on request (currently string identifiers are used when requesting handles, but all resources are stored in a vector and each handle only contains resource's index in that vector) Resource<T>: The handles given out from ResourceCache. The handles are reference counted and to get the underlying resource you simply deference like with pointers (*handle).
And my plan is to define everything into these XML documents to abstract away files:
Resources.xml for ref-counted GPU resources (geometry, shaders, textures) Resources are assigned names/ids and resource files, and possibly some attributes (what vertex attributes does this geometry have? what vertex attributes does this shader expect? what uniforms does this shader use? and so on) Are reference counted using ResourceCache<T> Assets.xml for assets using the GPU resources (materials, meshes, models) Assets are not reference counted, but they hold handles to ref-counted resources. References the resources defined in Resources.xml by names/ids. The XMLs are loaded into some structure in memory which is then used for loading the resources/assets using factory classes:
Factory classes for resources:
For example, a texture factory could contain the texture definitions from the XML containing data about textures in the game, as well as a cache containing all loaded textures. This means it has mappings from each name/id to a file and when asked to load a texture with a name/id, it can look up its path and use a "BinaryLoader" to either load the file and create the resource directly, or asynchronously load the file's data into a queue which then can be read from later to create the resources synchronously in the GL context. These factories only return handles.
Factory classes for assets:
Much like for resources, these classes contain the definitions for the assets they can load. For example, with the definition the MaterialFactory will know which shader, textures and possibly uniform a certain material has, and with the help of TextureFactory and ShaderFactory, it can retrieve handles to the resources it needs (Shader + Textures), setup itself from XML data (uniform values), and return a created instance of requested material. These factories return actual instances, not handles (but the instances contain handles).
Is this a good or commonly used approach? Is this going to bite me in the ass later on? Are there other more preferable approaches? Is this outside of the scope of a 3d renderer and should be on the engine side? I'd love to receive and kind of advice or suggestions!
As some of you may know, I do have a Computer Science background, but either by chance/design/fate/insert stupid excuse here, I didn't take any graphics courses in my undergraduate degree, but now I'd be very interested in at least learning the basics of graphics and potentially pursuing more in graphics. I'm interested in all sorts of graphics in general, so everything from real-time engines to rendering engines like Arnold, Octane, etc. Can anyone point me in the right directions for books/tutorials?
Thanks in advance!
EDIT: Apologies in advance if I missed the proper channels for this as well
After my first thread and some painful deleting AND some lengthy drive resizing, I now have Unity and Visual Studio Enterprise
As the hype of me finally being able to make a game that I've always dreamed of faded away because of school schedule being a douchebag, I came to a painful realization that I basically don't know anything about Unity (making progress at least, with the tutorial, the rest....well....I don't have a credit card yet, and my age is 2^4 + 1 (don't wanna be too....public)) nor C# (hopefully dotnetcademy.net's C# course for complete beginners can somehow help me with this).
At least I know what I am doing (I guess) with my game: 2D, Top down, Isometric, Pixel Art (because I'm on my own and I can't draw like an artist and I'm too broke), RPG with EXP, Class Advancement system and probably some sort of a seeding mechanism for randomized gameplay
So, as a complete greenhorn stepping into the field with a completely wrong set of equipments, I'd love some advices from the pros and the experienced (all advices are welcomed OwO)/ ), esp to these questions:
- Should I take on regular C# and then learn Unity C# or skip regular C# and straight to Unity C#?
- Is pixel art really a way out for me on the visual part? Sprites, maps, items, effects, etc......
- Is my idea okay? Is there anything I can add in or cross out?
- Should I do this alone? Or should I get some accomplices? I'm not planning to rush it anyway.
Thank you in advance. Sorry, no potato this time
I want to ask a question about how much time it normally takes to make large games.
I am doing a proposal assignment and wanted some sources for how much time it would normally take for larger games to be developed and released. I just thought I could ask around here while doing google searches elsewhere.
Sources I found so far: