sjannuz
February 5th, 2008, 15:47
Here is a super stupid problem I cannot solve (Xsi 6.0 btw).
I have a light emitting caustic photons, then a cube0 and then cube1, all aligned, not overlapping.
The cubes are both caustic receivers and casters.
To both I assign the photon mat and vol shaders you find below.
The mat does just mi_photon_transparent, the vol returns miTRUE for cube0, and mi_store_photon_volume for cube1.
What happens here is that no photon ever reaches cube1 (not even its photon mat shader).
To be noticed that if I remove the photon vol from cube0, then they do, and get stored into cube1.
Any help is greatly appreciated.
Stefano
DLLEXPORT miBoolean sj_fake_sss_mat(miColor *result, miState *state, MatParameters *oParas)
{
miInteger id = *mi_eval_integer(&oParas->id); //cube id
if (state->type == miRAY_EYE)
{
mi_compute_volume_irradiance(result, state);
result->a = 1.0f;
return miTRUE;
}
if (id == 1)
id = id; //debugger pit stop, never gets here
return mi_photon_transparent(result, state);
}
DLLEXPORT miBoolean sj_fake_sss_vol(miColor *result, miState *state, VolParameters *oParas)
{
miInteger id = *mi_eval_integer(&oParas->id); //cube id
if (id == 0) //do nothing for cube 0, just go through
return miTRUE;
if (state->type == miPHOTON_TRANSPARENT) //cube 1, store the photon
{
//store it 0.1 units below the skin
state->point.x = state->org.x + state->dir.x * 0.1f;
state->point.y = state->org.y + state->dir.y * 0.1f;
state->point.z = state->org.z + state->dir.z * 0.1f;
mi_store_volume_photon(result, state);
}
return miTRUE;
}
I have a light emitting caustic photons, then a cube0 and then cube1, all aligned, not overlapping.
The cubes are both caustic receivers and casters.
To both I assign the photon mat and vol shaders you find below.
The mat does just mi_photon_transparent, the vol returns miTRUE for cube0, and mi_store_photon_volume for cube1.
What happens here is that no photon ever reaches cube1 (not even its photon mat shader).
To be noticed that if I remove the photon vol from cube0, then they do, and get stored into cube1.
Any help is greatly appreciated.
Stefano
DLLEXPORT miBoolean sj_fake_sss_mat(miColor *result, miState *state, MatParameters *oParas)
{
miInteger id = *mi_eval_integer(&oParas->id); //cube id
if (state->type == miRAY_EYE)
{
mi_compute_volume_irradiance(result, state);
result->a = 1.0f;
return miTRUE;
}
if (id == 1)
id = id; //debugger pit stop, never gets here
return mi_photon_transparent(result, state);
}
DLLEXPORT miBoolean sj_fake_sss_vol(miColor *result, miState *state, VolParameters *oParas)
{
miInteger id = *mi_eval_integer(&oParas->id); //cube id
if (id == 0) //do nothing for cube 0, just go through
return miTRUE;
if (state->type == miPHOTON_TRANSPARENT) //cube 1, store the photon
{
//store it 0.1 units below the skin
state->point.x = state->org.x + state->dir.x * 0.1f;
state->point.y = state->org.y + state->dir.y * 0.1f;
state->point.z = state->org.z + state->dir.z * 0.1f;
mi_store_volume_photon(result, state);
}
return miTRUE;
}