mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-16 08:02:36 +00:00
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:
@@ -13,7 +13,7 @@ class IMICFPS
|
||||
# @g_buffer.bind_for_writing
|
||||
gl_error?
|
||||
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
# glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
|
||||
|
||||
Shader.use("default") do |shader|
|
||||
lights.each_with_index do |light, i|
|
||||
@@ -42,7 +42,7 @@ class IMICFPS
|
||||
end
|
||||
end
|
||||
|
||||
# @g_buffer.unbind_framebuffer
|
||||
@g_buffer.unbind_framebuffer
|
||||
gl_error?
|
||||
else
|
||||
puts "Shader 'default' failed to compile, using immediate mode for rendering..." unless @@immediate_mode_warning
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user