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:
authorTon Roosendaal <ton@blender.org>2006-05-28 16:30:09 +0400
committerTon Roosendaal <ton@blender.org>2006-05-28 16:30:09 +0400
commiteda218ecb44383e5f964ba80e6823315715b905a (patch)
treefc5bc7222e54f95e26ae15dea889695d33995eac /source/blender/yafray
parent2e901061d96845197f9b1f58bfe9569be74b7d2a (diff)
Step one in bringing back Yafray Render in Blender. Need someone else
to take over now, but I'm available for help. Main notes for completing: - Yafray module uses old global R all over... is now a pointer handle. It can be temporally bypassed by straight copying, which I do now. - I am not sure in what pixel format Yafray renders... Blender now only uses float buffers. In the code, marked with XXX I've added the rudimentary code for retrieving buffers. - This integration will skip compositing when Yafray render is used.
Diffstat (limited to 'source/blender/yafray')
-rwxr-xr-xsource/blender/yafray/intern/export_File.cpp7
-rw-r--r--source/blender/yafray/intern/export_Plugin.cpp11
2 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp
index d9124c902c2..dfd89eca722 100755
--- a/source/blender/yafray/intern/export_File.cpp
+++ b/source/blender/yafray/intern/export_File.cpp
@@ -289,6 +289,13 @@ void yafrayFileRender_t::displayImage()
unsigned int idlen = (unsigned int)header[0];
if (idlen) fseek(fp, idlen, SEEK_CUR);
+ /* XXX how to get the image from Blender and write to it. This call doesn't allow to change buffer rects */
+ RenderResult rres;
+ RE_GetResultImage(&R, &rres);
+ // rres.rectx, rres.recty is width/height
+ // rres.rectf is float buffer, scanlines starting in bottom
+ // rres.rectz is zbuffer, available when associated pass is set
+
// read data directly into buffer, picture is upside down
for (unsigned short y=0;y<height;y++) {
unsigned char* bpt = NULL; //(unsigned char*)R.rectot + ((((height-1)-y)*width)<<2);
diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp
index 26de34dd488..ab3c38cc795 100644
--- a/source/blender/yafray/intern/export_Plugin.cpp
+++ b/source/blender/yafray/intern/export_Plugin.cpp
@@ -274,8 +274,6 @@ void yafrayPluginRender_t::displayImage()
// although it is possible to load the image using blender,
// maybe it is best to just do a read here, for now the yafray output is always a raw tga anyway
- // rectot already freed in initrender
-// R.rectot = (unsigned int *)MEM_callocN(sizeof(int)*R.rectx*R.recty, "rectot");
FILE* fp = fopen(imgout.c_str(), "rb");
if (fp==NULL) {
@@ -292,6 +290,14 @@ void yafrayPluginRender_t::displayImage()
unsigned int idlen = (unsigned int)header[0];
if (idlen) fseek(fp, idlen, SEEK_CUR);
+ /* XXX how to get the image from Blender and write to it. This call doesn't allow to change buffer rects */
+ RenderResult rres;
+ RE_GetResultImage(&R, &rres);
+ // rres.rectx, rres.recty is width/height
+ // rres.rectf is float buffer, scanlines starting in bottom
+ // rres.rectz is zbuffer, available when associated pass is set
+
+
// read data directly into buffer, picture is upside down
for (unsigned short y=0;y<height;y++) {
unsigned char* bpt = NULL;//(unsigned char*)R.rectot + ((((height-1)-y)*width)<<2);
@@ -1948,6 +1954,7 @@ bool blenderYafrayOutput_t::putPixel(int x, int y, const yafray::color_t &c,
out++;
if (out==4096)
{
+ /* XXX second arg is rcti *rect, allows to indicate sub-rect in image to draw */
R.display_draw(R.result, NULL);
out = 0;
}