This was how rendering in my engine was done before…
Everything wrong with the old system
creating a new material prototype was a huge pain : materials had to be sorted manually into their respective renderers
to access a material one must go through a renderer that uses that specific material prototype
rendering materials is a huge pain
in order to update the view and projection matrices, the user must manually access the shader of the rendererer(material prototype of the renderer)
/* material handler sorts all materials and renderers and stores them in an accessible way */classmaterial_handlermaterials;/* initializing */autosky_material=materials.add_material("material.sky",material_light_info()/* no lighting */,shaders[shader_handle("shader.sky")],lights,&world.get_scene_camera());/* rendering */materials.render_all();
This is how rendering in my engine is done now… and it makes me so happy
Everything great with the new system
initializing a new material prototype is so so so much easier as the material_handler automatically sorts all the rendering shenanigans
rendering is… I don’t even need to say it as it speaks for itself - it’s 1 line (don’t worry the rendering is still very customizable with the initializations prior to the game loop)