Skip to content

Commit

Permalink
fix substract blending and preview size
Browse files Browse the repository at this point in the history
  • Loading branch information
w1n7er87 committed Dec 14, 2023
1 parent 51161b5 commit 51e15ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ public class VFXComponentImagePreview : PropertyDrawer

public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
{
// TODO: this is not ideal
if (property.propertyType != SerializedPropertyType.ObjectReference) return;
image = (Texture) property.objectReferenceValue;
GUIStyle style = new(EditorStyles.label);
style.alignment = TextAnchor.UpperCenter;
GUILayout.Box(image, style);
if (!image) return;

GUIStyle style = new(EditorStyles.label)
{
alignment = TextAnchor.UpperCenter,
};
GUILayout.Label(image, style, GUILayout.MaxHeight(200f));
}
}
}
2 changes: 1 addition & 1 deletion Unity/Assets/Mod/VFX/Color Tint/ColorTint_shader.shader
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
fixed4 frag (v2f i) : SV_Target
{
fixed4 col = tex2D(_MainTex, i.uv);
return lerp(col, _Color - col, _Color.w);
return half4(lerp(col.rgb, col.rgb - _Color.rgb, _Color.w), col.a);
}
ENDCG
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@

fixed4 col = tex2D(_MainTex, i.uv);

return lerp(col, col - image, image.w * _Strength);
return half4(lerp(col.rgb, col.rgb - image.rgb, image.w * _Strength), col.a);
}
ENDCG
}
Expand Down

0 comments on commit 51e15ef

Please sign in to comment.