Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/particle.c
| Show First 20 Lines • Show All 4,303 Lines • ▼ Show 20 Lines | if (mtex && mtex->tex && mtex->mapto) { | ||||
| case TEXCO_PARTICLE: | case TEXCO_PARTICLE: | ||||
| /* texture coordinates in range [-1, 1] */ | /* texture coordinates in range [-1, 1] */ | ||||
| texvec[0] = 2.0f * (cfra - par->time) / (par->dietime - par->time) - 1.0f; | texvec[0] = 2.0f * (cfra - par->time) / (par->dietime - par->time) - 1.0f; | ||||
| texvec[1] = 0.0f; | texvec[1] = 0.0f; | ||||
| texvec[2] = 0.0f; | texvec[2] = 0.0f; | ||||
| break; | break; | ||||
| } | } | ||||
| RE_texture_evaluate(mtex, texvec, 0, NULL, false, false, &value, rgba); | RE_texture_evaluate(mtex, texvec, 0, NULL, &value, rgba); | ||||
| if ((event & mtex->mapto) & PAMAP_ROUGH) { | if ((event & mtex->mapto) & PAMAP_ROUGH) { | ||||
| ptex->rough1 = ptex->rough2 = ptex->roughe = texture_value_blend( | ptex->rough1 = ptex->rough2 = ptex->roughe = texture_value_blend( | ||||
| def, ptex->rough1, value, mtex->roughfac, blend); | def, ptex->rough1, value, mtex->roughfac, blend); | ||||
| } | } | ||||
| SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac); | SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac); | ||||
| SET_PARTICLE_TEXTURE(PAMAP_CLUMP, ptex->clump, mtex->clumpfac); | SET_PARTICLE_TEXTURE(PAMAP_CLUMP, ptex->clump, mtex->clumpfac); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | if (mtex && mtex->tex && mtex->mapto) { | ||||
| } | } | ||||
| else { | else { | ||||
| texvec[1] = 0.0f; | texvec[1] = 0.0f; | ||||
| } | } | ||||
| texvec[2] = 0.0f; | texvec[2] = 0.0f; | ||||
| break; | break; | ||||
| } | } | ||||
| RE_texture_evaluate(mtex, texvec, 0, NULL, false, false, &value, rgba); | RE_texture_evaluate(mtex, texvec, 0, NULL, &value, rgba); | ||||
| if ((event & mtex->mapto) & PAMAP_TIME) { | if ((event & mtex->mapto) & PAMAP_TIME) { | ||||
| /* the first time has to set the base value for time regardless of blend mode */ | /* the first time has to set the base value for time regardless of blend mode */ | ||||
| if ((setvars & PAMAP_TIME) == 0) { | if ((setvars & PAMAP_TIME) == 0) { | ||||
| int flip = (mtex->timefac < 0.0f); | int flip = (mtex->timefac < 0.0f); | ||||
| float timefac = fabsf(mtex->timefac); | float timefac = fabsf(mtex->timefac); | ||||
| ptex->time *= 1.0f - timefac; | ptex->time *= 1.0f - timefac; | ||||
| ptex->time += timefac * ((flip) ? 1.0f - value : value); | ptex->time += timefac * ((flip) ? 1.0f - value : value); | ||||
| ▲ Show 20 Lines • Show All 998 Lines • Show Last 20 Lines | |||||