Help appreciated: ribMosaic and Pixie, rendering occlusion etc

Thanks for the tips whiterabbit, but I must report failure,
Pixie doesn’t compile the bmrt shaders:

reflections.h(93) : error : Function rayserver not found
reflections.h(103) : error : Function rayserver not found

AH !
the that comes with pixie has reflection blurring.
gotta say, not fast… really slow actually.
I hope that is because I think this shader doesn’t use ray differentials…

What’s “ray differencials”?

from the website:
Pixie now has a new raytracing engine that automatically tesselates surfaces on the fly to a desired accuracy determined using the ray differentials. This means rays tracing blurry reflections or computing global illumination are faster to trace and sharp reflections and shadows are more accurate. Pixie also contains a memory manager that keeps the memory that is used to keep these tesselations around under control. Similar to texture caching, Pixie will maintain a set of active surfaces and only those surfaces will consume raytracing memory.

I think it’s like BI’s glossy engine where you can tell how long the rays can be, reducing raytrace overhead.
But really I’m just guessing…

From that I understand it as if the ray differentials are turned on as you pass “raytrace” to the “texname”, but then again… I could be wrong.

I think we can agree, we don’t know


I thought i found the answer in getting the raylength by invoking
rayinfo(“length”, rlength)


surface SB_mirror(float Ka=1,Ks=1,Kr=1,roughness=.1,samples=1,blur=0,raylength=1; string texname=“raytrace”) {

normal Nf;
N = normalize(N);
I = normalize(I);
uniform float rlength=0;

Nf = faceforward(N,I);
// raytrace will convert to worldspace, but non-raytrace
// environments should be looked up in world space
vector R = reflect(I,Nf);
if( texname != "raytrace" ) R = ntransform("world",R);

uniform float return_value=0;

if (raydepth() > 2) samples=0;
if (rlength < raylength) samples=0;
    Ci = Os * (Cs * ( Ka*ambient() + Ks*specular(Nf,-I,roughness) ) + Kr*environment(texname,R,"samples",samples,"blur",blur));
    Oi = Os;}

OK, now I realize I should probably invoke trace () instead of environment () for reflection and such. But I also found out that rayinfo(“length”,d) probably returns the length of the ray including the distance to the camera.

Can anybody give me a tip on where I should go to find this out ? You know, what is raytracing in renderman etc?
I leafed through the riSpec, but I’m very impatient, so I could’ve missed it.

RiSpec 3.2 table 12.1:
E - position of eye

calculate the distance between P and E if that’s what you need you should substract.

I don’t know if this helps but here is a example scene using:
Soft raytraced shadows, blurry reflections, refractions, and caustics with a texture and DOF. This is using standard shaders that work with Pixie (although I really don’t like the standard glass shader, I think Pixie can do ALOT better then that with a good shader). You will need the latests CVS to use the render passes in this scene!

Heres the blend:
Hope that helps at least a little (haven’t had a chance to study SL much so I can’t really help you there yet :o).

what do I need to do to get the CVS and to install it? is it documented?


WHiTeRaBBiT explained a bit about CVS usage in this post.

I requested some help on the pixie forums and george, one of the developers, really helped out, now I have a decaying mirror shader:
refdecay=1 means linear decay
refdecay=2 means quadratic decay etc

/////begin cut
surface plastic_decaymirror (float samples = 1;
float sampleangle = 0;string texturename = “”;
float refdecay=1, Ka=0.1,Kd=0.5,Ks=1,Kr=1,Kt=0,roughness=.1,maxDist=1;
color hitc = 0;
vector i = normalize(I);
normal n = normalize(N),
nf = faceforward(n,i);
color Ci_ref = 0;
float numhits=0;
point rorg;
vector rdir, hitpoint,nh;
float rlen,dmir;

if (texturename != “”)
Ci *= color texture (texturename);

if(n.-i >= 0)
vector reflectRay = reflect(i, n);

    gather("irradiance", P, reflectRay, 
      radians(sampleangle), samples,"ray:length",rlen,"ray:origin",rorg,"ray:direction",rdir, "surface:Ci", hitc, "maxdist",maxDist) 
    Ci_ref += hitc;

/* Calculate the average color /
Ci_ref /= samples;
Weigh by numhits /
Ci_ref = numhits/samples;
Ci = Cs
(( Ka
ambient()+Kd * diffuse(nf) + Ksspecular(nf,-i,roughness))+KrCi_ref) ;

Oi = Os;

/////end cut

really cool how you can tinker with the shader on such a basic level, here’s an example of the decaying reflection shader in action, the raytracing of the reflection is done with 1 (one) sample per ray, normal blurred reflection (like BI’s) needs at least 32:

I reported the strange white line in the corners as an occlusion error already.

Very cool, I’ve been watching your progress in Pixie’s forums!
Hopefully we all can find ways to speed up and improve some of these shaders,
many show potential but have weird flaws and others look good but are really slooowww!!!
Your making me jealous I haven’t had a chance to study much SL yet :wink:

Dude, I’ve got not time either, I got a blender/ribmosaic window hidden under all the others.
I just want to know, i get like that sometimes. it’s making me nervous, b/c i need to concentrate on other things and not tweaking sl =)
arf, it’ll pay off someday.

btw i noticed that linked texture slots and such in ribMosaic’s ss_myshader give an error on render time, bug or feature ?

I would need to see the “ss_myshader” code and maybe the console output to know. I did just update the CVS last night with a new texture system if your using it yet. Also the “Generate Shader Fragment” utility is currently not working right but I’ll be working on it tonight (I’ll be adding a interface for editing shader parameters and tokens from MOSAIC!).
CVS MOSAIC can now use sequence textures but it handles images a little differently then before. All images that are not packed are copied to the export folder and optimized, any packed images are exported straight out of Blender to the export folder. The textures paths must be absolute or it will not be able to find them (default for paths I believe is relative in windows). This will mean changes to textures in Blender will need to be saved before export unless there packed.

Updated CVS, add pixie’s paintedpplastic shader:

Surface “paintedplastic”
“uniform string texturename” <MatImageName_XText_S>
“uniform color specularcolor” <MatSpecCol_C>
“uniform float roughness” [ 0.1 ]
“uniform float Ks” <MatSpec_M1.0_A0.0_F>
“uniform float Kd” <MatDiffuseSize_M1.0_A0.0_F>
“uniform float Ka” <MatAmb_M1.0_A0.0_F>

This is the error:

ERROR: Invalid token parameter “XText” in <MatImageName_XText_S> using defaults
ERROR: Check spelling or type for token <MatImageName_XText_S>
ERROR: 1 error/s in fragment “ss_paintedplastic” on line 2


Sorry, thats my bad :o
The “Create Shader Fragment” utility is freaking out, I’ll have it fixed tonight (when I get off work). In the mean time replace “Text” in “<MatImageName_XText_S>” with the texture slot you want to use such as “<MatImageName_X1_S>” for slot 1. I broke the utility getting it ready for the new interface changes and hadn’t had a chance to correct it, will be better thou when its all done :yes:

Released an update to the CVS that fixes this problem and adds a bunch of new features see here for details