Fixed lighting artifacts caused by untransformed normals, added 'Scene' for holding objects for rendering, added turn table models to menus using a scene, misc other changes.

This commit is contained in:
2020-03-23 11:48:32 -05:00
parent 18a62b81cc
commit 87fcc3a05c
14 changed files with 139 additions and 48 deletions

View File

@@ -9,6 +9,18 @@ class IMICFPS
@opengl_renderer = OpenGLRenderer.new
end
def preload_default_shaders
shaders = ["default"]
shaders.each do |shader|
Shader.new(
name: shader,
includes_dir: "shaders/include",
vertex: "shaders/vertex/#{shader}.glsl",
fragment: "shaders/fragment/#{shader}.glsl"
)
end
end
def draw(camera, lights, entities)
glViewport(0, 0, window.width, window.height)
glEnable(GL_DEPTH_TEST)