Skip to content

Commit

Permalink
[10.x.x][VFX] Remove some shader warnings (#3248)
Browse files Browse the repository at this point in the history
* Fix Event connected directly to Output Event (revival) #154

* Restore disabled 26_NonUnifomScale due to a wrong merge (need backport to 10.x.x)

* [HDRP] Fix debug view material (albedo/normal/...)

* Force ui update when shader might be reimported in StaticMeshOutput (#158)

* Don't create VFXGraph during import callbacks (#148)

* do not Create VFXGraph in import callbacks

* error when graph missing. Better test code for asset creation

* Select node on create (#166)

* Select node on create

* Fix for right click in block and add doesn't deselect clicked block

* fix for subgraph not being selected on drag and drop

* Select converted node/block after convert subgraph

* Fix for selection undo separate in some cases. Fixed flow anchor drag context selection.

* Fix for undo of add subgraph operator

* Dont flag dirty in vfxgraph is the model modified is a copy (#165)

* Added excludeFromTAA setting to VFX outputs

* Fix Custom Spawn serialization (#132)

* Fix case 1294180 : Error feedback throwing an error while changing capacity (#174)

* Fix Preset (with exclusion) (#177)

* Trick ExcludeFromPreset

Since this attribute is declared with "Inherited = false", we can't use it directly on VFXObject.
Extend the VFXInfo is valid to filter out preset.

* Fix missing ExcludeFromPreset for subgraph

* *Update changelog

* Fix 1276602 incorrect uchar pcache import (#129)

* Base Commit

* Updated Documentation with explicit limitations.

* Fixed incorrect Merge

* Add regression Test

* Removed Test as It can't handle Exceptions thrown in Custom Importers

* Fixed value divider

Co-authored-by: Thomas ICHÉ <peeweek@gmail.com>

* Update gradient test (#151)

* Update gradient test

* Update CHANGELOG.md

Co-authored-by: Julien Fryer <julienf@unity3d.com>

* Fix incorrect compilation condition for linux build (#184)

* Fix GPUEvent & SubGraph (#178)

* Fix SelectionHasCompleteSystems

Detect correctly if there are dependencies due to GPUEvent (or stripAttribute)

* Add allDependenciesIncludingNotCompilable in VFXData

This helper is usefull for UI + use it in SelectionHasCompleteSystems

* Add note without change the beahvior

* Remove debug ToArray()

* Sample Point Cache operator (#92)

* Fix Case 1223747 - NaN caused by normal bending (#181)

* [Subgraph] Prevent Pasting Context invalid subgraph (#191)

* Fix Mouse Event Binder in player (#175)

* Fix missing call to CreateVFXEventAttribute

OnValidate is only called in editor, in runtime, we should init cache data with OnEnable

* *Update changelog.md

* Vfx/docs/bugfixes (#188)

* Resolved 1272101

* Resolved 1264943

* Removed uncertainty around 'should'

* Resolved 1298031

* Added snippets file

* Resolved 1292127

* Fixed typos

* Resolved 1295296

Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>

* Update HDRP project assets

* Change VisualEffect inspector "Edit" button to "New" when no asset is set

* Spawn State documentation  (#195)

* Added Spawn State doc

* Fixed formatting

Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>

* Added what's new page and moved blocks out one level in the table of …

* backout update gradien test

* Update ref images + deactivate test 26

* update URP assets

* DEactivate test 32 + clean ribbon template vfx

* Fix 1290493 - Spaceship specific warnings (#176)

* Fix regression from #176

Co-authored-by: Paul Demeulenaere <pauld@unity3d.com>
Co-authored-by: Tristan Genevet <tristan@unity3d.com>
Co-authored-by: Gabriel de la Cruz <gabriel.delacruz@unity3d.com>
Co-authored-by: Thomas Iché <thomasi@unity3d.com>
Co-authored-by: Thomas ICHÉ <peeweek@gmail.com>
Co-authored-by: Ludovic Theobald <ludovic.theobald@unity3d.com>
Co-authored-by: Lewis Jordan <lewisjordan@unity3d.com>
Co-authored-by: Lewis Jordan <lewis.jordan@hotmail.co.uk>
Co-authored-by: sebastienlagarde <sebastien@unity3d.com>
  • Loading branch information
10 people committed Jan 23, 2021
1 parent 2765d2d commit 9f0e755
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ o.VFX_VARYING_METALLIC = metallic;
#elif HDRP_MATERIAL_TYPE_SPECULAR
#ifdef VFX_VARYING_SPECULAR
${VFXLoadParameter:{specularColor}}
o.VFX_VARYING_SPECULAR = specularColor;
o.VFX_VARYING_SPECULAR = specularColor.rgb;
#endif
#elif HDRP_MATERIAL_TYPE_TRANSLUCENT
#ifdef VFX_VARYING_THICKNESS
Expand All @@ -92,7 +92,7 @@ o.VFX_VARYING_EMISSIVESCALE = emissiveScale;
o.VFX_VARYING_EMISSIVE = attributes.color;
#elif HDRP_USE_ADDITIONAL_EMISSIVE_COLOR
${VFXLoadParameter:{emissiveColor}}
o.VFX_VARYING_EMISSIVE = emissiveColor;
o.VFX_VARYING_EMISSIVE = emissiveColor.rgb;
#endif
#endif
#if HDRP_USE_ADDITIONAL_BASE_COLOR
Expand Down
1 change: 1 addition & 0 deletions com.unity.visualeffectgraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Fix [Case 1223747](https://fogbugz.unity3d.com/f/cases/1223747/)
- Prevent pasting context within operator/block subgraph [Case 1235269](https://issuetracker.unity3d.com/product/unity/issues/guid/1235269/)
- VFXEventBinderBase throwing a null reference exception in runtime
- Fix [Case 1290493](https://fogbugz.unity3d.com/f/cases/1290493/#BugEvent.1072735759)

## [10.2.0] - 2020-10-19
### Added
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,44 @@
using System;
using System.Collections.Generic;
using UnityEngine;

namespace UnityEditor.VFX.Operator
{
[VFXInfo(category = "Math/Vector")]
class SafeNormalizationVariantProvider : VariantProvider
{
protected override sealed Dictionary<string, object[]> variants
{
get
{
return new Dictionary<string, object[]>
{
{ "safeNormalize", new object[]{true, false} }
};
}
}
}


[VFXInfo(category = "Math/Vector", variantProvider = typeof(SafeNormalizationVariantProvider))]
class Normalize : VFXOperatorNumericUniform
{
public class InputProperties
{
public Vector3 x = Vector3.one;
}

protected override sealed string operatorName { get { return "Normalize"; } }
[VFXSetting(VFXSettingAttribute.VisibleFlags.InInspector), SerializeField, Tooltip("Specifies if the operator should check if the vector to be normalized is a vero vector.")]
bool safeNormalize = false;


protected override sealed string operatorName { get {return safeNormalize ? "Safe Normalize" : "Normalize"; } }

protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
{
return new[] { VFXOperatorUtility.Normalize(inputExpression[0]) };
if(safeNormalize)
return new[] { VFXOperatorUtility.SafeNormalize(inputExpression[0]) };
else
return new[] { VFXOperatorUtility.Normalize(inputExpression[0]) };
}

protected override sealed ValidTypeRule typeFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ static class VFXOperatorUtility
public static readonly Dictionary<VFXValueType, VFXExpression> TauExpression = GenerateExpressionConstant(2.0f * Mathf.PI);
public static readonly Dictionary<VFXValueType, VFXExpression> E_NapierConstantExpression = GenerateExpressionConstant(Mathf.Exp(1));
public static readonly Dictionary<VFXValueType, VFXExpression> EpsilonExpression = GenerateExpressionConstant(1e-5f);
public static readonly Dictionary<VFXValueType, VFXExpression> EpsilonSqrExpression = GenerateExpressionConstant(1e-10f);


public enum Base
{
Expand Down Expand Up @@ -269,7 +271,7 @@ static public VFXExpression Normalize(VFXExpression v)
static public VFXExpression SafeNormalize(VFXExpression v)
{
var sqrDist = Dot(v,v);
var condition = new VFXExpressionCondition(VFXValueType.Float, VFXCondition.Equal, VFXOperatorUtility.ZeroExpression[VFXValueType.Float], sqrDist);
var condition = new VFXExpressionCondition(VFXValueType.Float, VFXCondition.Less, sqrDist, VFXOperatorUtility.EpsilonSqrExpression[VFXValueType.Float]);
return new VFXExpressionBranch(condition, VFXOperatorUtility.ZeroExpression[v.valueType], Normalize(v));
}

Expand Down

0 comments on commit 9f0e755

Please sign in to comment.