Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/sculpt_paint/paint_utils.c
| Show First 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| float paint_get_tex_pixel(const MTex *mtex, float u, float v, struct ImagePool *pool, int thread) | float paint_get_tex_pixel(const MTex *mtex, float u, float v, struct ImagePool *pool, int thread) | ||||
| { | { | ||||
| float intensity; | float intensity; | ||||
| float rgba_dummy[4]; | float rgba_dummy[4]; | ||||
| const float co[3] = {u, v, 0.0f}; | const float co[3] = {u, v, 0.0f}; | ||||
| RE_texture_evaluate(mtex, co, thread, pool, false, false, &intensity, rgba_dummy); | RE_texture_evaluate(mtex, co, thread, pool, &intensity, rgba_dummy); | ||||
| return intensity; | return intensity; | ||||
| } | } | ||||
| void paint_get_tex_pixel_col(const MTex *mtex, | void paint_get_tex_pixel_col(const MTex *mtex, | ||||
| float u, | float u, | ||||
| float v, | float v, | ||||
| float rgba[4], | float rgba[4], | ||||
| struct ImagePool *pool, | struct ImagePool *pool, | ||||
| int thread, | int thread, | ||||
| bool convert_to_linear, | bool convert_to_linear, | ||||
| struct ColorSpace *colorspace) | struct ColorSpace *colorspace) | ||||
| { | { | ||||
| const float co[3] = {u, v, 0.0f}; | const float co[3] = {u, v, 0.0f}; | ||||
| float intensity; | float intensity; | ||||
| const bool hasrgb = RE_texture_evaluate(mtex, co, thread, pool, false, false, &intensity, rgba); | const bool hasrgb = RE_texture_evaluate(mtex, co, thread, pool, &intensity, rgba); | ||||
| if (!hasrgb) { | if (!hasrgb) { | ||||
| rgba[0] = intensity; | rgba[0] = intensity; | ||||
| rgba[1] = intensity; | rgba[1] = intensity; | ||||
| rgba[2] = intensity; | rgba[2] = intensity; | ||||
| rgba[3] = 1.0f; | rgba[3] = 1.0f; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 595 Lines • Show Last 20 Lines | |||||