Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MToon 1.0 functions. #1101

Merged
merged 8 commits into from
Jul 15, 2021
Merged

Fix MToon 1.0 functions. #1101

merged 8 commits into from
Jul 15, 2021

Conversation

Santarh
Copy link
Contributor

@Santarh Santarh commented Jul 15, 2021

  • Rename to VRM10/MToon10
  • Improve Inspector.
  • Fix Migration code & add tests.

@Santarh Santarh requested a review from ousttrue July 15, 2021 10:59

using (new LabelScope("Editor Settings"))
{
PopupEnum<MToon10EditorEditMode>("Edit Mode", props[MToon10Prop.EditorEditMode], materialEditor);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add Inspector mode

@@ -1,4 +1,4 @@
Shader "Hidden/VRM10/vrmc_materials_mtoon"
Shader "VRM10/MToon10"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rename

@@ -24,15 +24,16 @@ Varyings MToonVertex(const Attributes v) // v is UnityCG macro specified name.
const VertexPositionInfo position = MToon_GetOutlineVertex(v.vertex.xyz, normalize(v.normalOS), output.uv);
output.pos = position.positionCS;
output.positionWS = position.positionWS;
output.normalWS = UnityObjectToWorldNormal(-v.normalOS);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix outline normal

// new shadingShift is the center of range.
return Mathf.Clamp((rangeMax - rangeMin) * 0.5f, -1, +1);
// new shadingShift is the center of range inverted.
return Mathf.Clamp((rangeMax + rangeMin) * 0.5f * -1f, -1, +1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix migration

public sealed class MigrationTests
{
[Test]
public void MigrateToonyAndShift()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add migration tests

@ousttrue ousttrue merged commit 8266498 into vrm-c:master Jul 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants