瀏覽代碼

Add a default texture in the CurrentScreenBlock

Popov72 5 年之前
父節點
當前提交
31c6b438cd
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 二進制
      assets/nme/currentScreenPostProcess.png
  2. 3 0
      src/Materials/Node/nodeMaterial.ts

二進制
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" });