public ShaderUniformPackage(ShaderUniformPackage ShaderUniformPackage) { this._Size = new List <int>(ShaderUniformPackage._Size); this._ID = new List <string>(ShaderUniformPackage._ID); this._Type = new List <string>(ShaderUniformPackage._Type); this._Data = new List <byte[]>(ShaderUniformPackage._Data); }
public ShaderRenderer() : base() { this._PushedID = ""; this._Globals = new ShaderUniformPackage(); this._GridSize = -1; _Globals.SetDefinition("CameraPosition", 3 * sizeof(float), "vec3"); _Globals.SetDefinition("Projection", 16 * sizeof(float), "mat4"); _Globals.SetDefinition("ModelView", 16 * sizeof(float), "mat4"); }
public virtual void Update(ShaderUniformPackage ShaderUniformPackage) { for (int i = 0; i < ShaderUniformPackage._ID.Count; i++) { if (this.Exists(ShaderUniformPackage._ID[i])) { this.SetData(ShaderUniformPackage._ID[i], ShaderUniformPackage._Data[i]); } else { this.SetDefinition(ShaderUniformPackage._ID[i], ShaderUniformPackage._Size[i], ShaderUniformPackage._Type[i]); this.SetData(ShaderUniformPackage._ID[i], ShaderUniformPackage._Data[i]); } } }