[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15047] branches/soc-2008-mxcurioni/source /blender: soc-mx-curioni: resolved the rendering issue.
Maxime Curioni
maxime.curioni at gmail.com
Thu May 29 13:41:06 CEST 2008
Revision: 15047
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15047
Author: mxcurioni
Date: 2008-05-29 13:41:06 +0200 (Thu, 29 May 2008)
Log Message:
-----------
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.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget.h
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp
branches/soc-2008-mxcurioni/source/blender/render/intern/source/pipeline.c
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp 2008-05-29 10:51:10 UTC (rev 15046)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppCanvas.cpp 2008-05-29 11:41:06 UTC (rev 15047)
@@ -306,6 +306,7 @@
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glEnable(GL_TEXTURE_2D);
+
Canvas::Render(iRenderer);
//
glPushAttrib(GL_COLOR_BUFFER_BIT);
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget.h 2008-05-29 10:51:10 UTC (rev 15046)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/AppGLWidget.h 2008-05-29 11:41:06 UTC (rev 15047)
@@ -435,9 +435,11 @@
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);
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp 2008-05-29 10:51:10 UTC (rev 15046)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/Controller.cpp 2008-05-29 11:41:06 UTC (rev 15047)
@@ -1063,18 +1063,6 @@
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() ) );
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp 2008-05-29 10:51:10 UTC (rev 15046)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/app_blender/api.cpp 2008-05-29 11:41:06 UTC (rev 15047)
@@ -44,30 +44,12 @@
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);
Modified: branches/soc-2008-mxcurioni/source/blender/render/intern/source/pipeline.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/render/intern/source/pipeline.c 2008-05-29 10:51:10 UTC (rev 15046)
+++ branches/soc-2008-mxcurioni/source/blender/render/intern/source/pipeline.c 2008-05-29 11:41:06 UTC (rev 15047)
@@ -2194,7 +2194,7 @@
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);
More information about the Bf-blender-cvs
mailing list