Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/gpencil/shaders/gpencil_common_lib.glsl
| Show First 20 Lines • Show All 321 Lines • ▼ Show 20 Lines | vec2 safe_normalize_len(vec2 v, out float len) | ||||
| } | } | ||||
| else { | else { | ||||
| return vec2(1.0, 0.0); | return vec2(1.0, 0.0); | ||||
| } | } | ||||
| } | } | ||||
| float stroke_thickness_modulate(float thickness) | float stroke_thickness_modulate(float thickness) | ||||
| { | { | ||||
| /* Modify stroke thickness by object and layer factors.-*/ | /* Modify stroke thickness by object and layer factors. */ | ||||
| thickness *= thicknessScale; | thickness *= thicknessScale; | ||||
| thickness += thicknessOffset; | thickness += thicknessOffset; | ||||
| thickness = max(1.0, thickness); | thickness = max(1.0, thickness); | ||||
| if (thicknessIsScreenSpace) { | if (thicknessIsScreenSpace) { | ||||
| /* Multiply offset by view Z so that offset is constant in screenspace. | /* Multiply offset by view Z so that offset is constant in screenspace. | ||||
| * (e.i: does not change with the distance to camera) */ | * (e.i: does not change with the distance to camera) */ | ||||
| thickness *= gl_Position.w; | thickness *= gl_Position.w; | ||||
| ▲ Show 20 Lines • Show All 315 Lines • Show Last 20 Lines | |||||