Skip to content

Conversation

@cdxntchou
Copy link

@cdxntchou cdxntchou commented Apr 20, 2021

Purpose of this PR

Using the sample gradient node results in divide by zero warnings.

This PR fixes the warnings by properly looping over only the active keys.


Testing status

Tested gradient node with 2, 3, 5, 8 keys, checked generated code, visual result and shader warnings.

Yamato:

ShaderGraph PR Job: 🟢
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/sg%252Ffix-gradient-warnings/.yamato%252Fall-shadergraph.yml%2523PR_ShaderGraph_trunk/6472993/job/pipeline


Comments to reviewers

Notes for the reviewers you have assigned.

@cdxntchou cdxntchou marked this pull request as ready for review April 20, 2021 17:09
@cdxntchou cdxntchou requested a review from a team as a code owner April 20, 2021 17:09
@cdxntchou cdxntchou requested review from a user and julienf-unity April 20, 2021 17:09
@cdxntchou
Copy link
Author

cdxntchou commented Apr 20, 2021

@LandonTownsendUnity Do we need to backport this? Only a warning.. behavior is unchanged..

@cdxntchou cdxntchou closed this Apr 20, 2021
@cdxntchou cdxntchou reopened this Apr 20, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with both inline gradients and gradient properties, both in shadergraphs and subgraphs.

@cdxntchou cdxntchou requested review from marctem and removed request for elizabeth-legros April 22, 2021 16:29
@marctem
Copy link
Contributor

marctem commented Apr 28, 2021

Tests were green before changelog resolution.

@marctem marctem merged commit 70387af into master Apr 28, 2021
@marctem marctem deleted the sg/fix-gradient-warnings branch April 28, 2021 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants