|
![](/i/fill.gif) |
hi,
in megapov 0.7, are the color channels FILTER and TRANSM correct in post
process functions ?
i m trying to write my simple post process, background_pigment, and i d like
to use either the filter channel either the transm channel.. So i first try
to replace pixel with a non zero filter channel with my pigment (see code),
but it doesn t seem to work fine, i just get one line where it s ok (i don t
know why just this line in the middle of my example..) . In atmosph.c i've
also commented out two lines in Do_Infinite_Atmosphere (colour[filter]=0..)
but it changes nothing. After this, i ve tried with the transm component,
but it only works in the background and only if +UA is set :(
here is the code for the post process and a pov example in case someone can
see my mistake.. thanks
void doPostBackgroundPigment(PP_TASK *pp_task, COLOUR **in, COLOUR **out,
PP_DATA_LISTS data, int height, int width)
{
int x,y;
PP_BACKGROUND_PIGMENT * Task;
COLOUR Weight;
VECTOR Loc;
Task = (PP_BACKGROUND_PIGMENT *)pp_task;
PP_STATUS_BEGIN("background_pigment")
for(y=0; y<height; y++)
{
PP_STATUS_PROGRESS("background_pigment")
COOPERATE_1
for(x=0; x<width; x++)
{
if (in[y][x][3])
{
Loc[0] = (DBL)x/width;
Loc[1] = (DBL)y/height;
Loc[2] = 0;
Compute_Pigment (Weight, Task->Pig, Loc, NULL);
out[y][x][0]=Weight[0];
out[y][x][1]=Weight[1];
out[y][x][2]=Weight[2];
out[y][x][3]=in[y][x][3];
out[y][x][4]=in[y][x][4];
}
else
{
out[y][x][0]=in[y][x][0];
out[y][x][1]=in[y][x][1];
out[y][x][2]=in[y][x][2];
out[y][x][3]=in[y][x][3];
out[y][x][4]=in[y][x][4];
}
}
}
PP_STATUS_END
}
#version unofficial MegaPov 0.7;
global_settings
{
ini_option "+A +UA"
post_process { background_pigment { checker color rgb 1 color rgb 0 scale
.1} }
}
background { color rgbft<0,0,0,1,1> }
camera { location <1,1, -6> look_at <0, 1, 0> }
plane { y, 0 pigment { color rgb <.9,.3,.7>}}
sphere { <1,1,0>, 1 pigment { color rgbft <.4,.5,.7,.4,0> }}
sphere { <-2,2,.4> , 1 pigment { color rgbft <.3,.5,.5,.2,0> }}
light_source { <10, 10, -10>, color rgb 1 }
Post a reply to this message
|
![](/i/fill.gif) |