|
@@ -12,6 +12,7 @@ import { Mesh } from '../../../../Meshes/mesh';
|
|
import { Scene } from '../../../../scene';
|
|
import { Scene } from '../../../../scene';
|
|
import { editableInPropertyPage, PropertyTypeForEdition } from "../../nodeMaterialDecorator";
|
|
import { editableInPropertyPage, PropertyTypeForEdition } from "../../nodeMaterialDecorator";
|
|
|
|
|
|
|
|
+import "../../../../Shaders/ShadersInclude/bumpFragmentMainFunctions";
|
|
import "../../../../Shaders/ShadersInclude/bumpFragmentFunctions";
|
|
import "../../../../Shaders/ShadersInclude/bumpFragmentFunctions";
|
|
import "../../../../Shaders/ShadersInclude/bumpFragment";
|
|
import "../../../../Shaders/ShadersInclude/bumpFragment";
|
|
|
|
|
|
@@ -163,12 +164,17 @@ export class PerturbNormalBlock extends NodeMaterialBlock {
|
|
state.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n`;
|
|
state.compilationString += `mat3 vTBN = mat3(tbnTangent, tbnBitangent, tbnNormal);\r\n`;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ state._emitFunctionFromInclude("bumpFragmentMainFunctions", comments, {
|
|
|
|
+ replaceStrings: [
|
|
|
|
+ tangentReplaceString,
|
|
|
|
+ ]
|
|
|
|
+ });
|
|
|
|
+
|
|
state._emitFunctionFromInclude("bumpFragmentFunctions", comments, {
|
|
state._emitFunctionFromInclude("bumpFragmentFunctions", comments, {
|
|
replaceStrings: [
|
|
replaceStrings: [
|
|
{ search: /vBumpInfos.y/g, replace: replaceForBumpInfos},
|
|
{ search: /vBumpInfos.y/g, replace: replaceForBumpInfos},
|
|
{ search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName},
|
|
{ search: /vTangentSpaceParams/g, replace: this._tangentSpaceParameterName},
|
|
{ search: /vPositionW/g, replace: worldPosition.associatedVariableName + ".xyz"},
|
|
{ search: /vPositionW/g, replace: worldPosition.associatedVariableName + ".xyz"},
|
|
- tangentReplaceString
|
|
|
|
]
|
|
]
|
|
});
|
|
});
|
|
|
|
|