LayaAir 2.6 雪地shader整理

因为最近开发一个laya3d小游戏,有需要用到shader的地方,最后发现网上找的laya shader因为laya Api的变动而没能达到自己想要的效果,所以决定整理一下:

SnowMaterial.ts

export default class SnowMaterial extends Laya.Material {
    static DIFFUSETEXTURE = Laya.Shader3D.propertyNameToID("u_Texture");
    public readonly MAIN_TEX: number = Laya.Shader3D.propertyNameToID("u_MainTex");
    public readonly NOISE_TEX: number = Laya.Shader3D.propertyNameToID("u_NoiseTex");
    public readonly Time:number = Laya.Shader3D.propertyNameToID("u_Time");
    constructor() {
        super();
        var vs: string = `
        #include "Lighting.glsl";
        
        attribute vec4 a_Position;
        attribute vec2 a_Textcoord;
        uniform mat4 u_WorldMat;
        uniform mat4 u_MvpMatrix;
        
        varying vec2 v_textcoord;
        
        void main()
        {
            v_textcoord = a_Textcoord;
            gl_Position = 

你可能感兴趣的:(laya,shader,typescript,shader)