From: Florian P. S. <fsc...@te...> - 2009-02-22 12:28:45
|
Hi Jaime, Jaime Villarreal wrote: > Hi there, > > I'm really excited about trying out scgraph but I'm having trouble > getting started. I'm running Ubuntu Hardy 8.04. I've installed all the > dependencies from the ubuntu respositories and supercollider packages > from the http://ppa.launchpad.net/artfwo/ubuntu respository. > Supercollider running fine with jack. I followed the instructions in the > scgraph INSTALL file, compiled and installed scgraph, edited sclang.cfg > and made the extra directories. > > When I run scgraph in the terminal I get the following output. > > "scgraph > ScGraph - (C) 2006, 2007, 2008 > [Run scgraph -h for help] > [Warning]: fDefineBufGen not supported > [Warning]: fDefinePlugInCmd not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported > [Warning]: fDefineBufGen not supported" > This looks perfectly fine.. (since noone implemented buffer support yet, this warning is perfectly justified) > Now I'm a little confused here as to whether or not I need to leave > scgraph running in a terminal before I open gedit with the sced plugin > to evaluate sc3 code. Hmm, well yeah. You do need to have scgraph running to use it. You could also start it from within gedit using the String.unixCmd method. > I went ahead and did that but when I try to > evaluate the code that came with the help docs: > > "( > g = Server(\graphics, NetAddr("localhost", 37291)); > g.boot; > )" > > The scgraph running in a seperate terminal spits out the following: > > "[OscHandler]: Error while calling g_new (): [NodeTree]: Warning: Node > ID already exists!" This is fine. ScGraph creates this node per default. It really only is a warning.. > I ignored that and tried to evaluate the next piece of code. > > "( > SynthDef (\WobblingCube, { > var source; > source = GCube.gr(size: SinOsc.kr(freq: 0.5)); > GGLRenderer.gr(source); > }).play(target: g); > )" > > but scgraph spits out the following and crashes > > "[GGLRenderer]: Warning: shader objects extension missing > Segmentation fault" Well, it seems your 3D hardware [or driver] is missing support for the shader objects extension. I suppose the plugins/gl_renderer.h and plugins/gl_renderer.cc need to be updated for this (basically just some #ifdefs around some functions and lines). See below.. > Is it possible that scgraph was not compiled correctly? I noticed a lot > of warnings regarding the QT libraries in the make output. Could that be > the problem? Here is my makefile output: > http://libreyabierto.cc/files/scgraph_make_output.txt The build looks totally fine. I guess you are referring to these messages: --- Creating MOC output: culling.h => culling_moc.cc /usr/share/qt4/bin/moc -o culling_moc.cc culling.h culling.h:0: Warning: No relevant classes found. No output generated. --- Building plugin: culling.cc => culling.so g++ -I../glew/ -I../oscpack/ -DGLEW_MX -shared -fpic -L/usr/share/qt4/lib -lQtGui -lQtCore -lQtOpenGL -lQtUiTools -export-dynamic -rdynamic -ldl -o culling.so culling.cc culling_moc.cc -I/usr/share/qt4/include -DQT_THREAD_SUPPORT -L/usr/share/qt4/lib -lQtGui -lQtCore -lQtOpenGL -lQtUiTools -pthread --- Creating MOC output: transformation.h => transformation_moc.cc /usr/share/qt4/bin/moc -o transformation_moc.cc transformation.h transformation.h:0: Warning: No relevant classes found. No output generated. --- Building plugin: transformation.cc => transformation.so g++ -I../glew/ -I../oscpack/ -DGLEW_MX -shared -fpic -L/usr/share/qt4/lib -lQtGui -lQtCore -lQtOpenGL -lQtUiTools -export-dynamic -rdynamic -ldl -o transformation.so transformation.cc transformation_moc.cc -I/usr/share/qt4/include -DQT_THREAD_SUPPORT -L/usr/share/qt4/lib -lQtGui -lQtCore -lQtOpenGL -lQtUiTools -pthread The "Warning: No relevant classes found. No output generated." is just a warning and perfectly fine.. About the shader problem: Does this diff help (also attached)? Make sure, you do not have HAVE_SHADERS set to 1 in Makefile.include: Index: server/osc_handler.cc =================================================================== --- server/osc_handler.cc (revision 35) +++ server/osc_handler.cc (working copy) @@ -915,11 +915,11 @@ } // read number of values from stream - (*(arg++)).AsInt32 (); + int num_vals = (*(arg++)).AsInt32 (); //std::cout << control_name << std::endl; //std::cout << (*arg).TypeTag () << std::endl; - while (arg != message->ArgumentsEnd ()) + for (int i = 0;arg != message->ArgumentsEnd () && i < num_vals; ++i) { float control_value; Index: server/Makefile =================================================================== --- server/Makefile (revision 35) +++ server/Makefile (working copy) @@ -50,7 +50,7 @@ -include ../Makefile.include -export PREFIX INSTALL CP MV RM QT_COMPILE_FLAGS QT_LINK_FLAGS MOC SC3_HEADERS ADDITIONAL_COMPILE_FLAGS ADDITIONAL_LINK_FLAGS HAVE_JACK TARGET +export PREFIX INSTALL CP MV RM QT_COMPILE_FLAGS QT_LINK_FLAGS MOC SC3_HEADERS ADDITIONAL_COMPILE_FLAGS ADDITIONAL_LINK_FLAGS HAVE_JACK TARGET HAVE_SHADERS .PHONY: all Index: server/plugins/Makefile =================================================================== --- server/plugins/Makefile (revision 35) +++ server/plugins/Makefile (working copy) @@ -34,6 +34,11 @@ PLUGINS += freq_amp endif +ifeq ($(HAVE_SHADERS),1) + ADDITIONAL_COMPILE_FLAGS += -DHAVE_SHADERS +endif + + PLUGIN_DIRS = TARGET_DIR = $(PREFIX)/lib/scgraph/plugins Index: server/plugins/gl_renderer.cc =================================================================== --- server/plugins/gl_renderer.cc (revision 35) +++ server/plugins/gl_renderer.cc (working copy) @@ -72,6 +72,7 @@ /* Problem: glewInit failed, something is seriously wrong. */ fprintf(stderr, "Error: %s\n", glewGetErrorString(err)); } +#ifdef HAVE_SHADERS if (!GLEW_ARB_vertex_program) { std::cout << "[GGLRenderer]: Warning: vertex program extension missing" << std::endl; @@ -86,10 +87,12 @@ { std::cout << "[GGLRenderer]: Warning: shader objects extension missing" << std::endl; } - +#endif _renderer->change_textures(); +#ifdef HAVE_SHADERS _renderer->change_shader_programs(); +#endif //_shader_program = glCreateProgramObjectARB(); } @@ -231,6 +234,7 @@ void GLRenderer::compile_and_link_shader_program(unsigned int index, ShaderPool::ShaderProgram *s) { +#ifdef HAVE_SHADERS std::cout << "[GGLRenderer]: Compiling and linking shader program: " << index << std::endl; _gl_widget->makeCurrent(); @@ -300,26 +304,31 @@ std::cout << "[GGLRenderer]: Shader log:" << std::endl << log << std::endl << "[GGLRenderer]: Shader log end." << std::endl; glUseProgramObjectARB(0); +#endif } void GLRenderer::clear_shader_program(unsigned int index) { +#ifdef HAVE_SHADERS for (size_t j = 0; j < _shader_programs[index].second.size(); ++j) glDeleteObjectARB(_shader_programs[index].second[j]); glDeleteObjectARB(_shader_programs[index].first); - +#endif } void GLRenderer::setup_shader_programs() { +#ifdef HAVE_SHADERS ShaderPool *p = ShaderPool::get_instance(); for (ShaderPool::shader_programs_map_t::iterator it = p->_shader_programs.begin(); it != p->_shader_programs.end(); ++it) { compile_and_link_shader_program(it->first, it->second.get()); } +#endif } void GLRenderer::clear_shader_programs() { +#ifdef HAVE_SHADERS _gl_widget->makeCurrent(); for (shader_programs_map_t::iterator it = _shader_programs.begin(); it != _shader_programs.end(); ++it) @@ -328,11 +337,14 @@ } _shader_programs.clear(); +#endif } void GLRenderer::change_shader_programs () { +#ifdef HAVE_SHADERS clear_shader_programs(); setup_shader_programs(); +#endif } void GLRenderer::add_shader_program (unsigned int index) { @@ -662,6 +674,7 @@ void GLRenderer::visitShaderProgramConst (const ShaderProgram *s) { +#ifdef HAVE_SHADERS if (s->_on) { glUseProgramObjectARB(_shader_programs[s->_index].first); @@ -672,10 +685,12 @@ glUseProgramObjectARB(0); _current_shader_program = 0; } +#endif } void GLRenderer::visitShaderUniformConst (const ShaderUniform *s) { +#ifdef HAVE_SHADERS _gl_widget->makeCurrent(); //std::cout << "current shader program index: " << _current_shader_program << " uniform index: " << s->_uniform_index << std::endl; @@ -722,6 +737,7 @@ } // lookup attribute //GLint attribute = glGetAttribLocation(_shader_program[s->_index]first, _shader_programs[s->_index].second->_attributes +#endif } void GLRenderer::visitGeometryConst (const Geometry *g) Regards, Flo |