}
}
+/* delivers a fully filled in ShadeResult, for all passes */
+void shade_volume_loop(ShadeInput *shi, ShadeResult *shr)
+{
+ if(R.r.mode & R_RAYTRACE) volume_trace(shi, shr);
+}
+
/* do a shade, finish up some passes, apply mist */
void shade_input_do_shade(ShadeInput *shi, ShadeResult *shr)
memcpy(&shi->r, &shi->mat->r, 23*sizeof(float));
shi->har= shi->mat->har;
- shade_material_loop(shi, shr);
+ if (shi->mat->material_type == MA_SOLID) shade_material_loop(shi, shr);
+ else if (shi->mat->material_type == MA_VOLUME) shade_volume_loop(shi, shr);
}
/* copy additional passes */
}
}
+ /* set camera coords - for scanline, it's always 0.0,0.0,0.0 (render is in camera space)
+ * however for raytrace it can be different - the position of the last intersection */
+ shi->camera_co[0] = shi->camera_co[1] = shi->camera_co[2] = 0.0f;
+
/* cannot normalize earlier, code above needs it at viewplane level */
Normalize(view);
}