Skip to content

Commit

Permalink
fix: MToon1MaterialContent
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuki Shimada committed Dec 24, 2024
1 parent 5cac55c commit f4ceab7
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/foundation/materials/contents/MToon1MaterialContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import { Material } from '../core/Material';
import { ComponentRepository } from '../../core/ComponentRepository';
import { WellKnownComponentTIDs } from '../../components/WellKnownComponentTIDs';
import { CameraComponent } from '../../components/Camera/CameraComponent';
import { ComponentType } from '../../definitions/ComponentType';
import { CompositionType } from '../../definitions/CompositionType';
import { Config } from '../../core/Config';
import { ShaderType } from '../../definitions/ShaderType';
import { VectorN } from '../../math/VectorN';

export class MToon1MaterialContent extends AbstractMaterialContent {
constructor(
Expand Down Expand Up @@ -42,6 +47,33 @@ export class MToon1MaterialContent extends AbstractMaterialContent {

if (isMorphing) {
this.__definitions += '#define RN_IS_MORPHING\n';

shaderSemanticsInfoArray.push(
{
semantic: 'dataTextureMorphOffsetPosition',
componentType: ComponentType.Int,
compositionType: CompositionType.ScalarArray,
arrayLength: Config.maxVertexMorphNumberInShader,
stage: ShaderType.VertexShader,
isInternalSetting: true,
initialValue: new VectorN(new Int32Array(Config.maxVertexMorphNumberInShader)),
min: -Number.MAX_VALUE,
max: Number.MAX_VALUE,
needUniformInDataTextureMode: true,
},
{
semantic: 'morphWeights',
componentType: ComponentType.Float,
compositionType: CompositionType.ScalarArray,
arrayLength: Config.maxVertexMorphNumberInShader,
stage: ShaderType.VertexShader,
isInternalSetting: true,
initialValue: new VectorN(new Float32Array(Config.maxVertexMorphNumberInShader)),
min: -Number.MAX_VALUE,
max: Number.MAX_VALUE,
needUniformInDataTextureMode: true,
}
);
}

if (isOutline) {
Expand Down

0 comments on commit f4ceab7

Please sign in to comment.