大约有 9 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0038 秒)
...HTMLImageElement Laya.loader.fetch( url,"image" ).then((res)=>{ //创建Texture2D var t2d: Texture2D = new Texture2D(res.width, res.height, TextureFormat.R8G8B8A8, false, false, true); t2d.setImageData(res, true, false); //创建Texture var texture: Texture = new Texture(t2d); let sp2:Sprite = ne...
来源: Laya3.0_文档 发布时间: 20230303
...edoColor: { type: Color, default: [1, 1, 1, 1] }, u_AlbedoTexture: { type: Texture2D, options: { define: "ALBEDOTEXTURE" } }, u_NormalTexture: { type: Texture2D, options: { define: "NORMALTEXTURE" } }, u_NormalScale: { type: Float, default: 1.0, range: [0.0, 2.0] }, u_Metallic: { type: Float, defaul...
来源: Laya3.0_文档 发布时间: 20251010
...求也是存在的。 目前,LayaAir可以实现自定义2D纹理渲染(Texture2D)和基础图元渲染(Primitive)。 本篇文档属于进阶性文档,在阅读前需要具备Shader的基础知识,可以参考3D着色器文档中的一些概念介绍。 二、结构与应用 2.1 着色器文...
来源: Laya3.0_文档 发布时间: 20251010
...H MESH Mesh资源 Laya.Loader.MATERIAL MATERIAL Material资源 Laya.Loader.TEXTURE2D TEXTURE2D Texture2D资源 Laya.Loader.TEXTURECUBE TEXTURE2D TextureCube资源 Laya.Loader.SPINE SPINE Spine资源 二、加载多个资源 有很多时候,我们需要把大量的资源在Loading界面进行预加...
来源: Laya3.0_文档 发布时间: 20251010
...D场景添加渲染物2.3 设置摄像机的目标纹理2.4 设置Sprite的Texture2.5 修改渲染纹理属性三、代码中混合使用3D混合使用3D 一、概述 在2D项目开发过程中,开发者往往需要在UI界面显示3D场景或者3D物体,比如游戏开发中,3D人物在2D背...
来源: Laya3.0_文档 发布时间: 20251010
...if #include "Sprite2DFrag.glsl"; void main() { clip(); vec4 textureColor = texture2D(u_baseRender2DTexture, v_texcoord); // 计算渐变因子 float gradientFactor = dot(v_texcoord, normalize(u_gradientDirection)) * 0.5 + 0.5; // 混合渐变颜色 vec4 gradientColor = mix(u_gradientStartColor, u_gr...
来源: Laya3.0_文档 发布时间: 20251120
...form变量。 3.1 Uniform常见变量类型 Uniform变量的常见类型:Texture2D,Color,Vector2,Vector3,Vector4,Bool,Float,Matrix4x4,TextureCube Texture2D用于2D纹理采样的图片类型,图片本地支持格式:JPG,PNG Color 颜色类型,为四个Float类型组成的...
来源: Laya3.0_文档 发布时间: 20251010
...Laya.TrailTextureMode.Stretch; //设置纹理 this._trail2D.texture = Laya.Texture2D.whiteTexture; // Laya.loader.load("此处填写纹理的路径").then((res) => { // this._trail2D.texture = res; // }); //设置线段颜色 this._trail2D.color = new Laya.Color(1, 1, 1, 1); } //控制物体向...
来源: Laya3.0_文档 发布时间: 20251010
...以初始化A*的地图数据 //读取地形图 this.aStarMap = Loader.getTexture2D("res/threeDimen/scene/TerrainScene/Assets/AStarMap.png"); //获得地图数据 var aStarArr = this.createGridFromAStarMap(this.aStarMap); //使用astar初始化地图数据 this.graph = new (window as any).Graph(aSta...
来源: Laya3.0_文档 发布时间: 20230303