Prechádzať zdrojové kódy

Add a default texture in the CurrentScreenBlock

Popov72 5 rokov pred
rodič
commit
31c6b438cd

BIN
assets/nme/currentScreenPostProcess.png


+ 3 - 0
src/Materials/Node/nodeMaterial.ts

@@ -39,6 +39,7 @@ import { VectorMergerBlock } from './Blocks/vectorMergerBlock';
 import { RemapBlock } from './Blocks/remapBlock';
 import { MultiplyBlock } from './Blocks/multiplyBlock';
 import { NodeMaterialModes } from './Enums/nodeMaterialModes';
+import { Texture } from '../Textures/texture';
 
 const onCreatedEffectParameters = { effect: null as unknown as Effect, subMesh: null as unknown as Nullable<SubMesh> };
 
@@ -1253,6 +1254,8 @@ export class NodeMaterial extends PushMaterial {
         const currentScreen = new CurrentScreenBlock("CurrentScreen");
         uv.connectTo(currentScreen);
 
+        currentScreen.texture = new Texture("https://assets.babylonjs.com/nme/currentScreenPostProcess.png", this.getScene());
+
         var fragmentOutput = new FragmentOutputBlock("FragmentOutput");
         currentScreen.connectTo(fragmentOutput, { output: "rgba" });