Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Show First 20 Lines • Show All 421 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void vec_math_sub(vec3 v1, vec3 v2, out vec3 outvec, out float outval) | void vec_math_sub(vec3 v1, vec3 v2, out vec3 outvec, out float outval) | ||||
| { | { | ||||
| outvec = v1 - v2; | outvec = v1 - v2; | ||||
| outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2])) * 0.333333; | outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2])) * 0.333333; | ||||
| } | } | ||||
| void vec_math_multiply(vec3 v1, vec3 v2, out vec3 outvec, out float outval) | |||||
| { | |||||
| outvec = v1 * v2; | |||||
| outval = (abs(outvec[0]) + abs(outvec[1]) + abs(outvec[2])) * 0.333333; | |||||
| } | |||||
| void vec_math_average(vec3 v1, vec3 v2, out vec3 outvec, out float outval) | void vec_math_average(vec3 v1, vec3 v2, out vec3 outvec, out float outval) | ||||
| { | { | ||||
| outvec = v1 + v2; | outvec = v1 + v2; | ||||
| outval = length(outvec); | outval = length(outvec); | ||||
| outvec = normalize(outvec); | outvec = normalize(outvec); | ||||
| } | } | ||||
| void vec_math_mix(float strength, vec3 v1, vec3 v2, out vec3 outvec) | void vec_math_mix(float strength, vec3 v1, vec3 v2, out vec3 outvec) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 2,549 Lines • Show Last 20 Lines | |||||