Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/sculpt_expand.c
| Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | static float sculpt_expand_falloff_value_vertex_get(SculptSession *ss, | ||||
| if (expand_cache->texture_distortion_strength == 0.0f) { | if (expand_cache->texture_distortion_strength == 0.0f) { | ||||
| return expand_cache->vert_falloff[v]; | return expand_cache->vert_falloff[v]; | ||||
| } | } | ||||
| if (!expand_cache->brush->mtex.tex) { | if (!expand_cache->brush->mtex.tex) { | ||||
| return expand_cache->vert_falloff[v]; | return expand_cache->vert_falloff[v]; | ||||
| } | } | ||||
| float rgba[4]; | float vertex_co[3]; | ||||
| const float *vertex_co = SCULPT_vertex_co_get(ss, v); | copy_v3_v3(vertex_co, SCULPT_vertex_co_get(ss, v)); | ||||
| const float avg = BKE_brush_sample_tex_3d( | float intensity; | ||||
| expand_cache->scene, expand_cache->brush, vertex_co, rgba, 0, ss->tex_pool); | BKE_brush_sample_tex_intensity( | ||||
| expand_cache->scene, expand_cache->brush, 1, &vertex_co, &intensity, 0, ss->tex_pool); | |||||
| const float distortion = (avg - 0.5f) * expand_cache->texture_distortion_strength * | const float distortion = (intensity - 0.5f) * expand_cache->texture_distortion_strength * | ||||
| expand_cache->max_vert_falloff; | expand_cache->max_vert_falloff; | ||||
| return expand_cache->vert_falloff[v] + distortion; | return expand_cache->vert_falloff[v] + distortion; | ||||
| } | } | ||||
| /** | /** | ||||
| * Returns the maximum valid falloff value stored in the falloff array, taking the maximum possible | * Returns the maximum valid falloff value stored in the falloff array, taking the maximum possible | ||||
| * texture distortion into account. | * texture distortion into account. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 2,081 Lines • Show Last 20 Lines | |||||