Changeset View
Changeset View
Standalone View
Standalone View
source/blender/render/intern/source/shadeinput.c
| Show First 20 Lines • Show All 262 Lines • ▼ Show 20 Lines | void shade_input_set_triangle_i(ShadeInput *shi, ObjectInstanceRen *obi, VlakRen *vlr, short i1, short i2, short i3) | ||||
| shi->v2 = vpp[i2]; | shi->v2 = vpp[i2]; | ||||
| shi->v3 = vpp[i3]; | shi->v3 = vpp[i3]; | ||||
| shi->i1 = i1; | shi->i1 = i1; | ||||
| shi->i2 = i2; | shi->i2 = i2; | ||||
| shi->i3 = i3; | shi->i3 = i3; | ||||
| /* note, shi->mat is set in node shaders */ | /* note, shi->mat is set in node shaders */ | ||||
| shi->mat = shi->mat_override ? shi->mat_override : vlr->mat; | shi->mat = vlr->mat; | ||||
| shi->osatex = (shi->mat->texco & TEXCO_OSA); | shi->osatex = (shi->mat->texco & TEXCO_OSA); | ||||
| shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ | shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ | ||||
| shi->mode2 = shi->mat->mode2_l; | shi->mode2 = shi->mat->mode2_l; | ||||
| /* facenormal copy, can get flipped */ | /* facenormal copy, can get flipped */ | ||||
| shi->flippednor = 0; | shi->flippednor = 0; | ||||
| RE_vlakren_get_normal(&R, obi, vlr, shi->facenor); | RE_vlakren_get_normal(&R, obi, vlr, shi->facenor); | ||||
| Show All 40 Lines | void shade_input_copy_triangle(ShadeInput *shi, ShadeInput *from) | ||||
| /* not so nice, but works... warning is in RE_shader_ext.h */ | /* not so nice, but works... warning is in RE_shader_ext.h */ | ||||
| memcpy(shi, from, sizeof(struct ShadeInputCopy)); | memcpy(shi, from, sizeof(struct ShadeInputCopy)); | ||||
| } | } | ||||
| /* copy data from strand to shadeinput */ | /* copy data from strand to shadeinput */ | ||||
| void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spoint) | void shade_input_set_strand(ShadeInput *shi, StrandRen *strand, StrandPoint *spoint) | ||||
| { | { | ||||
| /* note, shi->mat is set in node shaders */ | /* note, shi->mat is set in node shaders */ | ||||
| shi->mat = shi->mat_override ? shi->mat_override : strand->buffer->ma; | shi->mat = strand->buffer->ma; | ||||
| shi->osatex = (shi->mat->texco & TEXCO_OSA); | shi->osatex = (shi->mat->texco & TEXCO_OSA); | ||||
| shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ | shi->mode = shi->mat->mode_l; /* or-ed result for all nodes */ | ||||
| /* shade_input_set_viewco equivalent */ | /* shade_input_set_viewco equivalent */ | ||||
| copy_v3_v3(shi->co, spoint->co); | copy_v3_v3(shi->co, spoint->co); | ||||
| copy_v3_v3(shi->view, shi->co); | copy_v3_v3(shi->view, shi->co); | ||||
| normalize_v3(shi->view); | normalize_v3(shi->view); | ||||
| ▲ Show 20 Lines • Show All 958 Lines • ▼ Show 20 Lines | void shade_input_initialize(ShadeInput *shi, RenderPart *pa, RenderLayer *rl, int sample) | ||||
| shi->sample = sample; | shi->sample = sample; | ||||
| shi->thread = pa->thread; | shi->thread = pa->thread; | ||||
| shi->do_preview = (R.r.scemode & R_MATNODE_PREVIEW) != 0; | shi->do_preview = (R.r.scemode & R_MATNODE_PREVIEW) != 0; | ||||
| shi->do_manage = BKE_scene_check_color_management_enabled(R.scene); | shi->do_manage = BKE_scene_check_color_management_enabled(R.scene); | ||||
| shi->use_world_space_shading = BKE_scene_use_world_space_shading(R.scene); | shi->use_world_space_shading = BKE_scene_use_world_space_shading(R.scene); | ||||
| shi->lay = rl->lay; | shi->lay = (1 << 20) - 1; | ||||
| shi->layflag = rl->layflag; | shi->layflag = rl->layflag; | ||||
| shi->passflag = rl->passflag; | shi->passflag = rl->passflag; | ||||
| shi->combinedflag = ~rl->pass_xor; | shi->combinedflag = ~rl->pass_xor; | ||||
| shi->mat_override = rl->mat_override; | |||||
| shi->light_override = rl->light_override; | |||||
| // shi->rl= rl; | // shi->rl= rl; | ||||
| /* note shi.depth==0 means first hit, not raytracing */ | /* note shi.depth==0 means first hit, not raytracing */ | ||||
| } | } | ||||
| /* initialize per part, not per pixel! */ | /* initialize per part, not per pixel! */ | ||||
| void shade_sample_initialize(ShadeSample *ssamp, RenderPart *pa, RenderLayer *rl) | void shade_sample_initialize(ShadeSample *ssamp, RenderPart *pa, RenderLayer *rl) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||