On the command line:
texmake tmp.tif tmp_baked.tif
In the Rib:
MakeTexture "tmp.tif" "tmp_baked.tif" "periodic" "periodic" "sinc" 2 2
You can also specify the filters, wrapping behavior and the filter size for texmake as command line arguments. Notice that you can also bake shadow - environment maps the same way.
Okan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The easiest way is to use the technique described by Larry Gritz in "A Recipe for Texture Baking". You can download the SIGGRAPH paper from renderman.org. If you need help with this I can gove you a compiled version of the bake.dso for WIndows and/or Linux.
ZJ's approach (or rather the on from the ILM paper "The RenderMan EasyBake Oven") doesn't work under all circumstances. NURBS are a case that works, but with subdivs as there's no reverse mapping for certain uv configurations -- you need to use the approach from Larry instead -- it always works.
Preferrably you need to set
Attribute "dice" "rasterorient" [ 0 ]
I dunno if Pixie supports non-rasteroriented dicing though.
Also make sure that
Sides 2
is set for the primitives the bake shadeop is run on.
Finally be aware of the odds 'n ends of this process (read the paper toroughly), e.g. you can't call faceforward(N) in a bake pass for illumination data as this would result in wrong normals on the back sides of objects..
Cheers,
Moritz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The Larry Gritz technique is good but it work only compiling the bake.c and using a particular approch for shading and scene. I'm not a programmer :-/
Has someone tested it with PIXIE? it is possible to take advantage of pixiewiki.
A question to Okan:
Is it possible to integrate this baking code to PIXIE?
Cheers,
Max
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But you'll need a compiler. What platform are you using?
If it's linux, do the following:
g++ -shared -o bake.so bake.c
or for VC6 on Windows:
cl -LD bake.c
Then include bake() in your SL code, allong the lines of the 'expensive' shader in the siggraph notes.
When you compile the shader, you'll need to use
sdrc -I <path to the bake binary> shader.sl
When rendering, ensure the bake.so or bake.dll is in somewhere accessible by pixie, or add to the proceduralpath to include that location eg.
Option "searchpath" "procedural" "<path to bake binary>:%PROCEDURALS%"
Feel free to use the wiki - just create a login as described on the front page.
You're right, one downside to this technique is that you need to write your shaders to allow baking. This can be done as in the siggraph paper, or using a preprocessor define:
#ifdef BAKEME
//use bake()
#else
//normal
#endif
and recompile your shaders for the bake pass using
sdrc -DBAKEME ...
Cheers
George
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi George,
i have seen the instructions at PixieWiki but i'm not a programmer.
In fact i don't have MS VC++ :-/ My platform for Pixie is actually Windows.
It's possible to compile bake.c with an Open Source C++?
Do you consider to implement the baking technique in the render engine using a simply command-line (rndr -bake)?
Thanks,
Max
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello everyone!
How to bake textures with standard PIXIE?
How can i do that?
All the best,
Max
Hi Max,
On the command line:
texmake tmp.tif tmp_baked.tif
In the Rib:
MakeTexture "tmp.tif" "tmp_baked.tif" "periodic" "periodic" "sinc" 2 2
You can also specify the filters, wrapping behavior and the filter size for texmake as command line arguments. Notice that you can also bake shadow - environment maps the same way.
Okan
Hi Okan,
the MakeTexture statement is used to convert a bitmap TIFF to Renderman TextureMap.
I'm refer to baking illumination technique:
http://www.zjprogramming.com/html/RenderMan_Bake.html
Where am i going wrong?
Max
The easiest way is to use the technique described by Larry Gritz in "A Recipe for Texture Baking". You can download the SIGGRAPH paper from renderman.org. If you need help with this I can gove you a compiled version of the bake.dso for WIndows and/or Linux.
ZJ's approach (or rather the on from the ILM paper "The RenderMan EasyBake Oven") doesn't work under all circumstances. NURBS are a case that works, but with subdivs as there's no reverse mapping for certain uv configurations -- you need to use the approach from Larry instead -- it always works.
Preferrably you need to set
Attribute "dice" "rasterorient" [ 0 ]
I dunno if Pixie supports non-rasteroriented dicing though.
Also make sure that
Sides 2
is set for the primitives the bake shadeop is run on.
Finally be aware of the odds 'n ends of this process (read the paper toroughly), e.g. you can't call faceforward(N) in a bake pass for illumination data as this would result in wrong normals on the back sides of objects..
Cheers,
Moritz
The Larry Gritz technique is good but it work only compiling the bake.c and using a particular approch for shading and scene. I'm not a programmer :-/
Has someone tested it with PIXIE? it is possible to take advantage of pixiewiki.
A question to Okan:
Is it possible to integrate this baking code to PIXIE?
Cheers,
Max
Hi Max,
There's basic instructions at:
http://www.george-graphics.co.uk/pixiewiki/cgi-bin/wiki.pl?UserDSOExamples
But you'll need a compiler. What platform are you using?
If it's linux, do the following:
g++ -shared -o bake.so bake.c
or for VC6 on Windows:
cl -LD bake.c
Then include bake() in your SL code, allong the lines of the 'expensive' shader in the siggraph notes.
When you compile the shader, you'll need to use
sdrc -I <path to the bake binary> shader.sl
When rendering, ensure the bake.so or bake.dll is in somewhere accessible by pixie, or add to the proceduralpath to include that location eg.
Option "searchpath" "procedural" "<path to bake binary>:%PROCEDURALS%"
Feel free to use the wiki - just create a login as described on the front page.
You're right, one downside to this technique is that you need to write your shaders to allow baking. This can be done as in the siggraph paper, or using a preprocessor define:
#ifdef BAKEME
//use bake()
#else
//normal
#endif
and recompile your shaders for the bake pass using
sdrc -DBAKEME ...
Cheers
George
Hi George,
i have seen the instructions at PixieWiki but i'm not a programmer.
In fact i don't have MS VC++ :-/ My platform for Pixie is actually Windows.
It's possible to compile bake.c with an Open Source C++?
Do you consider to implement the baking technique in the render engine using a simply command-line (rndr -bake)?
Thanks,
Max