D
Davidyanlong
@Davidyanlong
-
-
LitMaterial 与 PhysicMaterial 两个材质有什么区别?似乎都是PBR材质
-
public initDefault() { console.time('texture') this.normalTexture = this.createTexture(32, 32, 255 * 0.5, 255 * 0.5, 255.0, 255.0, 'default-normalTexture'); this.maskTexture = this.createTexture(32, 32, 255, 255 * 0.5, 255.0, 255.0, 'default-maskTexture'); this.whiteTexture = this.createTexture(32, 32, 255, 255, 255, 255, 'default-whiteTexture'); this.blackTexture = this.createTexture(32, 32, 0, 0, 0, 255.0, 'default-blackTexture'); this.redTexture = this.createTexture(32, 32, 255, 0, 0, 255.0, 'default-redTexture'); this.blueTexture = this.createTexture(32, 32, 0, 0, 255, 255.0, 'default-blueTexture'); this.greenTexture = this.createTexture(32, 32, 0, 255, 0, 255, 'default-greenTexture'); this.yellowTexture = this.createTexture(32, 32, 0, 255, 255, 255.0, 'default-yellowTexture'); this.grayTexture = this.createTexture(32, 32, 128, 128, 128, 255.0, 'default-grayTexture'); let brdf = new BRDFLUTGenerate(); let brdf_texture = brdf.generateBRDFLUTTexture(); let BRDFLUT = brdf_texture.name = 'BRDFLUT'; this.addTexture(BRDFLUT, brdf_texture); this.defaultSky = new HDRTextureCube(); this.defaultSky.createFromTexture(128, this.blackTexture); Reference.getInstance().attached(this.defaultSky, this); Reference.getInstance().attached(brdf_texture, this); Reference.getInstance().attached(this.normalTexture, this); Reference.getInstance().attached(this.maskTexture, this); Reference.getInstance().attached(this.whiteTexture, this); Reference.getInstance().attached(this.blackTexture, this); Reference.getInstance().attached(this.redTexture, this); Reference.getInstance().attached(this.blueTexture, this); Reference.getInstance().attached(this.greenTexture, this); Reference.getInstance().attached(this.yellowTexture, this); Reference.getInstance().attached(this.grayTexture, this); this.defaultGUITexture = new GUITexture(this.whiteTexture); this.defaultGUISprite = new GUISprite(this.defaultGUITexture); this.defaultGUISprite.trimSize.set(4, 4) this.defaultMaterial = new LitMaterial(); console.timeEnd('texture') }
测试的结果是 9毫秒
-
老师,想获得该系列培训的PPT,在哪里可以下载到?
-
-
// 新建对象 const obj = new Object3D(); // 为对象添 MeshRenderer let mr = obj.addComponent(MeshRenderer); // 设置几何体 mr.geometry = new BoxGeometry(5, 5, 5); // 设置材质 mr.material = new LitMaterial();
这段代码中,
BoxGeometry
与LitMaterial
可以也作为组件的方式加入,例如:// 新建对象 const obj = new Object3D(); // 为对象添 MeshRenderer let mr = obj.addComponent(MeshRenderer); // 设置几何体 let geo = mr.addComponentnew(BoxGeometry); geo.init(5, 5, 5); // 设置材质 let mat = mr.addComponentnew(LitMaterial);
-
目前web端通用的格式是GLTF/GLB格式,FBX格式,或者USDZ格式
LitMaterial 与 PhysicMaterial 两个材质有什么区别?似乎都是PBR材质
LitMaterial 与 PhysicMaterial 两个材质有什么区别?似乎都是PBR材质
这段代码感觉性能消耗有点大,影响首屏的时间
WebGPU小白入门(一): 零基础创建第一个WebGPU项目
组件中可以再添加组件吗?
组件中可以再添加组件吗?
Orillusion打造3D文件Converter