public void render(float[] mMVP, int renderTime) { if (!isTextureExist) { return; } if (particleCount <= 0) { return; } Gl.UseProgram(ProgramName); using (MemoryLock lockIndex = new MemoryLock(_ArrayIndex)) using (MemoryLock lockCoord = new MemoryLock(_ArrayCoord)) { //index Gl.VertexAttribPointer((uint)LocationIndex, 2, VertexAttribType.Float, false, 0, lockIndex.Address); Gl.EnableVertexAttribArray((uint)LocationIndex); //cord Gl.VertexAttribPointer((uint)LocationCoord, 2, VertexAttribType.Float, false, 0, lockCoord.Address); Gl.EnableVertexAttribArray((uint)LocationCoord); //MVP Gl.UniformMatrix4(LocationMVP, false, mMVP); //attr Gl.BindBufferBase(BufferTarget.ShaderStorageBuffer, 0, attrBufferId); //Gl.UnmapBuffer(BufferTarget.ShaderStorageBuffer); Gl.Uniform1(LocationNowTime, (float)renderTime); Gl.Uniform1(LocationTotalLifeTime, (float)maxRenderTime); Gl.Uniform1(LocationParticleCount, particleCount); Gl.Uniform2(LocationStartPos, arrStartPos[0], arrStartPos[1]); //texture Gl.BindTexture(TextureTarget.Texture2d, texId); //Gl.GenerateMipmap(TextureTarget.Texture2d); Gl.Uniform1(LocationTex, 0); Gl.DrawArraysInstanced(PrimitiveType.Polygon, 0, _ArrayIndex.Length / 2, particleCount); //Gl.DrawArraysInstanced(PrimitiveType.Points, 0, _ArrayIndex.Length / 2, particleCount); } Gl.BindBufferBase(BufferTarget.ShaderStorageBuffer, 0, 0); Gl.BindTexture(TextureTarget.Texture2d, 0); Gl.UseProgram(0); }