soc-mx-curioni: resolved the rendering issue. In the previous steps, I was only rende...
authorMaxime Curioni <maxime.curioni@gmail.com>
Thu, 29 May 2008 11:41:06 +0000 (11:41 +0000)
committerMaxime Curioni <maxime.curioni@gmail.com>
Thu, 29 May 2008 11:41:06 +0000 (11:41 +0000)
source/blender/freestyle/intern/app_blender/AppCanvas.cpp
source/blender/freestyle/intern/app_blender/AppGLWidget.h
source/blender/freestyle/intern/app_blender/Controller.cpp
source/blender/freestyle/intern/app_blender/api.cpp
source/blender/render/intern/source/pipeline.c

index 98013cf18d43b6056de4ead07c0781ccabec693b..f82d136b525d64d6e105322fc743677eaf2344bc 100755 (executable)
@@ -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);
index eb233bfcb7de390d26c7e6a653b0020f82645edd..319fc248494412ffb4859d9f5cdf3e114600194e 100755 (executable)
@@ -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);
index bd234746e2b0c52ae202d2a930899cdc1ec6648e..8b494ff51089e78a28f053d7ad291b681e8816af 100755 (executable)
@@ -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() ) );
index 906522b059efef3782e599f24ba14884095a39f7..a021e30a6e5a17d7d9963e0befb76182d9410c06 100644 (file)
@@ -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; y<height; y++) {
-               //      float* bpt = (float*)rres.rectf + ((y*width) << 2);                     
-               //      for (unsigned short x=0; x<width; x++) {
-               //              float *pos = rgb + 3 * ( y*width + x );
-               //              
-               //              bpt[0] = pos[0]; // r
-               //              bpt[1] = pos[1]; // g
-               //              bpt[2] = pos[2]; // b
-               //              bpt[3] = 1.0; // a
-               //              bpt += 4;
-               //      }
-               // }
-               // 
-               
-               
+               view->readPixels(0,0,width,height,AppGLWidget::RGBA, rres.rectf );              
                re->result->renlay = render_get_active_layer(re, re->result);
                re->display_draw(re->result, NULL);
                
index d45dd77fe1ed242b1905113f0e0eb121e7934f1b..889981994527064ef9f9d8a41ae2fe3378fada42 100644 (file)
@@ -2194,7 +2194,7 @@ static void do_render_composite_fields_blur_3d(Render *re)
 static void freestyleRender(Render *re)
 {
        RE_FreeRenderResult(re->result);
-       re->result= new_render_result(re, &re->disprect, 0, RR_USEMEM);
+       re->result = new_render_result(re, &re->disprect, 0, RR_USEMEM);
        
        RE_SetCamera(re, re->scene->camera);