|
Blender
V2.59
|
00001 /* 00002 * $Id: sss.h 35233 2011-02-27 19:31:27Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * The Original Code is Copyright (C) 2007 Blender Foundation. 00021 * All rights reserved. 00022 * 00023 * The Original Code is: all of this file. 00024 * 00025 * Contributor(s): none yet. 00026 * 00027 * ***** END GPL LICENSE BLOCK ***** 00028 */ 00029 00035 #ifndef SSS_H 00036 #define SSS_H 00037 00038 /* Generic multiple scattering API */ 00039 00040 struct ScatterSettings; 00041 typedef struct ScatterSettings ScatterSettings; 00042 00043 struct ScatterTree; 00044 typedef struct ScatterTree ScatterTree; 00045 00046 ScatterSettings *scatter_settings_new(float refl, float radius, float ior, 00047 float reflfac, float frontweight, float backweight); 00048 void scatter_settings_free(ScatterSettings *ss); 00049 00050 ScatterTree *scatter_tree_new(ScatterSettings *ss[3], float scale, float error, 00051 float (*co)[3], float (*color)[3], float *area, int totpoint); 00052 void scatter_tree_build(ScatterTree *tree); 00053 void scatter_tree_sample(ScatterTree *tree, float *co, float *color); 00054 void scatter_tree_free(ScatterTree *tree); 00055 00056 /* Internal renderer API */ 00057 00058 struct Render; 00059 struct Material; 00060 struct VlakRen; 00061 00062 void make_sss_tree(struct Render *re); 00063 void sss_add_points(Render *re, float (*co)[3], float (*color)[3], float *area, int totpoint); 00064 void free_sss(struct Render *re); 00065 00066 int sample_sss(struct Render *re, struct Material *mat, float *co, float *col); 00067 int sss_pass_done(struct Render *re, struct Material *mat); 00068 00069 #endif /*SSS_H*/ 00070