Skip to content

Commit

Permalink
Merge branch 'Development' into node-groups
Browse files Browse the repository at this point in the history
  • Loading branch information
pragma37 committed Nov 9, 2023
2 parents c1e1a08 + 537e911 commit f9a05cd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
10 changes: 5 additions & 5 deletions BlenderMalt/MaltLights.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ def sync_data(self, context):
light.spot_blend = self.spot_blend_angle / self.spot_angle

strength : bpy.props.FloatProperty(name='Strength', default=1,
options={'LIBRARY_EDITABLE'}, override={'LIBRARY_OVERRIDABLE'})
options={'LIBRARY_EDITABLE', 'ANIMATABLE'}, override={'LIBRARY_OVERRIDABLE'})

override_global_settings : bpy.props.BoolProperty(name='Override Global Settings', default=False,
options={'LIBRARY_EDITABLE'}, override={'LIBRARY_OVERRIDABLE'})
max_distance : bpy.props.FloatProperty(name='Max Distance', default=100,
options={'LIBRARY_EDITABLE'}, override={'LIBRARY_OVERRIDABLE'})
options={'LIBRARY_EDITABLE', 'ANIMATABLE'}, override={'LIBRARY_OVERRIDABLE'})

radius : bpy.props.FloatProperty(
name='Radius',
default=5,
update=sync_data,
options={'LIBRARY_EDITABLE'},
options={'LIBRARY_EDITABLE', 'ANIMATABLE'},
override={'LIBRARY_OVERRIDABLE'}
)
spot_angle : bpy.props.FloatProperty(
Expand All @@ -33,7 +33,7 @@ def sync_data(self, context):
min=0,
max=math.pi,
update=sync_data,
options={'LIBRARY_EDITABLE'},
options={'LIBRARY_EDITABLE', 'ANIMATABLE'},
override={'LIBRARY_OVERRIDABLE'}
)
spot_blend_angle : bpy.props.FloatProperty(
Expand All @@ -43,7 +43,7 @@ def sync_data(self, context):
min=0,
max=math.pi,
update=sync_data,
options={'LIBRARY_EDITABLE'},
options={'LIBRARY_EDITABLE', 'ANIMATABLE'},
override={'LIBRARY_OVERRIDABLE'}
)

Expand Down
11 changes: 10 additions & 1 deletion Malt/Shaders/Filters/Line.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ LineExpandOutput line_expand(vec2 uv, int max_width,
for(int y = -max_half_width; y <= max_half_width; y++)
{
vec2 offset = vec2(x,y);
float offset_length = length(offset);
float offset_length = length(offset) - 0.5;
vec2 offset_uv = uv + offset / resolution;

float offset_width = texture(line_width_texture, offset_uv)[line_width_channel] * line_width_scale;
Expand All @@ -293,6 +293,15 @@ LineExpandOutput line_expand(vec2 uv, int max_width,
float offset_line_depth = texture(depth_texture, offset_uv)[depth_channel];
float offset_line_ldepth = -depth_to_z(offset_line_depth);
uint offset_line_id = texture(id_texture, offset_uv)[id_channel];

if(offset_length <= 0 && offset_width <= 1.0)
{
offset_line_color.a *= offset_width;
}
else
{
offset_line_color.a *= clamp(offset_width / 2.0 - offset_length, 0.0, 1.0);
}

float alpha = offset_line_color.a;
float random_ldepth_offset = hash(vec4(offset, float(SAMPLE_COUNT), hash(uv).x)).x;
Expand Down

0 comments on commit f9a05cd

Please sign in to comment.