|
@@ -188,7 +188,7 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
|
|
|
for (var index = 0; index < repeatCount; index++) {
|
|
|
injectionCode += `#ifdef MORPHTARGETS\r\n`;
|
|
|
if (manager?.isUsingTextureForTargets) {
|
|
|
- injectionCode += `${positionOutput.associatedVariableName} += (readVector3FromRawSampler(morphTargets[${index}], vertexID) - ${position.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
+ injectionCode += `${positionOutput.associatedVariableName} += (readVector3FromRawSampler(${index}., vertexID) - ${position.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
injectionCode += `vertexID += 1.0;\r\n`;
|
|
|
} else {
|
|
|
injectionCode += `${positionOutput.associatedVariableName} += (position${index} - ${position.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
@@ -197,7 +197,7 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
|
|
|
if (hasNormals) {
|
|
|
injectionCode += `#ifdef MORPHTARGETS_NORMAL\r\n`;
|
|
|
if (manager?.isUsingTextureForTargets) {
|
|
|
- injectionCode += `${normalOutput.associatedVariableName} += (readVector3FromRawSampler(morphTargets[${index}], vertexID) - ${normal.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
+ injectionCode += `${normalOutput.associatedVariableName} += (readVector3FromRawSampler(${index}., vertexID) - ${normal.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
injectionCode += `vertexID += 1.0;\r\n`;
|
|
|
} else {
|
|
|
injectionCode += `${normalOutput.associatedVariableName} += (normal${index} - ${normal.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
@@ -208,7 +208,7 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
|
|
|
if (hasUVs) {
|
|
|
injectionCode += `#ifdef MORPHTARGETS_UV\r\n`;
|
|
|
if (manager?.isUsingTextureForTargets) {
|
|
|
- injectionCode += `${uvOutput.associatedVariableName} += (readVector3FromRawSampler(morphTargets[${index}], vertexID).xy - ${uv.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
+ injectionCode += `${uvOutput.associatedVariableName} += (readVector3FromRawSampler(${index}., vertexID).xy - ${uv.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
injectionCode += `vertexID += 1.0;\r\n`;
|
|
|
} else {
|
|
|
injectionCode += `${uvOutput.associatedVariableName}.xy += (uv_${index} - ${uv.associatedVariableName}.xy) * morphTargetInfluences[${index}];\r\n`;
|
|
@@ -219,7 +219,7 @@ export class MorphTargetsBlock extends NodeMaterialBlock {
|
|
|
if (hasTangents) {
|
|
|
injectionCode += `#ifdef MORPHTARGETS_TANGENT\r\n`;
|
|
|
if (manager?.isUsingTextureForTargets) {
|
|
|
- injectionCode += `${tangentOutput.associatedVariableName} += (readVector3FromRawSampler(morphTargets[${index}], vertexID) - ${tangent.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
+ injectionCode += `${tangentOutput.associatedVariableName} += (readVector3FromRawSampler(${index}., vertexID) - ${tangent.associatedVariableName}) * morphTargetInfluences[${index}];\r\n`;
|
|
|
} else {
|
|
|
injectionCode += `${tangentOutput.associatedVariableName}.xyz += (tangent${index} - ${tangent.associatedVariableName}.xyz) * morphTargetInfluences[${index}];\r\n`;
|
|
|
}
|