From: Matthias Reitinger Date: 2009-03-09T16:28:12+09:00 Subject: Re: Ruby OpenGL Gears example that uses shiny and velvet GLSL shaders Michael Brooks wrote: > For your entertainment, I've created a modified version of the > original "gears.rb" OpenGL Ruby program (by Arto Bendiken) which > uses GLSL shaders to color the gears with velvet and shiny > materials. Thank you for providing it to the public! It runs perfectly on my linux box (GeForce Go 7600, Ubuntu 8.10, Ruby 1.8.7, ruby-opengl 0.60.0). I always toyed with the idea of writing a small GLSL shader development IDE in Ruby, maybe this will get me started after all ;-) One question though: > def get_shader_source(file_name)揃 > # Read all the text from the file and return it in the file_content variable. > file_content = '' > File.open(file_name) do |file| > while file_line = file.gets() > file_content += file_line > end > end > return(file_content) > end You know there is File.read, right? -Matthias -- Posted via http://www.ruby-forum.com/.