Skip to content

Commit

Permalink
Merge pull request #487 from 0b5vr/isbinary-override
Browse files Browse the repository at this point in the history
wip feat: expressions, clarify the behavior when isBinary and override interacts each other
  • Loading branch information
0b5vr authored Oct 21, 2024
2 parents 55579e5 + de9453c commit 2fae173
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
18 changes: 17 additions & 1 deletion specification/VRMC_vrm-1.0/expressions.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ Expression は、
- [その他](#%E3%81%9D%E3%81%AE%E4%BB%96)
- [Custom Expressions](#custom-expressions)
- [プロシージャルのオーバーライド](#%E3%83%97%E3%83%AD%E3%82%B7%E3%83%BC%E3%82%B8%E3%83%A3%E3%83%AB%E3%81%AE%E3%82%AA%E3%83%BC%E3%83%90%E3%83%BC%E3%83%A9%E3%82%A4%E3%83%89)
- [オーバーライドとisBinaryの相互作用について](#%E3%82%AA%E3%83%BC%E3%83%90%E3%83%BC%E3%83%A9%E3%82%A4%E3%83%89%E3%81%A8isbinary%E3%81%AE%E7%9B%B8%E4%BA%92%E4%BD%9C%E7%94%A8%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6)
- [MorphTargetBind](#morphtargetbind)
- [MaterialColorBind](#materialcolorbind)
- [TextureTransformBind](#texturetransformbind)
- [Expression 更新のアルゴリズム](#expression-%E6%9B%B4%E6%96%B0%E3%81%AE%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0)
- [MorphTarget](#morphtarget)
- [MaterialColor と TextureTransform](#materialcolor-%E3%81%A8-texturetransform)
- [MaterialColor](#materialcolor)
- [TextureTransform](#texturetransform)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -184,6 +186,20 @@ var factor = 1.0 - saturate(value);
SetBlinkWeight(blinkWeight * factor);
```

### オーバーライドとisBinaryの相互作用について

isBinaryが指定されている表情が他の表情にオーバーライドの影響を与える場合、出力値である二値化された値をもって他の表情に影響を与えなければいけません(MUST)。

> これは、オーバーライドの影響を与える表情がキャラクター上に見た目として発現していないにも関わらず、他の表情がオーバーライドによって抑制されることを防ぐための仕様です。
> 例えば、表情 `happy``isBinary``true` で、かつ `overrideBlink``block` もしくは `blend` が指定されている場合、 `happy` の値が 0.5 以上のとき、 `blink` は完全に抑制されます。逆に、 `happy` の値が 0.5 未満のとき、 `blink``happy` の値に関係なく評価されます。
>
> ![上記の例における `happy` の出力値の図解](./figures/override-isbinary-ja.png)
isBinaryが指定されている表情が他の表情からオーバーライドの影響を受ける場合、受けている影響が0.0より大きければ、完全に抑制されなければいけません(MUST)。

> これは、オーバーライドの影響を受ける `isBinary``true` の表情が0もしくは1以外の値で発現することを防ぐための仕様です。
> 例えば、表情 `happy``overrideBlink``block` もしくは `blend` で、表情 `blink``isBinary``true` の場合、 `happy` が少しでもオーバーライドの影響を与えているならば、 `blink` は完全に抑制されます。
### MorphTargetBind

`extensions.VRMC_vrm.expressions[*].morphTargetBinds[*]`
Expand Down
18 changes: 17 additions & 1 deletion specification/VRMC_vrm-1.0/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ It is a function to specify the meaning for the group of.
- [Other](#other)
- [Custom Expressions](#custom-expressions)
- [Procedural override](#procedural-override)
- [Interaction between override and isBinary](#interaction-between-override-and-isbinary)
- [MorphTargetBind](#morphtargetbind)
- [MaterialColorBind](#materialcolorbind)
- [TextureTransformBind](#texturetransformbind)
- [Expression update algorithm](#expression-update-algorithm)
- [MorphTarget](#morphtarget)
- [MaterialColor and TextureTransform](#materialcolor-and-texturetransform)
- [MaterialColor](#materialcolor)
- [TextureTransform](#texturetransform)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Expand Down Expand Up @@ -186,6 +188,20 @@ var factor = 1.0 - saturate(value);
SetBlinkWeight(blinkWeight * factor);
```

### Interaction between override and isBinary

When an expression with isBinary overrides other expressions, the binary output value MUST be used to affect other expressions.

> This specification prevents other expressions from being suppressed when the overriding expression is not expressed visually on the character.
> For example, if `isBinary` is set to `true` for the `happy` expression and `block` or `blend` is set for `overrideBlink`, when the value of `happy` is greater than or equals 0.5, `blink` is completely suppressed. Conversely, when the value of `happy` is less than 0.5, the input value of `blink` is evaluated regardless of the value of `happy`.
>
> ![Figure explaining the output value of `happy` in the example above](./figures/override-isbinary-en.png)
When an expression with isBinary is overridden by other expressions, the expression MUST be completely suppressed if the effect received is greater than 0.0.

> This specification prevents expressions with `isBinary` that are overridden by other expressions from being expressed with values other than 0 or 1.
> For example, if `overrideBlink` of the expression `happy` is set to `block` or `blend`, and the `isBinary` of the expression `blink` is `true`, `blink` is completely suppressed if `happy` has any effect on it.
### MorphTargetBind

`extensions.VRMC_vrm.expressions [*] .morphTargetBinds [*]`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2fae173

Please sign in to comment.