Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Curioni <maxime.curioni@gmail.com>2008-05-29 15:41:06 +0400
committerMaxime Curioni <maxime.curioni@gmail.com>2008-05-29 15:41:06 +0400
commitbe2b832db7652afe9a6ce9a05da7420d12ac8916 (patch)
treebd5ee58ad71abb37e8fe34a74fdf0fbd930a33ca /source/blender/freestyle/intern/app_blender
parentf3966dda4e0a03c16206cfbf176f222e13a784c1 (diff)
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.
Diffstat (limited to 'source/blender/freestyle/intern/app_blender')
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppCanvas.cpp1
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/AppGLWidget.h4
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/Controller.cpp12
-rw-r--r--source/blender/freestyle/intern/app_blender/api.cpp26
4 files changed, 8 insertions, 35 deletions
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; 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);