From be2b832db7652afe9a6ce9a05da7420d12ac8916 Mon Sep 17 00:00:00 2001 From: Maxime Curioni Date: Thu, 29 May 2008 11:41:06 +0000 Subject: soc-mx-curioni: resolved the rendering issue. In the previous steps, I was only rendering the strokes, not the toatl scene (explaining why the render color was being inverted). i added a call to the view's draw() method. Now, the rendering steps are complete and display both the object and the silhouette. --- .../freestyle/intern/app_blender/AppCanvas.cpp | 1 + .../freestyle/intern/app_blender/AppGLWidget.h | 4 +++- .../freestyle/intern/app_blender/Controller.cpp | 12 ---------- .../blender/freestyle/intern/app_blender/api.cpp | 26 ++++------------------ 4 files changed, 8 insertions(+), 35 deletions(-) (limited to 'source/blender/freestyle/intern/app_blender') diff --git a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp index 98013cf18d4..f82d136b525 100755 --- a/source/blender/freestyle/intern/app_blender/AppCanvas.cpp +++ b/source/blender/freestyle/intern/app_blender/AppCanvas.cpp @@ -306,6 +306,7 @@ void AppCanvas::Render(const StrokeRenderer *iRenderer) glBlendFunc(GL_SRC_ALPHA, GL_ONE); glEnable(GL_TEXTURE_2D); + Canvas::Render(iRenderer); // glPushAttrib(GL_COLOR_BUFFER_BIT); diff --git a/source/blender/freestyle/intern/app_blender/AppGLWidget.h b/source/blender/freestyle/intern/app_blender/AppGLWidget.h index eb233bfcb7d..319fc248494 100755 --- a/source/blender/freestyle/intern/app_blender/AppGLWidget.h +++ b/source/blender/freestyle/intern/app_blender/AppGLWidget.h @@ -435,9 +435,11 @@ public: static void setBackBufferFlag(bool iBool); static bool getBackBufferFlag(); +public: + virtual void draw(); + protected: virtual void init(); - virtual void draw(); /*! Loads an envmap */ void LoadEnvMap(const char *filename); diff --git a/source/blender/freestyle/intern/app_blender/Controller.cpp b/source/blender/freestyle/intern/app_blender/Controller.cpp index bd234746e2b..8b494ff5108 100755 --- a/source/blender/freestyle/intern/app_blender/Controller.cpp +++ b/source/blender/freestyle/intern/app_blender/Controller.cpp @@ -1063,18 +1063,6 @@ void Controller::init_options(){ Config::Path * cpath = Config::Path::getInstance(); - // const string& getProjectDir() const {return _ProjectDir;} - // const string& getModelsPath() const {return _ModelsPath;} - // const string& getPatternsPath() const {return _PatternsPath;} - // const string& getBrushesPath() const {return _BrushesPath;} - // const string& getPythonPath() const {return _PythonPath;} - // const string& getBrowserCmd() const {return _BrowserCmd;} - // const string& getHelpIndexpath() const {return _HelpIndexPath;} - // const string& getPapersDir() const {return _PapersDir;} - // const string& getEnvMapDir() const {return _EnvMapDir;} - // const string& getMapsDir() const {return _MapsDir;} - // const string& getHomeDir() const {return _HomeDir;} - // Directories ViewMapIO::Options::setModelsPath( StringUtils::toAscii( cpath->getModelsPath() ) ); PythonInterpreter::Options::setPythonPath( StringUtils::toAscii( cpath->getPythonPath() ) ); diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp index 906522b059e..a021e30a6e5 100644 --- a/source/blender/freestyle/intern/app_blender/api.cpp +++ b/source/blender/freestyle/intern/app_blender/api.cpp @@ -44,30 +44,12 @@ extern "C" { c->toggleLayer(0, true); c->ComputeViewMap(); - c->DrawStrokes(); - + c->DrawStrokes(); // build strokes + view->draw(); // render final result + RenderResult rres; RE_GetResultImage(re, &rres); - view->readPixels(0,0,width,height,AppGLWidget::RGBA, rres.rectf ); - - // float *rgb = new float[3*width*height]; - // view->readPixels(0,0,width,height,AppGLWidget::RGB, rgb); - // - // for (unsigned short y=0; yreadPixels(0,0,width,height,AppGLWidget::RGBA, rres.rectf ); re->result->renlay = render_get_active_layer(re, re->result); re->display_draw(re->result, NULL); -- cgit v1.2.3