JacksonHoggard / voodoo2d

👹 2D Java Game Engine built in OpenGL
MIT License
131 stars 50 forks source link

Abstract Shaders #25

Closed JacksonHoggard closed 8 months ago

JacksonHoggard commented 2 years ago

Describe the feature you'd like Currently shaders are hardcoded. Add a feature to pass in custom abstract glsl shaders, possibly even write a custom shader language that compiles into glsl code.

Additional context Helpful Resources: https://stackoverflow.com/a/14163354/17696183 https://learnopengl.com/Getting-started/Shaders

Yash-Punia commented 1 year ago

Hey @JacksonHoggard, I think the abstract shader feature will require a lot of code changes, there should be a separate shader class which can be then included in GameObject and should be removed from Renderer class. What do you think?

JacksonHoggard commented 1 year ago

Definitely agree with you. The entire Renderer class is going to have to be rewritten anyways if it is going to implement batched rendering as well. The Shader class should have been implemented in the first place to avoid the massive code refactoring, but better late than never. Right now the shader for every gameobject is hardcoded, this is bad practice and will be removed once the code refactoring is complete and the Shader class written.